PstdEr
20th March 2013, 02:29
Hi,
I would like to know is there any way to launch the application in the main window it self, instead of opening a new window.
what are the challenges in doing so, i googled and found out some sample , but its not working.
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include <QProcess>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QProcess * proc = new QProcess(this);
//proc->start("Artha");// -into"+QString((int)this->winId()));
proc->start("Artha -into"+QString((int)parent->winId()));
}
MainWindow::~MainWindow()
{
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
};
#endif // MAINWINDOW_H
I would like to know is there any way to launch the application in the main window it self, instead of opening a new window.
what are the challenges in doing so, i googled and found out some sample , but its not working.
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include <QProcess>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QProcess * proc = new QProcess(this);
//proc->start("Artha");// -into"+QString((int)this->winId()));
proc->start("Artha -into"+QString((int)parent->winId()));
}
MainWindow::~MainWindow()
{
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
};
#endif // MAINWINDOW_H