📄 colordialog.cpp
字号:
#include "colordialog.h"ColorDialog::ColorDialog(QWidget *parent,const char *name, bool isModal) :QDialog(parent,name,isModal){ redbutton = new QPushButton("red",this); greenbutton = new QPushButton("green",this); bluebutton = new QPushButton("blue",this); whitebutton = new QPushButton("white",this); connect(redbutton,SIGNAL(click()),SLOT(ChooseBackgroundColor())); connect(greenbutton,SIGNAL(click()),SLOT(ChooseBackgroundColor())); connect(bluebutton,SIGNAL(click()),SLOT(ChooseBackgroundColor())); connect(whitebutton,SIGNAL(click()),SLOT(ChooseBackgroundColor()));}void ChooseBackgroundColor(){ if(redbutton->isDown()) col = red; else if(greenbutton->isDown()) { col = green; } else if(bluebutton->isDown()) { col = blue; } else if(whitebutton->isDown()) { col = white; }}void color(){ return col;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -