当前位置: 首页>>代码示例>>C++>>正文


C++ QPushButton::clicked方法代码示例

本文整理汇总了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");
}
开发者ID:SuppenGeist,项目名称:pse-ws1516-videoencoder-ta,代码行数:30,代码来源:testanalysistab.cpp

示例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();
    }
}
开发者ID:sisuani,项目名称:voipc,代码行数:29,代码来源:mainwindow.cpp

示例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);
}
开发者ID:SuppenGeist,项目名称:pse-ws1516-videoencoder-ta,代码行数:14,代码来源:testmainwindow.cpp


注:本文中的QPushButton::clicked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。