Results 1 to 2 of 2

Thread: launching application in customized widget

  1. #1
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default launching application in customized widget

    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.

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. MainWindow w;
    8.  
    9. w.show();
    10.  
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. #include "mainwindow.h"
    2. #include <QProcess>
    3.  
    4. MainWindow::MainWindow(QWidget *parent)
    5. : QMainWindow(parent)
    6. {
    7. QProcess * proc = new QProcess(this);
    8. //proc->start("Artha");// -into"+QString((int)this->winId()));
    9. proc->start("Artha -into"+QString((int)parent->winId()));
    10.  
    11. }
    12.  
    13.  
    14. MainWindow::~MainWindow()
    15. {
    16.  
    17. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QtGui/QMainWindow>
    5.  
    6. class MainWindow : public QMainWindow
    7. {
    8. Q_OBJECT
    9.  
    10. public:
    11. MainWindow(QWidget *parent = 0);
    12. ~MainWindow();
    13. };
    14.  
    15. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: launching application in customized widget

    That can be done but not in a cross-platform way. I.e. this involves native API.

    Cheers,
    _

Similar Threads

  1. Setting Wallpaper image before launching application
    By mania in forum Qt Programming
    Replies: 1
    Last Post: 10th November 2012, 10:55
  2. Launching an application without display
    By tarod in forum Qt Programming
    Replies: 6
    Last Post: 3rd July 2012, 11:14
  3. Replies: 3
    Last Post: 23rd February 2011, 12:03
  4. Launching GUI application on different X11 display
    By basy in forum Installation and Deployment
    Replies: 3
    Last Post: 3rd December 2010, 20:21
  5. Replies: 5
    Last Post: 15th June 2007, 22:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.