HI all,
I had an application which can be launch in GUI mode and in Console Mode :
#include <QtGui/QApplication>
#include "flashloader.h"
#include "QMap"
#include <iostream>
#include "QMessageBox"
int main(int argc, char *argv[])
{
msgBox.
setText("number of argument : " + QString::number(argc
));
msgBox.exec();
int iCount;
iCount = argc;
QMap<QString, QString> map_args;
FlashLoader w;
if (argc == 1)
{
w.show();
return a.exec();
}
else
{
int i;
for (i=1; i < argc ; i++)
{
std::cout << "MainAppCore argv[" << i << "] : " << List_args.at(i).toStdString() << "\n";
}
return 0;
}
}
#include <QtGui/QApplication>
#include "flashloader.h"
#include "QMap"
#include <iostream>
#include "QMessageBox"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMessageBox msgBox;
msgBox.setText("number of argument : " + QString::number(argc));
msgBox.exec();
QStringList List_args = QApplication::arguments();
int iCount;
iCount = argc;
QMap<QString, QString> map_args;
FlashLoader w;
if (argc == 1)
{
w.show();
return a.exec();
}
else
{
int i;
for (i=1; i < argc ; i++)
{
std::cout << "MainAppCore argv[" << i << "] : " << List_args.at(i).toStdString() << "\n";
}
return 0;
}
}
To copy to clipboard, switch view to plain text mode
In my pro files, I have
CONFIG += console
CONFIG += console
To copy to clipboard, switch view to plain text mode
(necessary to have console working)
In debug mode all is working well. If I launch the application with no argument I have only the GUI present. If I launch the application with argument I have only the console present. The problem is when I launch the application in release mode ,the console always appears. How can I fix that?
Thanks
Bookmarks