在应用程序启动时我有一个控制台窗口,那么如何不显示它? (不使用WinMain!因为它的参数与QApp不匹配)
我的main.cpp代码是:
int main(int _nArgCount, char * _pArgValues[]) {
QApplication app(_nArgCount, _pArgValues);
//QMLblock
QString strQmlPath = "qrc:qml/main.qml";
QQmlApplicationEngine engine;
QQmlComponent component(&engine, QUrl(strQmlPath));
if (component.status() == QQmlComponent::Error) {
qDebug()<<"Error:"<<component.errorString();
return app.exec();
}
Gui gui(component);
gui.recreateGui();
//state machine block
QStateMachine machine;
.... .... ....
return app.exec();
}