Hello Trenton & co.,
We have various modal dialogs that show the progress of slow operations
(via QProgressBar or other means) and call QApplication::processEvents()
periodically (as recommended in the Qt docs), which all work fine on Qt
4.4 and on Carbon.
However on Qt 4.5/Cocoa (all builds and snapshots so far, including
qt-all-commercial-src-4.5.0-snapshot-20090113) calling
QApplication::processEvents() causes an indefinite freeze if a dialog is
open (e.g. a QProgressDialog) if the dialog was opened and made modal
using QDialog::setModal(true). (Instead using
QDialog::setWindowModality(Qt::ApplicationModal) doesn't suffer from the
problem but then the user can get around the modality because the main
application menu bar items are still accessible - is that also a bug?)
To reproduce the issue, edit
$QTDIR/examples/dialogs/findfiles/window.cpp, find the function
Window::findFiles() and add the following line:
QStringList Window::findFiles(const QDir &directory, const QStringList
&files,
const QString &text)
{
QProgressDialog progressDialog(this);
progressDialog.setCancelButtonText(tr("&Cancel"));
progressDialog.setRange(0, files.size());
progressDialog.setWindowTitle(tr("Find Files"));
progressDialog.setModal(true); // ADD THIS LINE
...
Compile and use the example app to search a directory containing large
binaries for an arbitrary substring (or any other operation that takes
more than 4 seconds and would thus cause the QProgressDialog to appear)
and the app should freeze indefinitely.
The same problem occurs if the window is instead made modal by
setAttribute(Qt::WA_ShowModal, true)
I built Qt using:
./configure -prefix $PWD -platform macx-g++ -arch x86_64
... but I don't think that's relevant since it seems always to happen on
Qt 4.5/Cocoa, regardless of the way it was built.
Hence I think there are perhaps two bugs:
1. QApplication::processEvents() causes freeze with modal windows
(either setModal(true) or setAttribute(Qt::WA_ShowModal, true) ).
2. QDialog::setWindowModality(Qt::ApplicationModal) is leaving the app
menu items accessible, i.e. isn't isn't making the dialog fully modal
(but it does give full modality on Windows platforms - haven't checked
that one on Qt 4.5/Carbon yet).
Many thanks and best regards,
Martin Dyde,
Milan Digital Audio LLC.
http://www.crumhorn-labs.com/
http://www.milandigitalaudio.com/
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback