Hello,
I’m having a problem with a QML program I am making. It’s a full screen program to which I’ve added a minimize button which calls QtQuick2ApplicationViewer.showMinimized() when clicked. This works fine on the development machine (Win7 ×64) but when I deploy it on another computer, it doesn’t minimize properly. What happens is that the program’s screen doesn’t go away but the interface doesn’t respond. When I use alt+Tab none of the other open programs will be visible until I manage to guess how many times I have to hit alt+Tab to get back to the program, at which point it responds again. This leads me to believe that the program does “minimize”, but something goes wrong so the screen doesn’t go away.
I’m posting my main.cpp if that helps:
#include <QApplication>
#include "qtquick2applicationviewer.h"
#include <QDesktopWidget>
#include <QQmlContext>
#include "externalfilestarter.h"
#include <QtOpenGL/QGLFormat>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if(!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0))
{
QMessageBox::critical(0, "Unsupported OpenGL", "This program requires OpenGL v2.0 or higher.\r\nPlease update your graphics card drivers.", QMessageBox::Ok);
return -4;
}
ExternalFileStarter extFile;
QtQuick2ApplicationViewer viewer;
viewer.rootContext()->setContextProperty("QtQuick2ApplicationViewer", &viewer);
viewer.rootContext()->setContextProperty("extFile", &extFile);
viewer.setMainQmlFile(QStringLiteral("qml/Design2014Papers/main.qml"));
viewer.setResizeMode(QtQuick2ApplicationViewer::SizeRootObjectToView);
viewer.setGeometry(app.desktop()->screenGeometry());
viewer.showFullScreen();
return app.exec();
}
I’ll repeat that this problem only appears when I deploy it to other Win7 computers so it sounds like a deployment problem but I’m not sure how to pinpoint the problem. I’m using Qt 5.1 with MinGW.
Cheers,
Lucijan
↧