Results 1 to 4 of 4

Thread: Why does console show up =.=

  1. #1
    Join Date
    Feb 2012
    Posts
    13
    Qt products
    Qt4

    Default Why does console show up =.=

    Just made a project, set to be console, and I added QWidget code, and removed all console code. Yet, why does console window show up? How annoying!!=.=

    Qt Code:
    1. #include <QtGui>
    2. #include <QWidget>
    3.  
    4. int main(int argv, char **args)
    5. {
    6. QApplication app(argv, args);
    7. QWidget* Window;
    8. QGridLayout *gridLayout = new QGridLayout();
    9. Window->setLayout(gridLayout);
    10. Window->setFixedSize(500, 500);
    11. Window->show();
    12. return app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    and
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2012-06-07T12:02:13
    4. #
    5. #-------------------------------------------------
    6. QT += core gui
    7. TARGET = untitled1
    8.  
    9. TEMPLATE = app
    10.  
    11.  
    12. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    To be clear: I need a graphical window QT code that works with this (in one file)..

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Why does console show up =.=

    Add
    Qt Code:
    1. QWidget* Window=new QWidget;
    To copy to clipboard, switch view to plain text mode 
    in your cpp file.
    Now close your project.
    Then after that go to the project folder from windows explorer.
    Delete all Makefile, debug folder,release folder.
    Now go to Qt Creator and open the project file.
    Now run it, you will not get the console.

  3. #3
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why does console show up =.=

    Also if you are using Qt Creator check the Projects --> Run Settings Tab, if the "Run in Terminal" option is unchecked

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why does console show up =.=

    ... and you can start by showing your real code instead of this fake code that won't even run.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 12th July 2010, 13:12
  2. QT Console app
    By yorkshireflatcap in forum Newbie
    Replies: 14
    Last Post: 22nd June 2010, 20:57
  3. Replies: 3
    Last Post: 26th March 2010, 21:25
  4. Console replacement
    By aegis in forum Qt Programming
    Replies: 14
    Last Post: 3rd April 2007, 00:38
  5. QT4 console apps
    By ucntcme in forum Newbie
    Replies: 5
    Last Post: 24th January 2006, 10:18

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.