Results 1 to 5 of 5

Thread: GUI procedure which does not freeze command line. Is this possible?

  1. #1
    Join Date
    Nov 2006
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default GUI procedure which does not freeze command line. Is this possible?

    Hello

    How go I create a qt gui for windows which does not freeze up the command promt.

    i.e.
    from command shell I type c:\MyQTApp.exe

    this launches my gui but my command line window is frozen until i close
    MyQTApp.exe.

    I've tried tweaking prog file with CONFIG =+ console
    looked at QProcess but thats refering to how other apps are spawned from within MyQTApp.exe

    looked at cmd /c c:\MyQTApp.exe but no luck yet.

    Any ideas?

    Harvey West | Technical support - BSkyB Creative Services http://www.sky.com

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GUI procedure which does not freeze command line. Is this possible?

    I have a Qt based GUI application. When I launch it from the command prompt, it does not freeze the command prompt

    This is what I got

    E:\MyApplication>myapp (press enter)

    myapp launches

    Command Prompt shows

    E:\MyApplication>

    Probably, I did not understand what you meant

  3. #3
    Join Date
    Nov 2006
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GUI procedure which does not freeze command line. Is this possible?

    Yep thats what I ment humm...

    Are you using qmake to setup the .vcproj file

    Here my .prog and main loop does that look similar to your setup?

    ################################################## ####################
    # Automatically generated by qmake (2.00a) Tue 7. Nov 18:06:28 2006
    ################################################## ####################
    TEMPLATE = vcapp
    TARGET +=
    DEPENDPATH += .
    INCLUDEPATH += .
    QT += xml
    # Input
    HEADERS += toolbar.h
    SOURCES += main.cpp toolbar.cpp

    #include <QApplication>
    #include "toolbar.h"
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    Toolbar *toolbar = new Toolbar;
    toolbar->show();
    return app.exec();
    }

  4. #4
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GUI procedure which does not freeze command line. Is this possible?

    Are you using qmake to setup the .vcproj file
    Yes.

    Try this

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

    Another difference that I noticed was

    Qt Code:
    1. TEMPLATE = app
    To copy to clipboard, switch view to plain text mode 

    But I don't think that should be the problem.

  5. #5
    Join Date
    Nov 2006
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GUI procedure which does not freeze command line. Is this possible?

    Edited the QTCode, that seems to do the trick. Cheers.

    Any ideas why?

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.