diff options
-rw-r--r-- | doc/src/images/borderlayout-example.png | bin | 6163 -> 9126 bytes | |||
-rw-r--r-- | examples/widgets/doc/src/borderlayout.qdoc | 28 | ||||
-rw-r--r-- | examples/widgets/doc/src/editabletreemodel.qdoc | 30 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 13 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 4 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 1 |
6 files changed, 45 insertions, 31 deletions
diff --git a/doc/src/images/borderlayout-example.png b/doc/src/images/borderlayout-example.png Binary files differindex e856e06572..27b939bc2e 100644 --- a/doc/src/images/borderlayout-example.png +++ b/doc/src/images/borderlayout-example.png diff --git a/examples/widgets/doc/src/borderlayout.qdoc b/examples/widgets/doc/src/borderlayout.qdoc index c8f2ae4196..6572bfe578 100644 --- a/examples/widgets/doc/src/borderlayout.qdoc +++ b/examples/widgets/doc/src/borderlayout.qdoc @@ -36,6 +36,34 @@ \image borderlayout-example.png + The constructor of the Window class creates a QTextBrowser object, + to which a BorderLayout named \c layout is added. The declaration + of the BorderLayout class is quoted at the end of this document. + + \quotefromfile layouts/borderlayout/window.cpp + \skipto Window::Window() + \printuntil BorderLayout + + Several labeled widgets are added to \c layout with the orientation + \c {Center}, \c {North}, \c {West}, \c {East 1}, \c {East 2}, and + \c {South}. + + \skipto layout->addWidget + \printuntil setWindowTitle + + createLabel() in class \c Window sets the text of the labeled widgets + and the style. + + \skipto QLabel *Window::createLabel + \printuntil /^\}/ + + Class BorderLayout contains all the utilitarian functions for formatting + the widgets it contains. + + \quotefromfile layouts/borderlayout/borderlayout.h + \skipto class + \printuntil /^\}/ + For more information, visit the \l{Layout Management} page. \include examples-run.qdocinc diff --git a/examples/widgets/doc/src/editabletreemodel.qdoc b/examples/widgets/doc/src/editabletreemodel.qdoc index 87249a578e..68e10e3e78 100644 --- a/examples/widgets/doc/src/editabletreemodel.qdoc +++ b/examples/widgets/doc/src/editabletreemodel.qdoc @@ -153,7 +153,7 @@ We can retrieve pointers stored in this way by calling the \l{QModelIndex::}{internalPointer()} function on the relevant model index - we create our own \l{TreeModel::getItem}{getItem()} function to - do this work for us, and call it from our \l{TreeModel::data}{data()} + do the work for us, and call it from our \l{TreeModel::data}{data()} and \l{TreeModel::parent}{parent()} implementations. Storing pointers to items is convenient when we control how they are @@ -169,7 +169,7 @@ \row \li \b{Storing information in the underlying data structure} Several pieces of data are stored as QVariant objects in the \c itemData - member of each \c TreeItem instance + member of each \c TreeItem instance. The diagram shows how pieces of information, represented by the labels \b{a}, \b{b} and \b{c} in the @@ -227,8 +227,8 @@ \section1 TreeItem Class Definition The \c TreeItem class provides simple items that contain several - pieces of data, and which can provide information about their parent - and child items: + pieces of data, including information about their parent and + child items: \snippet itemviews/editabletreemodel/treeitem.h 0 @@ -302,7 +302,7 @@ \snippet itemviews/editabletreemodel/treeitem.cpp 11 To make implementation of the model easier, we return true to indicate - whether the data was set successfully, or false if an invalid column + that the data was set successfully. Editable models often need to be resizable, enabling rows and columns to be inserted and removed. The insertion of rows beneath a given model index @@ -356,29 +356,29 @@ We call the internal \l{TreeModel::setupModelData}{setupModelData()} function to convert the textual data supplied to a data structure we can use with the model. Other models may be initialized with a ready-made - data structure, or use an API to a library that maintains its own data. + data structure, or use an API from a library that maintains its own data. - The destructor only has to delete the root item; all child items will - be recursively deleted by the \c TreeItem destructor. + The destructor only has to delete the root item, which will cause all child + items to be recursively deleted. \snippet itemviews/editabletreemodel/treemodel.cpp 1 \target TreeModel::getItem Since the model's interface to the other model/view components is based - on model indexes, and the internal data structure is item-based, many of - the functions implemented by the model need to be able to convert any - given model index to its corresponding item. For convenience and + on model indexes, and since the internal data structure is item-based, + many of the functions implemented by the model need to be able to convert + any given model index to its corresponding item. For convenience and consistency, we have defined a \c getItem() function to perform this repetitive task: \snippet itemviews/editabletreemodel/treemodel.cpp 4 - This function assumes that each model index it is passed corresponds to - a valid item in memory. If the index is invalid, or its internal pointer - does not refer to a valid item, the root item is returned instead. + Each model index passed to this function should correspond to a valid + item in memory. If the index is invalid, or its internal pointer does + not refer to a valid item, the root item is returned instead. The model's \c rowCount() implementation is simple: it first uses the - \c getItem() function to obtain the relevant item, then returns the + \c getItem() function to obtain the relevant item; then it returns the number of children it contains: \snippet itemviews/editabletreemodel/treemodel.cpp 8 diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 6248842d78..9ad32b162d 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -83,19 +83,6 @@ #include <sys/pstat.h> #endif -#if defined(Q_OS_MAC) -# ifdef qDebug -# define old_qDebug qDebug -# undef qDebug -# endif - -# ifdef old_qDebug -# undef qDebug -# define qDebug QT_NO_QDEBUG_MACRO -# undef old_qDebug -# endif -#endif - #if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) #include <sys/prctl.h> #endif diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d0593a473d..17ded6ce59 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1136,8 +1136,6 @@ void QCocoaWindow::handleGeometryChange() void QCocoaWindow::handleExposeEvent(const QRegion ®ion) { - const QRect previouslyExposedRect = m_exposedRect; - // Ideally we'd implement isExposed() in terms of these properties, // plus the occlusionState of the NSWindow, and let the expose event // pull the exposed state out when needed. However, when the window @@ -1331,7 +1329,7 @@ void QCocoaWindow::recreateWindowIfNeeded() void QCocoaWindow::requestUpdate() { qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::requestUpdate" << window(); - [m_view requestUpdate]; + [qnsview_cast(m_view) requestUpdate]; } void QCocoaWindow::requestActivateWindow() diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 1513025f16..0be8d319c2 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -411,6 +411,7 @@ void tst_QLineEdit::cleanup() { delete m_testWidget; m_testWidget = 0; + m_platformInputContext.m_commitString.clear(); } void tst_QLineEdit::experimental() |