Minimizing QT Application [Solved]
-
Hi,
I have got a problem. I want my application to minimize or run that process in background (Actually, this process only responds to touch). I have used QmlApplicationViewer for view purpose.
I am sending a message Using IPC mechenism to move process in background. On getting Message, i am calling showMinimized() and showMaximized() functions.
I have also installed event handler and in event handler, when i get the qevent ApplicationDeactivated, i am calling hide method for view.
I am testing this code on ARM Board. The Problem is, on calling showMinimized(), process get minimize but and ApplicationDeactivated event is listen by the application and after few millisecond, it listen ApplicationActivate but QML Page are hidden. On touch, this process responds.
event listening:
if(event->type()==QEvent::ApplicationActivated)
{
event->ignore();
qDebug(“Application Activated”);
}
if(event->type()==QEvent::ApplicationDeactivated)
{
event->ignore();
qDebug(“Application Deactivated”);
if (view->isMinimized())
{
view->hide();
event->ignore();
}
}Minimizing and Maximizing:
if(iCmd DIPO_MINIMIZE)
{
view->showMinimized();
}
else if(iCmd DIPO_MAXIMIZE)
{
view->showNormal();
}Thanks for any kind of help..
-
Hi and welcome to devnet,
Please enclose your code in coding tags (one @ at the beginning and one at the end) that will make it readable.
Also which OS/Qt combination are you using ?
-
@
event listening:
if(event->type()==QEvent::ApplicationActivated)
{
event->ignore();
qDebug(“Application Activated”);
}
if(event->type()==QEvent::ApplicationDeactivated)
{
event->ignore();
qDebug(“Application Deactivated”);
if (view->isMinimized())
{
view->hide();
event->ignore();
}
}Minimizing and Maximizing:
if(iCmd DIPO_MINIMIZE)
{
view->showMinimized();
}
else if(iCmd DIPO_MAXIMIZE)
{
view->showNormal();
}
@I have tested this code on Desktop and Also on ARM board both with Ubuntu OS. Same situation occurs on both.
-
It works fine on Desktop. But on ARM Board Problem is as it is.
-
I am using QT 4.8.2 version.
-
What distribution / Window Manager do you use on your board ?
-
I am using ubuntu with kernel 3.0.35
-
But what is the window manager you are using ?
-
Now, its solved. Actually in main funtion i have written view.fullscreen along with view.expended.
After removing view.expended:
with view.fullscreen, i am able t fullscreen the app and with view.hide, i am able to background the app.Thanks for all reply.
-
Great !
Thanks for sharing your solution
Please, also update the thread title prepending [solved] so other forum users may know a solution has been found :)