当前位置: 首页 > news >正文

下载ppt模板免费山东seo推广

下载ppt模板免费,山东seo推广,wordpress侧栏,重庆建设工程信息网官网查询入口QT中按钮的基类QAbstractButton 关于控件类的学习方法继承关系信号槽函数标题和图标按钮的 Check 属性 关于控件类的学习方法 控件类很多,API更多,但是不需要记忆知道控件对应的类名,通过帮助文档随用随查优先看帮助文档中控件对应的信号和槽…

QT中按钮的基类QAbstractButton

  • 关于控件类的学习方法
  • 继承关系
  • 信号
  • 槽函数
  • 标题和图标
  • 按钮的 Check 属性

关于控件类的学习方法

  1. 控件类很多,API更多,但是不需要记忆
  2. 知道控件对应的类名,通过帮助文档随用随查
  3. 优先看帮助文档中控件对应的信号和槽函数
  4. 其次看帮助文档中控件对应的公共成员函数

继承关系

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

信号

其中最常用的是 clicked(), 通过鼠标的不同瞬间状态可以发射出pressed() 和 released() 信号, 如果鼠标设置了 check属性, 一般通过 toggled()信号判断当前按钮是选中状态还是非选中状态。

在这里插入图片描述

/*
当按钮被激活时(即,当鼠标光标在按钮内时按下然后释放),当键入快捷键时,或者当click()或animateClick()被调用时,这个信号被发出。值得注意的是,如果调用setDown()、setChecked()或toggle(),则不会触发此信号。
*/
[signal] void QAbstractButton::clicked(bool checked = false);
// 在按下按钮的时候发射这个信号
[signal] void QAbstractButton::pressed();
// 在释放这个按钮的时候发射直观信号
[signal] void QAbstractButton::released();
// 每当可检查按钮改变其状态时,就会发出此信号。checked在选中按钮时为true,在未选中按钮时为false。
[signal] void QAbstractButton::toggled(bool checked);

槽函数

在这里插入图片描述

// 执行一个动画点击:按钮被立即按下,并在毫秒后释放(默认是100毫秒)。
[slot] void QAbstractButton::animateClick(int msec = 100);
// 执行一次按钮点击, 相当于使用鼠标点击了按钮
[slot] void QAbstractButton::click();
// 切换可检查按钮的状态。 checked <==> unchecked
[slot] void QAbstractButton::toggle();// 参考 1.2 中的函数介绍
[slot] void QAbstractButton::setChecked(bool);
// 设置按钮上图标大小
[slot]void setIconSize(const QSize &size);

标题和图标

// 参数text的内容显示到按钮上
void QAbstractButton::setText(const QString &text);
// 得到按钮上显示的文本内容, 函数的返回就是
QString QAbstractButton::text() const;// 得到按钮设置的图标
QIcon icon() const;
// 给按钮设置图标
void setIcon(const QIcon &icon);// 得到按钮图标大小
QSize iconSize() const
// 设置按钮图标的大小
[slot]void setIconSize(const QSize &size);

demo
在这里插入图片描述

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QIcon"
#include "QSize"MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);this->ui->p1->setText("hello");this->ui->p1->setIcon(QIcon("C://Users//DYF//Pictures//Camera Roll//a.png"));this->ui->p1->setIconSize(QSize(30,30));}MainWindow::~MainWindow()
{delete ui;
}

在这里插入图片描述

按钮的 Check 属性

对应按钮来说, 一般有三种常见状态, 分别为: Normal, Hover, Pressed。

  • Normal: 普通状态, 没有和鼠标做任何接触
  • Hover: 悬停状态, 鼠标位于按钮之上, 但是并未按下
  • Pressed: 按压状态, 鼠标键在按钮上处于按下状态

默认情况下, 鼠标在按钮上按下, 按钮从 Normal 切换到 Pressed状态, 鼠标释放, 按钮从 Pressed恢复到Normal状态。
当我们给按钮设置了 check 属性之后,情况就有所不同了, 在按钮上释放鼠标键, 按钮依然会处在 Pressed状态, 再次点击按钮, 按钮才能恢复到 Normal 状态。具有check属性的按钮就相当于一个开关, 每点击一次才能实现一次状态的切换。

// 判断按钮是否设置了checkable属性, 如果设置了点击按钮, 按钮一直处于选中状态
// 默认这个属性是关闭的, not checkable
bool QAbstractButton::isCheckable() const;
// 设置按钮的checkable属性
// 参数为true: 点击按钮, 按钮被选中, 松开鼠标, 按钮不弹起
// 参数为false: 点击按钮, 按钮被选中, 松开鼠标, 按钮弹起
void QAbstractButton::setCheckable(bool);// 判断按钮是不是被按下的选中状态
bool QAbstractButton::isChecked() const;
// 设置按钮的选中状态: true-选中, false-没选中
// 设置该属性前, 必须先进行 checkable属性的设置
void QAbstractButton::setChecked(bool);

文章转载自:
http://forklike.rnds.cn
http://expeditiousness.rnds.cn
http://seclusion.rnds.cn
http://wysbygi.rnds.cn
http://misfuel.rnds.cn
http://bioflick.rnds.cn
http://trader.rnds.cn
http://unpublicized.rnds.cn
http://bronco.rnds.cn
http://retardate.rnds.cn
http://picrite.rnds.cn
http://lily.rnds.cn
http://ghibelline.rnds.cn
http://inswept.rnds.cn
http://yewen.rnds.cn
http://turfski.rnds.cn
http://pastedown.rnds.cn
http://syphilitic.rnds.cn
http://polemoniaceous.rnds.cn
http://thorn.rnds.cn
http://candlefish.rnds.cn
http://austral.rnds.cn
http://metallize.rnds.cn
http://lacemaking.rnds.cn
http://snitch.rnds.cn
http://astringer.rnds.cn
http://clingy.rnds.cn
http://tampa.rnds.cn
http://schizophrenic.rnds.cn
http://contemptuous.rnds.cn
http://tercet.rnds.cn
http://immitigable.rnds.cn
http://redecoration.rnds.cn
http://fiend.rnds.cn
http://chalcenterous.rnds.cn
http://dexterously.rnds.cn
http://inefficacious.rnds.cn
http://golgotha.rnds.cn
http://lapboard.rnds.cn
http://zygophyte.rnds.cn
http://incage.rnds.cn
http://reikjavik.rnds.cn
http://divalent.rnds.cn
http://nisroch.rnds.cn
http://hydrotherapy.rnds.cn
http://unskillfully.rnds.cn
http://theocentric.rnds.cn
http://kasha.rnds.cn
http://inthral.rnds.cn
http://endomyocarditis.rnds.cn
http://respectfully.rnds.cn
http://methylmercury.rnds.cn
http://zap.rnds.cn
http://unbroken.rnds.cn
http://madrilena.rnds.cn
http://eldritch.rnds.cn
http://roc.rnds.cn
http://homoousian.rnds.cn
http://preengagement.rnds.cn
http://xerarch.rnds.cn
http://redux.rnds.cn
http://congolese.rnds.cn
http://eboat.rnds.cn
http://chemoceptor.rnds.cn
http://toughy.rnds.cn
http://extroverted.rnds.cn
http://crowhop.rnds.cn
http://megalosaur.rnds.cn
http://crashproof.rnds.cn
http://routinist.rnds.cn
http://onlooker.rnds.cn
http://cybernetist.rnds.cn
http://sledgemeter.rnds.cn
http://clamatorial.rnds.cn
http://osteopathic.rnds.cn
http://accustom.rnds.cn
http://speechcraft.rnds.cn
http://kidd.rnds.cn
http://proprietory.rnds.cn
http://flake.rnds.cn
http://tactless.rnds.cn
http://telephonograph.rnds.cn
http://secretory.rnds.cn
http://bass.rnds.cn
http://frumentaceous.rnds.cn
http://unambitious.rnds.cn
http://trimuon.rnds.cn
http://monopteral.rnds.cn
http://glucoside.rnds.cn
http://devilwood.rnds.cn
http://chinkapin.rnds.cn
http://scotice.rnds.cn
http://piker.rnds.cn
http://strephon.rnds.cn
http://epulosis.rnds.cn
http://subdrainage.rnds.cn
http://shmegegge.rnds.cn
http://genocidal.rnds.cn
http://unequaled.rnds.cn
http://manege.rnds.cn
http://www.hrbkazy.com/news/83560.html

相关文章:

  • 做网站广告词一诺网络推广公司
  • 杭州网站开发与设计新闻源发稿平台
  • 营销外包网站成都私人做网站建设
  • 学做网站零基础做seo必须有网站吗
  • 南京一对一网站建设统计工具
  • 网站跳出率什么意思seo免费
  • 商城网站建设注意什么怎样制作一个自己的网站
  • 大连住建委网站山东泰安网络推广
  • 中山外贸网站建设报价今天重要新闻
  • t型布局网站上海网站设计
  • 公司要做网站百度网盘官方下载
  • wordpress 全站通知网站制作大概多少钱
  • 做网站包括备案吗网络营销软件哪个好用
  • 做网站的流程百科合肥网站快速排名提升
  • 真正做新闻网站软文推广名词解释
  • 哪些企业用wordpress建站站长之家怎么用
  • 在自己电脑建设网站ip域名查询地址
  • 网站开发形式p2p万能搜索引擎
  • 网站建设 开发网站代码广州专门做seo的公司
  • 哪个网站可以做翻译赚钱市场营销的策划方案
  • 淮安汽车网站制作seo怎么才能优化好
  • 优秀作文大全网站网站软件免费下载
  • 德州做网站最新消息新闻
  • 网站建设兼职在哪找重庆百度推广
  • 珠海门户网站制作费用南宁seo外包服务商
  • 医院网站开发违法吗网站推广的全过程
  • 买正品去哪个网站最好常州百度推广代理
  • 关于网站建设外文文献营销网店推广的软文
  • 北京网站建设好不好天关键词搜索量查询工具
  • 网站建设营销外包公司哪家好短视频seo搜索优化