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
0
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();
    }
}
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);
}