PDA

View Full Version : Why does console show up =.=



xleniz
7th June 2012, 11:23
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!!=.=



#include <QtGui>
#include <QWidget>

int main(int argv, char **args)
{
QApplication app(argv, args);
QWidget* Window;
QGridLayout *gridLayout = new QGridLayout();
Window->setLayout(gridLayout);
Window->setFixedSize(500, 500);
Window->show();
return app.exec();
}


and


#-------------------------------------------------
#
# Project created by QtCreator 2012-06-07T12:02:13
#
#-------------------------------------------------
QT += core gui
TARGET = untitled1

TEMPLATE = app


SOURCES += main.cpp


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

sonulohani
7th June 2012, 12:18
Add


QWidget* Window=new QWidget;

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.

Rhayader
7th June 2012, 13:05
Also if you are using Qt Creator check the Projects --> Run Settings Tab, if the "Run in Terminal" option is unchecked

wysota
7th June 2012, 14:39
... and you can start by showing your real code instead of this fake code that won't even run.