diff options
author | Guoqing Zhang <guoqing.zhang@nokia.com> | 2011-04-05 07:49:59 (GMT) |
---|---|---|
committer | Guoqing Zhang <guoqing.zhang@nokia.com> | 2011-04-05 07:49:59 (GMT) |
commit | 81921596f6083eedb926c214c3e6324ba4b40cab (patch) | |
tree | 089f0bbd39c46afbae5e47f8ac990977024bc91c /src/gui/widgets | |
parent | ebe4edf58728f4dc5cf633ba6fb92dea721b2bdc (diff) | |
parent | c3e903409b96fede96cb4a7b95ba308663c88879 (diff) | |
download | Qt-81921596f6083eedb926c214c3e6324ba4b40cab.zip Qt-81921596f6083eedb926c214c3e6324ba4b40cab.tar.gz Qt-81921596f6083eedb926c214c3e6324ba4b40cab.tar.bz2 |
Merge remote branch 'qt-master/master'
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qabstractscrollarea.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qabstractslider.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 13 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindowlayout.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindowlayout_mac.mm | 6 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindowlayout_p.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 36 | ||||
-rw-r--r-- | src/gui/widgets/qscrollbar.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qsplitter.cpp | 2 |
10 files changed, 40 insertions, 45 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 7460f32..dabfec0 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -511,7 +511,7 @@ QAbstractScrollArea::QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget /*! Constructs a viewport. - The \a parent arguments is sent to the QWidget constructor. + The \a parent argument is sent to the QWidget constructor. */ QAbstractScrollArea::QAbstractScrollArea(QWidget *parent) :QFrame(*new QAbstractScrollAreaPrivate, parent) @@ -1386,6 +1386,7 @@ bool QAbstractScrollAreaPrivate::canStartScrollingAt( const QPoint &startPos ) { Q_Q(QAbstractScrollArea); +#ifndef QT_NO_GRAPHICSVIEW // don't start scrolling when a drag mode has been set. // don't start scrolling on a movable item. if (QGraphicsView *view = qobject_cast<QGraphicsView *>(q)) { @@ -1397,6 +1398,7 @@ bool QAbstractScrollAreaPrivate::canStartScrollingAt( const QPoint &startPos ) if (childItem && (childItem->flags() & QGraphicsItem::ItemIsMovable)) return false; } +#endif // don't start scrolling on a QAbstractSlider if (qobject_cast<QAbstractSlider *>(q->viewport()->childAt(startPos))) { diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index cb36398..2570496 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -265,7 +265,7 @@ void QAbstractSliderPrivate::setSteps(int single, int page) /*! Constructs an abstract slider. - The \a parent arguments is sent to the QWidget constructor. + The \a parent argument is sent to the QWidget constructor. The \l minimum defaults to 0, the \l maximum to 99, with a \l singleStep size of 1 and a \l pageStep size of 10, and an initial diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 34e3672..5f00afa 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -705,11 +705,13 @@ void QComboBoxPrivateContainer::hideEvent(QHideEvent *) { emit resetButton(); combo->update(); +#ifndef QT_NO_GRAPHICSVIEW // QGraphicsScenePrivate::removePopup closes the combo box popup, it hides it non-explicitly. // Hiding/showing the QComboBox after this will unexpectedly show the popup as well. // Re-hiding the popup container makes sure it is explicitly hidden. if (QGraphicsProxyWidget *proxy = graphicsProxyWidget()) proxy->hide(); +#endif } void QComboBoxPrivateContainer::mousePressEvent(QMouseEvent *e) @@ -945,7 +947,10 @@ QComboBox::QComboBox(bool rw, QWidget *parent, const char *name) to set and get item data (e.g., setItemData() and itemText()). You can also set a new model and view (with setModel() and setView()). For the text and icon in the combobox label, the data in the model - that has the Qt::DisplayRole and Qt::DecorationRole is used. + that has the Qt::DisplayRole and Qt::DecorationRole is used. Note + that you cannot alter the \l{QAbstractItemView::}{SelectionMode} + of the view(), e.g., by using + \l{QAbstractItemView::}{setSelectionMode()}. \image qstyle-comboboxes.png Comboboxes in the different built-in styles. @@ -2468,12 +2473,7 @@ void QComboBox::showPopup() // available screen geometry.This may override the vertical position, but it is more // important to show as much as possible of the popup. const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height()); -#ifdef Q_WS_S60 - //popup needs to be stretched with screen minimum dimension - listRect.setHeight(qMin(screen.height(), screen.width())); -#else listRect.setHeight(height); -#endif if (boundToScreen) { if (listRect.top() < screen.top()) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index fd61783..43d6796 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1521,12 +1521,23 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) #ifdef QT_MAC_USE_COCOA // Activate the unified toolbar with the raster engine. - if (windowSurface()) { + if (windowSurface() && set) { d->layout->unifiedSurface = new QUnifiedToolbarSurface(this); } #endif // QT_MAC_USE_COCOA d->layout->updateHIToolBarStatus(); + +#ifdef QT_MAC_USE_COCOA + // Deactivate the unified toolbar with the raster engine. + if (windowSurface() && !set) { + if (d->layout->unifiedSurface) { + delete d->layout->unifiedSurface; + d->layout->unifiedSurface = 0; + } + } +#endif // QT_MAC_USE_COCOA + // Enabling the unified toolbar clears the opaque size grip setting, update it. d->macUpdateOpaqueSizeGrip(); #else diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index 6bc07e1..d4afe07 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -73,6 +73,10 @@ # include <private/qt_cocoa_helpers_mac_p.h> #endif +#ifdef QT_NO_DOCKWIDGET +extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); +#endif + #ifdef Q_DEBUG_MAINWINDOW_LAYOUT # include <QTextStream> #endif diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index e428ffc..761a433 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -356,10 +356,10 @@ void QMainWindowLayout::updateHIToolBarStatus() while (!qtoolbarsInUnifiedToolbarList.isEmpty()) { // Should shrink the list by one every time. QToolBar *toolbar = qtoolbarsInUnifiedToolbarList.first(); - layoutState.mainWindow->addToolBar(Qt::TopToolBarArea, toolbar); #if defined(QT_MAC_USE_COCOA) - toolbar->d_func()->isInUnifiedToolbar = false; + unifiedSurface->removeToolbar(toolbar); #endif + layoutState.mainWindow->addToolBar(Qt::TopToolBarArea, toolbar); } macWindowToolbarSet(qt_mac_window_for(layoutState.mainWindow), 0); } else { @@ -393,7 +393,7 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar return; #if defined(QT_MAC_USE_COCOA) - // toolbar will now become native (if not allready) since we need + // toolbar will now become native (if not already) since we need // an nsview for it inside the corresponding NSToolbarItem. // Setting isInUnifiedToolbar will (among other things) stop alien // siblings from becoming native when this happends since the toolbar diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index 2a44432..20aca61 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -70,12 +70,12 @@ //#define Q_DEBUG_MAINWINDOW_LAYOUT -#ifdef Q_DEBUG_MAINWINDOW_LAYOUT +#if defined(Q_DEBUG_MAINWINDOW_LAYOUT) && !defined(QT_NO_DOCKWIDGET) QT_BEGIN_NAMESPACE class QTextStream; Q_GUI_EXPORT void qt_dumpLayout(QTextStream &qout, QMainWindow *window); QT_END_NAMESPACE -#endif // Q_DEBUG_MAINWINDOW_LAYOUT +#endif // Q_DEBUG_MAINWINDOW_LAYOUT && !QT_NO_DOCKWIDGET #ifdef Q_WS_MAC // Forward defs to make avoid including Carbon.h (faster compile you know ;). diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index c09b5a4..b12e5c5 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1247,37 +1247,15 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) response to button presses; these are just like context menus except for how they are invoked. - \raw HTML - <table align="center" cellpadding="0"> - <tr> - <td> - \endraw - \inlineimage plastique-menu.png - \raw HTML - </td> - <td> - \endraw - \inlineimage windowsxp-menu.png - \raw HTML - </td> - <td> - \endraw - \inlineimage macintosh-menu.png - \raw HTML - </td> - - </tr> - <tr> - <td colspan="3"> - \endraw - A menu shown in \l{Plastique Style Widget Gallery}{Plastique widget style}, + \table 100% + \row + \o \inlineimage plastique-menu.png + \o \inlineimage windowsxp-menu.png + \o \inlineimage macintosh-menu.png + \endtable + \caption Fig. A menu shown in \l{Plastique Style Widget Gallery}{Plastique widget style}, \l{Windows XP Style Widget Gallery}{Windows XP widget style}, and \l{Macintosh Style Widget Gallery}{Macintosh widget style}. - \raw HTML - </td> - </tr> - </table> - \endraw \section1 Actions diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp index c895b1b..87738a0 100644 --- a/src/gui/widgets/qscrollbar.cpp +++ b/src/gui/widgets/qscrollbar.cpp @@ -330,7 +330,7 @@ void QScrollBar::initStyleOption(QStyleOptionSlider *option) const /*! Constructs a vertical scroll bar. - The \a parent arguments is sent to the QWidget constructor. + The \a parent argument is sent to the QWidget constructor. The \l {QAbstractSlider::minimum} {minimum} defaults to 0, the \l {QAbstractSlider::maximum} {maximum} to 99, with a diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp index 964a6e1..ca8fc37 100644 --- a/src/gui/widgets/qsplitter.cpp +++ b/src/gui/widgets/qsplitter.cpp @@ -1016,7 +1016,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w) /*! Constructs a horizontal splitter with the \a parent - arguments is passed on to the QFrame constructor. + argument passed on to the QFrame constructor. \sa setOrientation() */ |