2013年3月28日
摘要: 现在窗体的构造函数中写: QPixmap pix; //设置一个QPixmap的对象。 pix.load("searchFunction/bg_s.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither); resize(pix.size()); //设置窗口的尺寸为图片的尺寸 setMask(pix.mask()); //先通过pix的方法获得图片的过滤掉透明的部分得到的图片,作为shapeWidget的不规则边框。 setWindowOpacity(0.8); //设置图片透明度然... 阅读全文
posted @ 2013-03-28 16:26 Q11三工鸟yue 阅读(312) 评论(0) 推荐(0) 编辑
摘要: //.h文件#include<QWidget>classwidget:publicQWidget{Q_OBJECTQ_PROPERTY(QString text READ text WRITE setText)public:explicitwidget(QWidget*parent=0);voidsetText(constQString&newText);QStringtext()const{returnmyText;}QSizesizeHint()const;protected:voidpaintEvent(QPaintEvent*event);voidtimerEven 阅读全文
posted @ 2013-03-28 16:22 Q11三工鸟yue 阅读(2576) 评论(0) 推荐(0) 编辑
摘要: QComboBoxcombox=new QComboBox; connect(combox,SIGNAL(currentIndexChanged(QString)),this,SLOT(getClassOneName()));注意:currentIndexChanged(QString)是用来判断combox的text的字符串的值是否改变了,这个是自带的signal信号,getClassOneName()是我自己定义的槽函数(想实现什么可以写在这里) combox->setFixedHeight(30); combox->setFixedWidth(80);//用来设置控件的宽度和 阅读全文
posted @ 2013-03-28 14:25 Q11三工鸟yue 阅读(743) 评论(0) 推荐(0) 编辑