my code or that Gtk code ..?
my Qt code:
timer2->setSingleShot(TRUE);
timer_FS->start(300);
container2
->setPalette
(QPalette(Qt
::red));
container2->setAutoFillBackground(true);
procc2
->setProcessChannelMode
(QProcess::MergedChannels);
connect(procc2, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout2()));
timer2 = new QTimer(this);
timer2->setSingleShot(TRUE);
timer_FS = new QTimer(this);
timer_FS->start(300);
container2 = new QX11EmbedContainer(this);
container2->setPalette(QPalette(Qt::red));
container2->setAutoFillBackground(true);
procc2 = new QProcess();
procc2->setProcessChannelMode(QProcess::MergedChannels);
connect(procc2, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout2()));
To copy to clipboard, switch view to plain text mode
layoout4->addWidget(container2);
mainFrame5->setLayout(layoout4);
connect(timer2, SIGNAL(timeout()), this, SLOT(embed2()));
connect(FPSBackButton, SIGNAL(clicked()), this, SLOT(timeout_bg2()));
connect(timer_FS, SIGNAL(timeout()), this, SLOT(timeout_FS()));
QHBoxLayout *layoout4 = new QHBoxLayout();
layoout4->addWidget(container2);
mainFrame5->setLayout(layoout4);
connect(timer2, SIGNAL(timeout()), this, SLOT(embed2()));
connect(FPSBackButton, SIGNAL(clicked()), this, SLOT(timeout_bg2()));
connect(timer_FS, SIGNAL(timeout()), this, SLOT(timeout_FS()));
To copy to clipboard, switch view to plain text mode
/*setFPScanner =1 will be set when a embed Button is clicked in my Qt app*/
void
MainWindow::timeout_FS(){
if(setFPScanner == 1)
mainstackedWidget->setCurrentIndex(4);
else if(embedFPScanner == 1)
{
//QString program4 = "./animate";
if(procc2
->state
() != QProcess::Running) {
procc2->start(program4, arguments2);
}
}
}
void
MainWindow::timeout_FS(){
if(setFPScanner == 1)
mainstackedWidget->setCurrentIndex(4);
else if(embedFPScanner == 1)
{
QString program4 = "./gtk_demo2";
//QString program4 = "./animate";
QStringList arguments2;
if(procc2->state() != QProcess::Running)
{
procc2->start(program4, arguments2);
}
}
}
To copy to clipboard, switch view to plain text mode
void MainWindow::readFromStdout2()
{
int j = 4;
bool ok;
out = procc2->readAllStandardOutput();
j = out.toInt(&ok, 16);
printf("j =%d\n",j);
if(j == 1)
printf("device not connected\n");
else{
printf("the device connected\n");
timer2->start(2000);
}
}
void MainWindow::readFromStdout2()
{
int j = 4;
bool ok;
QString out;
out = procc2->readAllStandardOutput();
j = out.toInt(&ok, 16);
printf("j =%d\n",j);
if(j == 1)
printf("device not connected\n");
else{
printf("the device connected\n");
timer2->start(2000);
}
}
To copy to clipboard, switch view to plain text mode
void MainWindow::embed2()
{
container2->embedClient(widedit->text().toInt(&ok, 16));
}
void MainWindow::embed2()
{
container2->embedClient(widedit->text().toInt(&ok, 16));
}
To copy to clipboard, switch view to plain text mode
/*this will be set setFpscanner when a back button in my Qt app is clicked*/
void MainWindow::timeout_bg2()
{
timer_FS->stop();
setFPScanner = 0;
mainstackedWidget->setCurrentIndex(1);
timer_FS->start();
}
void MainWindow::timeout_bg2()
{
timer_FS->stop();
setFPScanner = 0;
mainstackedWidget->setCurrentIndex(1);
timer_FS->start();
}
To copy to clipboard, switch view to plain text mode
this is my whole code in that part i written .... if u find any error please help me ...
Bookmarks