QPushButton使用样例
来源:互联网 发布:rsa加密算法c语言实现 编辑:程序博客网 时间:2024/06/05 07:24
ui->pushButton->setText("按钮");//设置文字 ui->pushButton->setAutoDefault(true);//设置autoDefault属性 ui->pushButton->setFlat(true);//设置按键的外观是否有突起 ui->pushButton->setIcon(QIcon("C:\\Users\\Administrator\\Desktop\\rest.png"));//设置图标 //ui->pushButton->setGeometry(QRect(50,60,90,100));//设置按钮大小位置 //ui->pushButton->setGeometry(QRect(QPoint(100, 100),QSize(200, 50)));//设置按钮大小位置 ui->pushButton->resize(100,100);//改变按钮大小 connect(ui->pushButton, SIGNAL(released()),this, SLOT());//信号的使用,SLOT()括号里面添加槽函数 QPalette pal; pal.setColor(QPalette::ButtonText, QColor(255,0,0)); //QPalete::Window,通常指窗口部件的背景色; //QPalette:WindowText,通常指窗口不见的前景色; //QPalette::Base,指文本输入窗口部件(比如QtextEdit,QLinedit等)的背景色. //QPalette::Text,与QPalette::Base一块使用,指文本输入窗口部件的前景色; //QPalette::Button,指按钮窗口部件的背景色; //QPalette::ButtonText,指按钮窗口部件的前景色. //ui->pushButton->setPalette(pal);//设置窗口按钮字体颜色 ui->pushButton->setStyleSheet("QPushButton{background-color:black;color: white; border-radius: 10px; " " border: 2px groove gray;border-style: outset;}" "QPushButton:hover{background-color:white; color: black;}" "QPushButton:pressed{background-color:rgb(85, 170, 255)" ";border-style: inset; }");//设置按钮风格,黑底(背景色),白字(前景色),圆角,向外凸起;
阅读全文
0 0
- QPushButton使用样例
- 怎样使用QPushButton?
- 怎样使用QPushButton?
- QPushButton
- QPushButton
- QPushButton
- Qpushbutton
- QPushButton
- QPushButton
- Qt中使用QGridLayout 使QPushButton占两行
- QT4 Widget QPushButton BoxLayout 图层管理使用实例
- Qt中使用setStyleSheet对QPushButton按钮进行外观设置
- QT 入门 -QApplication QPushButton QDialog Ui类型的手工使用
- QPushButton 自定义下拉菜单,不使用setMuen()接口
- Qt中使用setStyleSheet对QPushButton按钮进行外观设置
- QPaint QPushButton
- QPushButton Signal
- QPushButton 控制
- maven deploy到nexus报错:Return code is: 401
- Android 7.0 修改设置里Location选项默认为关闭
- swfupload 上传中文文件名乱码问题
- jsp表单中不同按钮实现不同方法
- C++中的pair,make_pair学习
- QPushButton使用样例
- $JAVA_HOME
- 时间是选择
- Qt各个版本和插件的下载方法
- 宏函数为什么使用do{...}while{0}包起来
- activeMQ学习笔记 -- day03 整合spirng
- 分布式事务操作之Spring +JTA
- [Unity&重装系统]GHOST WIN7 64位系统 安装 之后,安装Microsoft .NET Framework 4安装失败
- 策略模式