本文整理汇总了C++中QAbstractButton::setWhatsThis方法的典型用法代码示例。如果您正苦于以下问题:C++ QAbstractButton::setWhatsThis方法的具体用法?C++ QAbstractButton::setWhatsThis怎么用?C++ QAbstractButton::setWhatsThis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAbstractButton
的用法示例。
在下文中一共展示了QAbstractButton::setWhatsThis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGridLayout
StartTab::StartTab(MainWindow *mainWindow)
{
setBackgroundRole(QPalette::Base);
setAutoFillBackground(true);
QGridLayout *gridLayout = new QGridLayout(this);
gridLayout->setAlignment(Qt::AlignCenter);
gridLayout->setMargin(10);
gridLayout->setSpacing(15);
QAbstractButton *button =
addShortcut(i18n("&1 Play File"), QIcon::fromTheme(QLatin1String("video-x-generic"), QIcon(":video-x-generic")), this);
button->setShortcut(Qt::Key_1);
button->setWhatsThis(i18n("Open dialog to play a file"));
connect(button, SIGNAL(clicked()), mainWindow, SLOT(open()));
gridLayout->addWidget(button, 0, 0);
button = addShortcut(i18n("&2 Play Audio CD"), QIcon::fromTheme(QLatin1String("media-optical-audio"), QIcon(":media-optical-audio")), this);
button->setShortcut(Qt::Key_2);
button->setWhatsThis(i18n("Start playing an audio CD. It assumes that the CD is already there at the CD driver"));
connect(button, SIGNAL(clicked()), mainWindow, SLOT(openAudioCd()));
gridLayout->addWidget(button, 0, 1);
button = addShortcut(i18n("&3 Play Video CD"), QIcon::fromTheme(QLatin1String("media-optical"), QIcon(":media-optical")), this);
button->setShortcut(Qt::Key_3);
button->setWhatsThis(i18n("Start playing a Video CD. It assumes that the CD is already there at the CD driver"));
connect(button, SIGNAL(clicked()), mainWindow, SLOT(openVideoCd()));
gridLayout->addWidget(button, 0, 2);
button = addShortcut(i18n("&4 Play DVD"), QIcon::fromTheme(QLatin1String("media-optical"), QIcon(":media-optical")), this);
button->setShortcut(Qt::Key_4);
button->setWhatsThis(i18n("Start playing a DVD. It assumes that the DVD is already there at the DVD driver"));
connect(button, SIGNAL(clicked()), mainWindow, SLOT(openDvd()));
gridLayout->addWidget(button, 1, 0);
#if HAVE_DVB == 1
button = addShortcut(i18n("&5 Digital TV"), QIcon::fromTheme(QLatin1String("video-television"), QIcon(":video-television")), this);
button->setShortcut(Qt::Key_5);
button->setWhatsThis("Open the Digital TV live view window. If the TV channels are already scanned, it will start playing the last channel");
connect(button, SIGNAL(clicked()), mainWindow, SLOT(playDvb()));
gridLayout->addWidget(button, 1, 1);
#endif /* HAVE_DVB == 1 */
}
示例2: on_buttonNewGame_clicked
void TicTacToe::on_buttonNewGame_clicked()
{
QListIterator<QAbstractButton *> i(gameField->buttons());
while (i.hasNext())
{
QAbstractButton *qab = i.next();
qab->setEnabled(true);
qab->setIcon(QIcon());
qab->setWhatsThis("");
}
buttonNewGame->setEnabled(false);
switchPlayer();
}