Hi,
I tried to launch the application( any application in general with .exe or .out or other executable format) using the QProcess in Qt.
I can simply launch the application there is no probelm in it , but i need to launch it in the main window rather than opening it in the seperate window, i tried google and found out there is -into and winId can be used to redirect the applicaion to specific window.
But i could not get it worked .
Below is the code i am using.
Please some one let me know what am i doing wrong.
main.cpp
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
mainwindow.cpp
#include "mainwindow.h"
#include <QProcess>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QProcess * proc = new QProcess(this);
//proc->start("sol");// -into"+QString((int)this->winId()));
proc->start("sol -into"+QString((int)parent->winId()));
}
MainWindow::~MainWindow()
{
}
mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
};
#endif // MAINWINDOW_H
↧