From f9a3f15376d0c0cddc4ab023d2421859847df56b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 15 Sep 2010 10:30:55 +0300 Subject: Do not wait for QThread exit when destroying global statics in Symbian Symbian kernel will kill all threads except the main one before running destructors on global static objects. Qt gets no notification of these thread terminations, so it'll still think those threads are running and will wait indefinitely for their exit. QThread::wait() now checks if the thread is actually still alive before starting to wait on thread_done wait condition. Task-number: QTBUG-13612 Reviewed-by: Janne Koskinen --- src/corelib/thread/qthread_unix.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index d193b2e..2824e15 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -142,6 +142,20 @@ static void destroy_current_thread_data_key() } Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key) +#ifdef Q_OS_SYMBIAN +static void init_symbian_thread_handle(RThread &thread) +{ + thread = RThread(); + TThreadId threadId = thread.Id(); + thread.Open(threadId); + + // Make thread handle accessible process wide + RThread originalCloser = thread; + thread.Duplicate(thread, EOwnerProcess); + originalCloser.Close(); +} +#endif + QThreadData *QThreadData::current() { pthread_once(¤t_thread_data_once, create_current_thread_data_key); @@ -182,9 +196,7 @@ void QAdoptedThread::init() Q_D(QThread); d->thread_id = pthread_self(); #ifdef Q_OS_SYMBIAN - d->data->symbian_thread_handle = RThread(); - TThreadId threadId = d->data->symbian_thread_handle.Id(); - d->data->symbian_thread_handle.Open(threadId); + init_symbian_thread_handle(d->data->symbian_thread_handle); #endif } @@ -244,9 +256,8 @@ void *QThreadPrivate::start(void *arg) // RThread and pthread_t, we must delay initialization of the RThread // handle when creating a thread, until we are running in the new thread. // Here, we pick up the current thread and assign that to the handle. - data->symbian_thread_handle = RThread(); - TThreadId threadId = data->symbian_thread_handle.Id(); - data->symbian_thread_handle.Open(threadId); + init_symbian_thread_handle(data->symbian_thread_handle); + // On symbian, threads other than the main thread are non critical by default // This means a worker thread can crash without crashing the application - to // use this feature, we would need to use RThread::Logon in the main thread @@ -657,6 +668,18 @@ bool QThread::wait(unsigned long time) return true; while (d->running) { +#ifdef Q_OS_SYMBIAN + // Check if thread still exists. Needed because kernel will kill it without notification + // before global statics are deleted at application exit. + if (d->data->symbian_thread_handle.Handle() + && d->data->symbian_thread_handle.ExitType() != EExitPending) { + // Cannot call finish here as wait is typically called from another thread. + // It won't be necessary anyway, as we should never get here under normal operations; + // all QThreads are EProcessCritical and therefore cannot normally exit + // undetected (i.e. panic) as long as all thread control is via QThread. + return true; + } +#endif if (!d->thread_done.wait(locker.mutex(), time)) return false; } -- cgit v0.12 From 1ca554e1744a8e430483a5df3aa9716c266d0c2c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 15 Sep 2010 11:08:29 +0200 Subject: fix error messages when configuring Qt Commit 019032c93b7397c7239ec99ec44b4923df31533b introduced a lot of annoying error messages when configuring Qt. It makes qmake complain that it cannot find rcc and uic, which aren't yet built at this point. We're now checking for the existence of the depend_command if it is given as absolute path. This is the case for uic and rcc. Yeah this is a weak solution for sick code. Task-number: QTBUG-13366 Reviewed-by: ossi --- qmake/generators/makefile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index cd034b8..3cb1942 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1797,7 +1797,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } else { cmdline[argv0] = escapeFilePath(cmdline.at(argv0)); } - tmp_dep_cmd = cmdline.join(" "); + QFileInfo cmdFileInfo(cmdline[argv0]); + if (!cmdFileInfo.isAbsolute() || cmdFileInfo.exists()) + tmp_dep_cmd = cmdline.join(" "); } dep_cd_cmd = QLatin1String("cd ") + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) -- cgit v0.12 From 15ba1ff23c140849d3cac32a5005c352cd5a699f Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 15 Sep 2010 13:30:55 +0200 Subject: Doc: Note on updating proxy models with dynamic sort filters Task-number: QT-689 Reviewed-by: David Boddie --- src/gui/itemviews/qsortfilterproxymodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 953a7f1..dc8d938 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -2230,6 +2230,14 @@ void QSortFilterProxyModel::setFilterFixedString(const QString &pattern) \brief whether the proxy model is dynamically sorted and filtered whenever the contents of the source model change + Note that you should not update the source model through the proxy + model when dynamicSortFilter is true. For instance, if you set the + proxy model on a QComboBox, then using functions that update the + model, e.g., \l{QComboBox::}{addItem()}, will not work as + expected. An alternative is to set dynamicSortFilter to false and + call \l{QSortFilterProxyModel::}{sort()} after adding items to the + QComboBox. + The default value is false. */ bool QSortFilterProxyModel::dynamicSortFilter() const -- cgit v0.12 From 4c489c2ecfbcc6d0f8f7ec52b5e4d81e15ce4818 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 15 Sep 2010 15:35:54 +0200 Subject: Doc: Listed undoable operations in QTextDocument Task-number: QT-1212 Reviewed-by: David Boddie --- src/gui/text/qtextdocument.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 195dc28..c35069f 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -291,7 +291,18 @@ QTextCodec *Qt::codecForHtml(const QByteArray &ba) by an editor widget through the undo() and redo() slots; the document also provides contentsChanged(), undoAvailable(), and redoAvailable() signals that inform connected editor widgets about the state of the undo/redo - system. + system. The following are the undo/redo operations of a QTextDocument: + + \list + \o Insertion or removal of characters. A sequence of insertions or removals + within the same text block are regarded as a single undo/redo operation. + \o Insertion or removal of text blocks. Sequences of insertion or removals + in a single operation (e.g., by selecting and then deleting text) are + regarded as a single undo/redo operation. + \o Text character format changes. + \o Text block format changes. + \o Text block group format changes. + \endlist \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example} */ -- cgit v0.12 From f9a6a8bc03cefe8ea90f695efd9d1e7c8d96321a Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 16 Sep 2010 10:29:11 +0200 Subject: Doc: Removing section about Multimedia - playback and declarative elements. This was descoped from Qt 4.7. --- doc/src/qt4-intro.qdoc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 8684ad2..efbfc0c 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -489,15 +489,6 @@ QNetworkAccessManager uses this API for HTTP level roaming. - \section1 Multimedia - playback and declarative elements - - The Multimedia API provides media playback and playlist support - for Qt Applications. Play music and movies through a single interface - with selectable output for movies to widgets or graphics view. - - Multimedia support for Quick is also available with the new multimedia - declarative elements. - \section1 New Classes, Functions, Macros, etc. Links to new classes, elements, functions, macros, and other items -- cgit v0.12 From f0868f7fc3dacfa6b5b4bcee90b9b0a79d2ccd2a Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 13 Sep 2010 15:08:00 +0200 Subject: Added a QFormLayout snippet to the layout.qdoc and layouts.cpp Reviewed-by: David Boddie Tasks: QTBUG-10077 --- doc/src/snippets/layouts/layouts.cpp | 42 ++++++++++++++++++++++++++++++--- doc/src/widgets-and-layouts/layout.qdoc | 16 +++++++++++-- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/doc/src/snippets/layouts/layouts.cpp b/doc/src/snippets/layouts/layouts.cpp index 66c9b9d..58440f5 100644 --- a/doc/src/snippets/layouts/layouts.cpp +++ b/doc/src/snippets/layouts/layouts.cpp @@ -66,7 +66,9 @@ int main(int argc, char *argv[]) layout->addWidget(button5); window->setLayout(layout); -//! [4] //! [5] +//! [4] + window->setWindowTitle("QHBoxLayout"); +//! [5] window->show(); //! [5] } @@ -93,7 +95,9 @@ int main(int argc, char *argv[]) layout->addWidget(button5); window->setLayout(layout); -//! [10] //! [11] +//! [10] + window->setWindowTitle("QVBoxLayout"); +//! [11] window->show(); //! [11] } @@ -120,10 +124,42 @@ int main(int argc, char *argv[]) layout->addWidget(button5, 2, 1); window->setLayout(layout); -//! [16] //! [17] +//! [16] + window->setWindowTitle("QGridLayout"); +//! [17] window->show(); //! [17] } + { +//! [18] + QWidget *window = new QWidget; +//! [18] +//! [19] + QPushButton *button1 = new QPushButton("One"); + QLineEdit *lineEdit1 = new QLineEdit(); +//! [19] +//! [20] + QPushButton *button2 = new QPushButton("Two"); + QLineEdit *lineEdit2 = new QLineEdit(); + QPushButton *button3 = new QPushButton("Three"); + QLineEdit *lineEdit3 = new QLineEdit(); +//! [20] +//! [21] + QFormLayout *layout = new QFormLayout; +//! [21] +//! [22] + layout->addRow(button1, lineEdit1); + layout->addRow(button2, lineEdit2); + layout->addRow(button3, lineEdit3); + + window->setLayout(layout); +//! [22] + window->setWindowTitle("QFormLayout"); +//! [23] + window->show(); +//! [23] + } + return app.exec(); } diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc index 32dddd7..4db991a 100644 --- a/doc/src/widgets-and-layouts/layout.qdoc +++ b/doc/src/widgets-and-layouts/layout.qdoc @@ -116,7 +116,7 @@ \section2 Laying Out Widgets in Code The following code creates a QHBoxLayout that manages the geometry of five - \l{QPushButton}s, as shown on the first screenshot above: + \l{QPushButton}{QPushButtons}, as shown on the first screenshot above: \snippet doc/src/snippets/layouts/layouts.cpp 0 \snippet doc/src/snippets/layouts/layouts.cpp 1 @@ -141,7 +141,19 @@ The third QPushButton spans 2 columns. This is possible by specifying 2 as the fifth argument to QGridLayout::addWidget(). - Finally, the code for QFormLayout is .. + QFormLayout will add two widgets on a row, commonly a QLabel and a QLineEdit + to create forms. Adding a QLabel and a QLineEdit on the same row will set + the QLineEdit as the QLabel's buddy. The following code will use the + QFormLayout to place three \l{QPushButton}{QPushButtons} and a corresponding + QLineEdit on a row. + + \snippet doc/src/snippets/layouts/layouts.cpp 18 + \snippet doc/src/snippets/layouts/layouts.cpp 19 + \snippet doc/src/snippets/layouts/layouts.cpp 20 + \codeline + \snippet doc/src/snippets/layouts/layouts.cpp 21 + \snippet doc/src/snippets/layouts/layouts.cpp 22 + \snippet doc/src/snippets/layouts/layouts.cpp 23 \section2 Tips for Using Layouts -- cgit v0.12 From 67aa771cc04044a96b4653adb86692a7bcac1b87 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 16 Sep 2010 11:03:06 +0200 Subject: Doc: Cleaning up the known issues page. Pointing people to check the online resources. --- doc/src/getting-started/known-issues.qdoc | 125 ++---------------------------- 1 file changed, 5 insertions(+), 120 deletions(-) diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc index 0c2d8d8..942c41d 100644 --- a/doc/src/getting-started/known-issues.qdoc +++ b/doc/src/getting-started/known-issues.qdoc @@ -29,127 +29,12 @@ \page known-issues.html \title Known Issues \ingroup platform-specific - \brief A summary of known issues in this Qt version at the time of release. + \brief Links to online resources stating known issues in this Qt version at the time of release. - An up-to-date list of known issues can be found at - \l{http://bugreports.qt.nokia.com/}{Qt Bug Tracker}. - - For a list list of known bugs, see the \l{Task Tracker} at the Qt - website. - - An overview of known issues may also be found at: - \l{http://qt.gitorious.org/qt/pages/QtKnownIssues} + \list + \o An up-to-date list of known issues can be found at \l{http://bugreports.qt.nokia.com/}{Qt Bug Tracker}. + \o For a list list of known bugs, see the \l{Task Tracker} at the Qt website. + \o An overview of known issues may also be found at: \l{http://qt.gitorious.org/qt/pages/QtKnownIssues} {Known Issues Wiki}. - - \section1 Installation Issues - - \section2 Installing the Source Package on Unix systems - - \list - - \o If you download a Zip source package, you will need to convert - Windows-style line endings (CR/LF) to Unix-style line-endings (LF) when - you uncompress the package. To do this, give the "-a" option when you - run the "unzip' command. - - \o If you fail to supply the "-a" option when unzipping the package, you - will see the following error message when you attempt to execute the - configure command: - "bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory" - - \endlist - - \section2 Installing on Mac OS X 10.6 "Snow Leopard" - - \list - - \o There are two workarounds, either disable spotlight for the target - drive during the install, or do a custom install where you deselect - documentation and examples. Run the installer again as a full - install to get the documentation and examples installed. - - \endlist - - \section1 Issues with Third Party Software - - \section2 X11 - - \list - \o There is a bug in the 169.xx NVIDIA drivers on certain GeForce 8 series - cards that is triggered by the OpenGL paint engine when using QPainter - on a QGLWidget to draw paths and polygons. Some other painting - operations that end up in the path fallback are affected as well. The - bug causes the whole X server to repeatedly hang for several seconds at - a time. - \o There is an issue with NVIDIA's 9xxx driver series on X11 that causes a - crash in cases where there are several \l{QGLContext}s and the extended - composition modes are used (the composition modes between and including - QPainter::CompositionMode_Multiply and - QPainter::CompositionMode_Exclusion). This affects the composition mode - demo in Qt 4.5, for example. The crash does not occur in newer versions - of the drivers. - \endlist - - \section2 Windows - - \list - - \o When using version 6.14.11.6921 of the NVIDIA drivers for the GeForce - 6600 GT under Windows XP, Qt applications which use drag and drop will - display reduced size drag and drop icons when run alongside - applications that use OpenGL. This problem can be worked around by - reducing the level of graphics acceleration provided by the driver, or - by disabling hardware acceleration completely. - - \o With NVIDIA GeForce 7950 GT (driver version 6.14.11.7824), a fullscreen - QGLWidget flickers when child widgets are shown/hidden. The workaround - for this is to use \l{QWidget::}{setGeometry()} with a width/height 1 - pixel bigger than your geometry and call \l{QWidget::}{show()}. - - \o A bug in the Firebird database can cause an application to crash when - \c{fbembed.dll} is unloaded. The bug is fixed in version 2.5. - - \o On Windows 7, resizing windows is slower than on Vista/Xp. This is because - the gesture initialization process (required for native gesture support) - currently calls winId() on widgets, which causes whole widget hierarchies - to use native window handles. This slows down resizing. - - \o Compile errors with Intel C++ Compiler.\br - There seems to be a bug in the Intel compiler with respect to - over-agressive inlining of code. - The problem will manifest itself during the link phase of QtGui where - it fails with the error that it cannot find QObjectData::~QObjectData(). - See \l{http://bugreports.qt.nokia.com/browse/QTBUG-5145} for updates on this - bug. - Also, due to some bugs in WebKit, the QtScript and QtWebKit modules - will not compile. - See \l{http://bugreports.qt.nokia.com/browse/QTBUG-6297} for a - workaround for QtScript. - - \o Compile errors with Microsoft Visual C++ compiler. \br - There seems to be a bug in the Microsoft compiler when compiling with O2 - optimization level in 64 bit. - This problem will result in crashes in QAbstractItemView::viewOptions(). - See \l{http://bugreports.qt.nokia.com/browse/QTBUG-11445} for updates on this - bug. - - - \endlist - - \section2 Mac OS X - - \list - - \o If a sheet is opened for a given window, clicking the title bar of that - window will cause it to flash. This behavior has been reported to Apple - (bug number 5827676). - - \endlist - - \section2 Symbian - - \list - \o Check known issues for Symbian at - \l{http://qt.gitorious.org/qt/pages/QtKnownIssues} {Known Issues Wiki}. \endlist */ -- cgit v0.12 From 73a0b6d754f075ece6505809847d54698b605d96 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 16 Sep 2010 11:12:47 +0200 Subject: Doc: Updated the Mac requirements page. Reviewed-by: Morten Engvoldsen --- doc/src/getting-started/installation.qdoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 1384d48..bc0128c 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -951,6 +951,9 @@ applications using Qt for Symbian can start right away. \brief Setting up the Mac OS X environment for Qt. \previouspage General Qt Requirements + Qt requires Xcode to be installed on the system. Xcode should be + available on the Mac installation CD. + \sa {Known Issues} */ -- cgit v0.12