本文整理汇总了C++中QPushButton::clicked方法的典型用法代码示例。如果您正苦于以下问题:C++ QPushButton::clicked方法的具体用法?C++ QPushButton::clicked怎么用?C++ QPushButton::clicked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPushButton
的用法示例。
在下文中一共展示了QPushButton::clicked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadVideo
void TestAnalysisTab::loadVideo(QString path, int width, int height, int fps,
Utility::Compression compression, Utility::YuvType type) {
//get LoadVideo button
QPushButton* loadVideo;
QList<QPushButton*> buttonList =
TestMainWindow::getCurrentMainWindow()->findChildren<QPushButton*>();
for(int i = 0; i < buttonList.length() ; i++) {
if(buttonList.at(i)->text() == "Load new video") {
loadVideo = buttonList.at(i);
}
}
QVERIFY2(loadVideo != NULL,"Could not find load video button");
QTest::qSleep(500);
WriteYuvFilePath* writer = new WriteYuvFilePath;
writer->setPath(path);
writer->setHeight(height);
writer->setWidth(width);
writer->setFps(fps);
writer->setYuvType(type);
writer->setCompression(compression);
writer->setThread(QThread::currentThread());
writer->start();
loadVideo->clicked();
QCoreApplication::processEvents();
QTest::qSleep(2000);
QVERIFY2(path ==
TestMainWindow::getCurrentMainWindow()->getMemento()->getAnalysisTabMemento()->getRawVideo()->getPath(),
"Wrong video path");
}
示例2: execCommand
void MainWindow::execCommand(const int cmd, const QString &arg)
{
if (cmd == Dial) {
QString d;
if (arg == "*")
d = "Star";
else if (arg == "#")
d = "Number";
QPushButton *dButton = findChild<QPushButton *>(QString::fromUtf8("d%1Button").arg(d));
if (dButton)
dButton->clicked();
} else if (cmd == Call) {
ui->uriComboBox->setCurrentText(arg);
callClicked();
} else if (cmd == Hangup) {
hangupClicked();
} else if (cmd == Pickup) {
if (voipc.state() == "INCOMING") {
callClicked();
}
} else if (cmd == Mute) {
ui->muteButton->setChecked(true);
muteClicked();
} else if (cmd == Unmute) {
ui->muteButton->setChecked(false);
muteClicked();
}
}
示例3: clickButton
void TestMainWindow::clickButton(QString text, QObject* parent) {
QList<QPushButton*> buttonList = parent->findChildren<QPushButton*>();
QPushButton* button;
for(int i = 0; i < buttonList.length() ; i++) {
if(buttonList.at(i)->text() == text) {
button = buttonList.at(i);
}
}
QVERIFY2(button != NULL, (QString("button with text \"")+ text +
QString("\" not found")).toLatin1().data());
button->clicked();
qApp->processEvents();
QTest::qSleep(500);
}