Results 1 to 4 of 4

Thread: How to run an .exe of a Qt application in tabwidget

  1. #1
    Join Date
    Dec 2012
    Posts
    45
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default How to run an .exe of a Qt application in tabwidget

    Hello
    I want to launch a qt application inside my table widget.
    I tried the following code:

    QX11EmbedContainer * container = new QX11EmbedContainer(ui->tabWidget->currentWidget());

    container->show();

    QString executable("/home/wbtdev/Desktop/SP4_Release/ActionSequencer");
    QProcess * process = new QProcess(container);

    process->start(executable);
    But the problem that I am facing is that the application launches the exe. as separate application. I want that the application should be launched inside the tab widget.
    Any help ?
    Last edited by shivendra46d; 11th February 2015 at 05:20.

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: How to run an .exe of a Qt application in tabwidget

    Quote Originally Posted by shivendra46d View Post
    I want that the application should be launched inside the tab widget.
    You have a misunderstanding of QProcess. It creates a separate process for the program you run, so by definition it creates a separate process.

    What I suspect you mean is that you want the output of that process to be shown inside your application.

    To do that is easy, just connect the QProcess signals to slots in your program so that you can be notified when the process starts, stops, changes state, has output ready to read, etc.

    You can then write status messages to your window and if you want to display the actual stdout or stderr messages the process outputs, then you will use QProcess::readyReadStandardOutput() and QProcess::readyReadStandardError(), etc.

    Hope that helps.

  3. #3
    Join Date
    Dec 2012
    Posts
    45
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: How to run an .exe of a Qt application in tabwidget

    Quote Originally Posted by jthomps View Post
    You have a misunderstanding of QProcess. It creates a separate process for the program you run, so by definition it creates a separate process.

    What I suspect you mean is that you want the output of that process to be shown inside your application.

    To do that is easy, just connect the QProcess signals to slots in your program so that you can be notified when the process starts, stops, changes state, has output ready to read, etc.

    You can then write status messages to your window and if you want to display the actual stdout or stderr messages the process outputs, then you will use QProcess::readyReadStandardOutput() and QProcess::readyReadStandardError(), etc.

    Hope that helps.
    I am sorry sir but still i can not get the desired results

  4. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: How to run an .exe of a Qt application in tabwidget

    Quote Originally Posted by shivendra46d View Post
    I am sorry sir but still i can not get the desired results
    What did you try and what was the result? Post a minimal example using the [code][/code] tags that demonstrates what you tried, etc.
    Last edited by jefftee; 12th February 2015 at 05:48.

Similar Threads

  1. ScrollArea in a tabWidget
    By Yaoming in forum Newbie
    Replies: 16
    Last Post: 20th January 2014, 19:51
  2. TabWidget index
    By beppuz in forum Qt Programming
    Replies: 7
    Last Post: 10th September 2011, 11:51
  3. Add tab to tabwidget thru Designer.
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2010, 11:00
  4. TabWidget's Tab's parent
    By alisami in forum Qt Programming
    Replies: 12
    Last Post: 31st March 2009, 13:30
  5. TabWidget
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 17th May 2007, 21:07

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.