color_dialog
msg_dialog
widget.cpp
#include "widget.h" #include "ui_widget.h" Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); Init(); } Widget::~Widget() { delete ui; } void Widget::Init() { //信号与槽 connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(doProcessClickedPushbtn())); connect(ui->btn2,SIGNAL(clicked()),this,SLOT(doProcessClickedColorbtn())); } //color_dialog 静态 /ColorDialogue// void Widget::doProcessClickedColorbtn(){ qDebug()<<"clicked clor pushbutton"<label->palette();//获取palettle pe.setColor(QPalette::WindowText,mycolor); ui->label->setPalette(pe); } } //msg_dialog 静态 MessageDialogue/ void Widget::doProcessClickedPushbtn() { qDebug()<<"clicked pushbutton"< widget.h
#ifndef WIDGET_H #define WIDGET_H #include#include #include #include namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); ~Widget(); private: Ui::Widget *ui; void Init(); private slots: void doProcessClickedPushbtn(); void doProcessClickedColorbtn(); }; #endif // WIDGET_H 欢迎分享,转载请注明来源:内存溢出
评论列表(0条)