[Interest] Qt5 qml only and qfiledialog, qfontdialog, ... crash

Alex Malyushytskyy alexmalvtk at gmail.com
Tue May 8 23:45:31 CEST 2012


setQuitOnLastWindowClosed(true)
only sets flag which is checked when any QWidget closed
and closes application when you need the last one.

So, since I assume you do not have QWIdget instances anymore,
you need manually call exit when you need to exit:.

void	QCoreApplicationexit ( int returnCode = 0 )


Alex

On Tue, May 8, 2012 at 5:20 AM, qtnext <qtnext at gmail.com> wrote:
> it works but ...  if i do that, when I close the qml view it no more quit
> the application and stay as zombie ...
> I have tryed various hack like :
> QGuiApplication::setQuitOnLastWindowClosed(true);  at start
>
> just before opening QfileDialog I set
> QGuiApplication::setQuitOnLastWindowClosed(false)
> then set to QGuiApplication::setQuitOnLastWindowClosed(true);
>
> if I do that, the qfiledialog do no more close the apps, but after If it try
> to close the apps, it don't close the apps even if before I call
> setQuitOnLastWindowClosed(true) !
>
>
> Le 08/05/2012 10:48, Bo Thorsen a écrit :
>
> Den 07-05-2012 15:09, qtnext skrev:
>
> Hi,
>
> I have started  a new desktop application  trying to use only qml with
> Qt5 : I need to choose file. There is now no ready to use components to
> open, choose a file, so I have tryed to add widgets module in the pro
> file, and use Qfiledialog ... I can open QFileDialog, but when I close
> the dialog box, the function in my apps corresponding to the after is
> executed just after, but it close the apps just after ...  my
> application is derived from qapplication ... Is it forbidden to mix a
> qquickview and real qwidget dialog box  or is it a bug ?
>
> Try this in your main():
>
> QApplication app; // Your derived class here, of course
> app.setQuitOnLastWindowClosed(false);
>
> Bo Thorsen,
> Fionia Software.
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list