Search code examples
c++qtqt4qt-creatorqmake

How to change console mode to gui mode in QtCreator?


I am trying to convert an application console mode to gui mode but the problem is the console window still appearing with main window.What i want is to hide console window as it dose in gui mode.

.pro

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = cmd
TEMPLATE = app

CONFIG -= console
SOURCES += main.cpp\
    mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

mainfile

  #include "mainwindow.h"
  #include <QApplication>

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  MainWindow w;
  w.show();

   return a.exec();
}

Solution

  • In creator go in project under tab Run Settings uncheck Run in terminal. cmd window will not appear.