欢迎来到天天文库
浏览记录
ID:6118430
大小:39.00 KB
页数:9页
时间:2018-01-03
《linux窗口程序设计-qt4精彩实例分析实例6实现qq抽屉效果》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、//drawer.h#ifndefDRAWER_H#defineDRAWER_H#includeclassDrawer:publicQToolBox{Q_OBJECTpublic:Drawer(QWidget*parent=0,Qt::WindowFlagsf=0);//构造函数~Drawer();//析构函数QToolButton*toolButton1_1;//定义各个抽屉里的按键(图像实质上就是按键)QToolButton*toolButton1_2;QToolButton*tool
2、Button1_3;QToolButton*toolButton1_4;QToolButton*toolButton1_5;QToolButton*toolButton2_1;QToolButton*toolButton2_2;QToolButton*toolButton3_1;QToolButton*toolButton3_2;};#endif//drawer.cpp#include"drawer.h"Drawer::Drawer(QWidget*parent,Qt::WindowFlagsf):QT
3、oolBox(parent,f){setWindowTitle(tr("MyQQ"));QGroupBox*groupBox1=newQGroupBox();//定义第一个GroupBox组,组中有四个成员toolButton1_1=newQToolButton();//定义各个按键属性toolButton1_1->setText(tr("beibei"));toolButton1_1->setIcon(QPixmap(":/images/bb.png"));toolButton1_1->setIcon
4、Size(QPixmap(":/images/bb.png").size());toolButton1_1->setAutoRaise(TRUE);toolButton1_1->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);toolButton1_2=newQToolButton();toolButton1_2->setText(tr("jingjing"));toolButton1_2->setIcon(QPixmap(":/images/jj.png
5、"));toolButton1_2->setIconSize(QPixmap(":/images/jj.png").size());toolButton1_2->setAutoRaise(TRUE);toolButton1_2->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);toolButton1_3=newQToolButton();toolButton1_3->setText(tr("huanhuan"));toolButton1_3->setIco
6、n(QPixmap(":/images/hh.png"));toolButton1_3->setIconSize(QPixmap(":/images/hh.png").size());toolButton1_3->setAutoRaise(TRUE);toolButton1_3->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);toolButton1_4=newQToolButton();toolButton1_4->setText(tr("yingyin
7、g"));toolButton1_4->setIcon(QPixmap(":/images/yy.png"));toolButton1_4->setIconSize(QPixmap(":/images/yy.png").size());toolButton1_4->setAutoRaise(TRUE);toolButton1_4->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);toolButton1_5=newQToolButton();toolButt
8、on1_5->setText(tr("nini"));toolButton1_5->setIcon(QPixmap(":/images/nn.png"));toolButton1_5->setIconSize(QPixmap(":/images/nn.png").size());toolButton1_5->setAutoRaise(TRUE);toolButton1_5->setToolButtonStyle(Qt::ToolButton
此文档下载收益归作者所有