diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-24 02:23:39 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-24 02:23:39 (GMT) |
commit | 4870f1d4afb41041aa097ad24dd7f147199f4066 (patch) | |
tree | 5061262612d0d13982f9178e7a8de7477488b834 | |
parent | a3a55ff296a15ec0c69990f3526eaa652a216d2f (diff) | |
parent | f59947c44be1601a0d2a451c18693802533075d7 (diff) | |
download | Qt-4870f1d4afb41041aa097ad24dd7f147199f4066.zip Qt-4870f1d4afb41041aa097ad24dd7f147199f4066.tar.gz Qt-4870f1d4afb41041aa097ad24dd7f147199f4066.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
QLineEdit shows leftovers of edit cursor after clear()
doc: Added indication of default modality value for panels.
doc: Added QScopedArrayPointer and corrected QScopedPointer snippet.
Improve test coverage of QScriptString::toArrayIndex()
QColorDialog::open() freezes the app the *second* time it is used on Mac
doc: Corrected typo.
doc: Removed bad grammar.
doc: Added \obsolete.
doc: Added \since 4.6 to the properties.
doc: Removed some erroneous text.
-rw-r--r-- | doc/src/examples/scribble.qdoc | 5 | ||||
-rw-r--r-- | doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qdir.cpp | 8 | ||||
-rw-r--r-- | src/corelib/io/qiodevice.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 9 | ||||
-rw-r--r-- | src/corelib/tools/qscopedpointer.cpp | 55 | ||||
-rw-r--r-- | src/gui/dialogs/qcolordialog_mac.mm | 10 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.cpp | 2 | ||||
-rw-r--r-- | src/svg/qgraphicssvgitem.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qscriptstring/tst_qscriptstring.cpp | 6 |
11 files changed, 98 insertions, 26 deletions
diff --git a/doc/src/examples/scribble.qdoc b/doc/src/examples/scribble.qdoc index 3c6d136..5c66410 100644 --- a/doc/src/examples/scribble.qdoc +++ b/doc/src/examples/scribble.qdoc @@ -74,9 +74,8 @@ \o \c MainWindow provides a menu above the \c ScribbleArea. \endlist - We will start by reviewing the \c ScribbleArea class, which - contains the interesting, then we will take a look at the \c - MainWindow class that uses it. + We will start by reviewing the \c ScribbleArea class. Then we will + review the \c MainWindow class, which uses \c ScribbleArea. \section1 ScribbleArea Class Definition diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp index c068ba9..4158388 100644 --- a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp +++ b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp @@ -128,7 +128,7 @@ private: QScopedPointer<int, QScopedPointerArrayDeleter<int> > arrayPointer(new int[42]); // this QScopedPointer frees its data using free(): -QScopedPointer<int, QScopedPointerPodDeleter<int> > podPointer(reinterpret_cast<int *>(malloc(42))); +QScopedPointer<int, QScopedPointerPodDeleter> podPointer(reinterpret_cast<int *>(malloc(42))); // this struct calls "myCustomDeallocator" to delete the pointer struct ScopedPointerCustomDeleter diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index dc7f17e..69b3af4 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -993,15 +993,15 @@ void QDir::setNameFilters(const QStringList &nameFilters) /*! \obsolete + + Use QDir::addSearchPath() with a prefix instead. + Adds \a path to the search paths searched in to find resources that are not specified with an absolute path. The default search path is to search only in the root (\c{:/}). - Use QDir::addSearchPath() with a prefix instead. - - \sa {The Qt Resource System}, QResource::addSearchPath() + \sa {The Qt Resource System} */ - void QDir::addResourceSearchPath(const QString &path) { #ifdef QT_BUILD_CORE_LIB diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 4e14ba8..662100a 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1003,8 +1003,8 @@ QByteArray QIODevice::readAll() to a maximum of \a maxSize - 1 bytes, stores the characters in \a data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error - occurs, this function returns what it could the length of what - could be read, or -1 if nothing was read. + occurs, this function returns the length of what could be read, or + -1 if nothing was read. A terminating '\0' byte is always appended to \a data, so \a maxSize must be larger than 1. diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index adfbb15..6d33c8b 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -555,16 +555,15 @@ QStringList QResource::children() const /*! \obsolete + Use QDir::addSearchPath() with a prefix instead. + Adds \a path to the search paths searched in to find resources that are not specified with an absolute path. The \a path must be an absolute path (start with \c{/}). The default search path is to search only in the root (\c{:/}). The last path added will be consulted first upon next QResource creation. - - Use QDir::addSearchPath() with a prefix instead. */ - void QResource::addSearchPath(const QString &path) { @@ -578,6 +577,10 @@ QResource::addSearchPath(const QString &path) } /*! + \obsolete + + Use QDir::searchPaths() instead. + Returns the current search path list. This list is consulted when creating a relative resource. diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 12badf0..e7dd769 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -225,4 +225,59 @@ QT_BEGIN_NAMESPACE Swap this pointer with \a other. */ +/*! + \class QScopedArrayPointer + + \brief The QScopedArrayPointer class stores a pointer to a + dynamically allocated array of objects, and deletes it upon + destruction. + + \since 4.6 + \reentrant + \ingroup misc + + A QScopedArrayPointer is a QScopedPointer that defaults to + deleting the object it is pointing to with the delete[] operator. It + also features operator[] for convenience, so we can write: + + \code + void foo() + { + QScopedArrayPointer<int> i(new int[10]); + i[2] = 42; + ... + return; // our integer array is now deleted using delete[] + } + \endcode +*/ + +/*! + \fn QScopedArrayPointer::QScopedArrayPointer(T *p = 0) + + Constructs this QScopedArrayPointer instance and sets its pointer + to \a p. +*/ + +/*! + \fn T *QScopedArrayPointer::operator[](int i) + + Provides access to entry \a i of the scoped pointer's array of + objects. + + If the contained pointer is \c null, behavior is undefined. + + \sa isNull() +*/ + +/*! + \fn T *QScopedArrayPointer::operator[](int i) const + + Provides access to entry \a i of the scoped pointer's array of + objects. + + If the contained pointer is \c null, behavior is undefined. + + \sa isNull() +*/ + QT_END_NAMESPACE diff --git a/src/gui/dialogs/qcolordialog_mac.mm b/src/gui/dialogs/qcolordialog_mac.mm index bdcb872..8af0d2b 100644 --- a/src/gui/dialogs/qcolordialog_mac.mm +++ b/src/gui/dialogs/qcolordialog_mac.mm @@ -96,6 +96,7 @@ QT_USE_NAMESPACE - (void)finishOffWithCode:(NSInteger)result; - (void)showColorPanel; - (void)exec; +- (void)setResultSet:(BOOL)result; @end @implementation QCocoaColorPanelDelegate @@ -158,6 +159,11 @@ QT_USE_NAMESPACE [super dealloc]; } +- (void)setResultSet:(BOOL)result +{ + mResultSet = result; +} + - (BOOL)windowShouldClose:(id)window { Q_UNUSED(window); @@ -320,7 +326,7 @@ QT_USE_NAMESPACE } else { mPriv->colorDialog()->accept(); } - } + } } } @@ -433,7 +439,7 @@ void QColorDialogPrivate::openCocoaColorPanel(const QColor &initial, priv:this]; [colorPanel setDelegate:static_cast<QCocoaColorPanelDelegate *>(delegate)]; } - + [delegate setResultSet:false]; setCocoaPanelColor(initial); [static_cast<QCocoaColorPanelDelegate *>(delegate) showColorPanel]; } diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 2f208b7..bd214e1 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -414,12 +414,6 @@ /*! \enum QGraphicsItem::GraphicsItemChange - ItemVisibleHasChanged, - ItemEnabledHasChanged, - ItemSelectedHasChanged, - ItemParentHasChanged, - ItemSceneHasChanged - This enum describes the state changes that are notified by QGraphicsItem::itemChange(). The notifications are sent as the state changes, and in some cases, adjustments can be made (see the documentation @@ -647,9 +641,16 @@ are children of a modal panel are not blocked. The values are: - \value NonModal The panel is not modal and does not block input to other panels. - \value PanelModal The panel is modal to a single item hierarchy and blocks input to its parent pane, all grandparent panels, and all siblings of its parent and grandparent panels. - \value SceneModal The window is modal to the entire scene and blocks input to all panels. + + \value NonModal The panel is not modal and does not block input to + other panels. This is the default value for panels. + + \value PanelModal The panel is modal to a single item hierarchy + and blocks input to its parent pane, all grandparent panels, and + all siblings of its parent and grandparent panels. + + \value SceneModal The window is modal to the entire scene and + blocks input to all panels. \sa QGraphicsItem::setPanelModality(), QGraphicsItem::panelModality(), QGraphicsItem::ItemIsPanel */ diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 1aa7a2b..2c76a5c 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -129,7 +129,7 @@ void QLineEditPrivate::_q_editFocusChange(bool e) void QLineEditPrivate::_q_selectionChanged() { Q_Q(QLineEdit); - if (control->preeditAreaText().isEmpty()) { + if (!control->text().isEmpty() && control->preeditAreaText().isEmpty()) { QStyleOptionFrameV2 opt; q->initStyleOption(&opt); bool showCursor = control->hasSelectedText() ? diff --git a/src/svg/qgraphicssvgitem.cpp b/src/svg/qgraphicssvgitem.cpp index 7e80e50..69ff7a3 100644 --- a/src/svg/qgraphicssvgitem.cpp +++ b/src/svg/qgraphicssvgitem.cpp @@ -267,6 +267,7 @@ int QGraphicsSvgItem::type() const /*! \property QGraphicsSvgItem::maximumCacheSize + \since 4.6 This property holds the maximum size of the device coordinate cache for this item. @@ -312,7 +313,8 @@ QSize QGraphicsSvgItem::maximumCacheSize() const /*! \property QGraphicsSvgItem::elementId - + \since 4.6 + This property holds the element's XML ID. */ diff --git a/tests/auto/qscriptstring/tst_qscriptstring.cpp b/tests/auto/qscriptstring/tst_qscriptstring.cpp index 808b643..ea4a92b 100644 --- a/tests/auto/qscriptstring/tst_qscriptstring.cpp +++ b/tests/auto/qscriptstring/tst_qscriptstring.cpp @@ -177,6 +177,12 @@ void tst_QScriptString::toArrayIndex_data() QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff); QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe); QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff); + QTest::newRow("0.0") << QString::fromLatin1("0.0") << false << quint32(0xffffffff); + QTest::newRow("1.0") << QString::fromLatin1("1.0") << false << quint32(0xffffffff); + QTest::newRow("1.5") << QString::fromLatin1("1.5") << false << quint32(0xffffffff); + QTest::newRow("1.") << QString::fromLatin1("1.") << false << quint32(0xffffffff); + QTest::newRow(".1") << QString::fromLatin1(".1") << false << quint32(0xffffffff); + QTest::newRow("1e0") << QString::fromLatin1("1e0") << false << quint32(0xffffffff); } void tst_QScriptString::toArrayIndex() |