本文整理汇总了C++中QSplashScreen::setWindowIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplashScreen::setWindowIcon方法的具体用法?C++ QSplashScreen::setWindowIcon怎么用?C++ QSplashScreen::setWindowIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen::setWindowIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pixmap
DianVoteControl::DianVoteControl(QWidget *parent) :
QWidget(parent),
ui(new Ui::DianVoteControl),
drawer(NULL),
hidControl(NULL),
stopWatch(NULL),
splash(NULL),
voteMode(SINGLE_VOTE),
curState(STOP)
{
QDir dir;
dir.setCurrent(QCoreApplication::applicationDirPath());
windowIcon = new QIcon(dir.absoluteFilePath("res/images/app-icon.png"));
this->setWindowIcon(*windowIcon);
// show splash.
QPixmap pixmap(dir.absoluteFilePath("res/images/logo.png"));
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->setWindowIcon(*windowIcon);
splash->setWindowFlags(Qt::WindowStaysOnTopHint);
splash->setMask(pixmap.mask());
splash->show();
ui->setupUi(this);
pbStart = new QPushButton(this);
pbStart->setObjectName(tr("pbStart"));
ui->buttonLayout->addWidget(pbStart, 0, 0);
pbAuto = new QPushButton(this);
pbAuto->setObjectName(tr("pbAuto"));
ui->buttonLayout->addWidget(pbAuto, 0, 1);
pbPause = new QPushButton(this);
pbPause->setObjectName(tr("pbPause"));
ui->buttonLayout->addWidget(pbPause, 0, 0);
pbPause->hide();
pbStop = new QPushButton(this);
pbStop->setObjectName(tr("pbStop"));
ui->buttonLayout->addWidget(pbStop, 0, 1);
pbStop->hide();
pbResult = new QPushButton(this);
pbResult->setObjectName(tr("pbResult"));
ui->buttonLayout->addWidget(pbResult, 0, 2);
pbOption = new QToolButton(this);
pbOption->setObjectName(tr("pbOption"));
ui->buttonLayout->addWidget(pbOption, 0, 3);
qaSingleMode = new QAction(tr("SingleVoteMode"), this); // 单选模式
qaSingleMode->setCheckable(true);
qaSingleMode->setChecked(true); // 默认模式
qaMutipleMode = new QAction(tr("MutipleVoteMode"), this); // 多选
qaMutipleMode->setCheckable(true);
qaRaceMode = new QAction(tr("RaceVoteMode"), this); // 抢答
qaRaceMode->setCheckable(true);
pbOption->addAction(qaSingleMode);
pbOption->addAction(qaMutipleMode);
pbOption->addAction(qaRaceMode);
connect(qaSingleMode, SIGNAL(triggered()), this, SLOT(DoSingleMode()));
connect(qaMutipleMode, SIGNAL(triggered()), this, SLOT(DoMutipleMode()));
connect(qaRaceMode, SIGNAL(triggered()), this, SLOT(DoRaceVoteMode()));
pbClose = new QPushButton(this);
pbClose->setObjectName(tr("pbClose"));
ui->buttonLayout->addWidget(pbClose, 0, 4);
connect(pbClose, SIGNAL(clicked()), this, SLOT(close()));
connect(pbStart, SIGNAL(clicked()), this, SLOT(VoteStart()));
connect(pbAuto, SIGNAL(clicked()), this, SLOT(VoteAuto()));
connect(pbPause, SIGNAL(clicked()), this, SLOT(VotePause()));
connect(pbStop, SIGNAL(clicked()), this, SLOT(VoteStop()));
connect(pbResult, SIGNAL(clicked()), this, SLOT(DoShowResults()));
drawer = new DianVoteDrawer();
drawer->setWindowIcon(*windowIcon);
drawer->setWindowTitle(tr("Result"));
connect(pbClose, SIGNAL(clicked()), this->drawer, SLOT(close()));
connect(this, SIGNAL(setOptionNum(int)), drawer->histgram, SLOT(SetOptionNums(int)));
connect(this, SIGNAL(setOptionNum(int)), drawer->pie, SLOT(SetOptionNums(int)));
connect(this, SIGNAL(clearDrawData()), drawer->histgram, SLOT(ClearData()));
connect(this, SIGNAL(clearDrawData()), drawer->pie, SLOT(ClearData()));
connect(this, SIGNAL(updateGraph(int)), drawer->histgram, SLOT(HandleData(int)));
connect(this, SIGNAL(updateGraph(int)), drawer->pie, SLOT(HandleData(int)));
LoadStyleSheet("Default");
// 记录初始化窗口大小
initSize = this->size();
this->setMaximumWidth(this->width());
this->setMaximumHeight(this->height() + 100);
this->move(0, 0);
// 创建Log文件,并打开,程序退出是关闭
VoteLog->open(QIODevice::WriteOnly | QIODevice::Append);
// 初始化log记录链表
//.........这里部分代码省略.........