summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qdialog.h4
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp10
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.h2
-rw-r--r--src/widgets/itemviews/qcolumnview_p.h2
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.h2
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.h2
-rw-r--r--src/widgets/itemviews/qlistview.cpp24
-rw-r--r--src/widgets/itemviews/qlistview.h3
-rw-r--r--src/widgets/itemviews/qstandarditemmodel.h2
-rw-r--r--src/widgets/itemviews/qtablewidget.h2
-rw-r--r--src/widgets/itemviews/qtreeview.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp30
-rw-r--r--src/widgets/itemviews/qtreewidget.h5
-rw-r--r--src/widgets/kernel/qaction.cpp2
-rw-r--r--src/widgets/kernel/qapplication.h1
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp5
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp32
-rw-r--r--src/widgets/kernel/qstackedlayout.h2
-rw-r--r--src/widgets/kernel/qwidget.cpp1
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp11
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp27
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp8
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp17
-rw-r--r--src/widgets/styles/qcommonstyle.cpp14
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm56
-rw-r--r--src/widgets/styles/qmotifstyle.cpp148
-rw-r--r--src/widgets/styles/qplastiquestyle.cpp6
-rw-r--r--src/widgets/styles/qstyle.cpp48
-rw-r--r--src/widgets/styles/qstyle.h31
-rw-r--r--src/widgets/styles/qstyleoption.cpp388
-rw-r--r--src/widgets/styles/qstyleoption.h68
-rw-r--r--src/widgets/styles/qwindowscestyle.cpp5
-rw-r--r--src/widgets/styles/qwindowsmobilestyle.cpp5
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp3
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp14
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp10
-rw-r--r--src/widgets/widgets/qabstractscrollarea.h2
-rw-r--r--src/widgets/widgets/qdatetimeedit.h4
-rw-r--r--src/widgets/widgets/qmenu.h1
-rw-r--r--src/widgets/widgets/qstackedwidget.cpp46
-rw-r--r--src/widgets/widgets/qtabbar.cpp20
-rw-r--r--src/widgets/widgets/qtabbar.h1
-rw-r--r--src/widgets/widgets/qtabbar_p.h2
-rw-r--r--src/widgets/widgets/qtabwidget.h1
44 files changed, 127 insertions, 944 deletions
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index 7d3052a782..f20ff46d41 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -91,8 +91,8 @@ Q_SIGNALS:
void rejected();
public Q_SLOTS:
- void open();
- int exec();
+ virtual void open();
+ virtual int exec();
virtual void done(int);
virtual void accept();
virtual void reject();
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index ecba3e238f..125beab91b 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -402,6 +402,16 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
return false;
}
+/*!
+ \internal
+
+ This virtual method is reserved and will be used in Qt 5.1.
+*/
+QSet<int> QAbstractItemDelegate::paintingRoles() const
+{
+ return QSet<int>();
+}
+
QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS
diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h
index 2c51dfcac8..89aa1915f6 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.h
+++ b/src/widgets/itemviews/qabstractitemdelegate.h
@@ -114,6 +114,8 @@ public:
const QStyleOptionViewItem &option,
const QModelIndex &index);
+ virtual QSet<int> paintingRoles() const;
+
Q_SIGNALS:
void commitData(QWidget *editor);
void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint = NoHint);
diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h
index 5bdb74c56c..c3c79d35a3 100644
--- a/src/widgets/itemviews/qcolumnview_p.h
+++ b/src/widgets/itemviews/qcolumnview_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
class QColumnViewPreviewColumn : public QAbstractItemView {
public:
- QColumnViewPreviewColumn(QWidget *parent) : QAbstractItemView(parent), previewWidget(0) {
+ explicit QColumnViewPreviewColumn(QWidget *parent) : QAbstractItemView(parent), previewWidget(0) {
}
void setPreviewWidget(QWidget *widget) {
diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h
index e73d4b1044..3cb8f09510 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.h
+++ b/src/widgets/itemviews/qdatawidgetmapper.h
@@ -66,7 +66,7 @@ class Q_WIDGETS_EXPORT QDataWidgetMapper: public QObject
Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy)
public:
- QDataWidgetMapper(QObject *parent = 0);
+ explicit QDataWidgetMapper(QObject *parent = 0);
~QDataWidgetMapper();
void setModel(QAbstractItemModel *model);
diff --git a/src/widgets/itemviews/qitemeditorfactory.h b/src/widgets/itemviews/qitemeditorfactory.h
index aff8de3a4c..8bc1cc7df6 100644
--- a/src/widgets/itemviews/qitemeditorfactory.h
+++ b/src/widgets/itemviews/qitemeditorfactory.h
@@ -69,7 +69,7 @@ template <class T>
class QItemEditorCreator : public QItemEditorCreatorBase
{
public:
- inline QItemEditorCreator(const QByteArray &valuePropertyName);
+ inline explicit QItemEditorCreator(const QByteArray &valuePropertyName);
inline QWidget *createWidget(QWidget *parent) const { return new T(parent); }
inline QByteArray valuePropertyName() const { return propertyName; }
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 4547dde6e1..ea692f6f67 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -894,30 +894,6 @@ void QListView::startDrag(Qt::DropActions supportedActions)
QAbstractItemView::startDrag(supportedActions);
}
-/*!
- \internal
-
- Called whenever items from the view is dropped on the viewport.
- The \a event provides additional information.
-*/
-void QListView::internalDrop(QDropEvent *event)
-{
- // ### Qt5: remove that function
- Q_UNUSED(event);
-}
-
-/*!
- \internal
-
- Called whenever the user starts dragging items and the items are movable,
- enabling internal dragging and dropping of items.
-*/
-void QListView::internalDrag(Qt::DropActions supportedActions)
-{
- // ### Qt5: remove that function
- Q_UNUSED(supportedActions);
-}
-
#endif // QT_NO_DRAGANDDROP
/*!
diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h
index d278dec8c6..7b065b0585 100644
--- a/src/widgets/itemviews/qlistview.h
+++ b/src/widgets/itemviews/qlistview.h
@@ -160,9 +160,6 @@ protected:
void dragLeaveEvent(QDragLeaveEvent *e);
void dropEvent(QDropEvent *e);
void startDrag(Qt::DropActions supportedActions);
-
- void internalDrop(QDropEvent *e);
- void internalDrag(Qt::DropActions supportedActions);
#endif // QT_NO_DRAGANDDROP
QStyleOptionViewItem viewOptions() const;
diff --git a/src/widgets/itemviews/qstandarditemmodel.h b/src/widgets/itemviews/qstandarditemmodel.h
index e374665f20..767665fd94 100644
--- a/src/widgets/itemviews/qstandarditemmodel.h
+++ b/src/widgets/itemviews/qstandarditemmodel.h
@@ -66,7 +66,7 @@ class Q_WIDGETS_EXPORT QStandardItem
{
public:
QStandardItem();
- QStandardItem(const QString &text);
+ explicit QStandardItem(const QString &text);
QStandardItem(const QIcon &icon, const QString &text);
explicit QStandardItem(int rows, int columns = 1);
virtual ~QStandardItem();
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index 3d08e204d1..0c6ed85fc9 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -84,7 +84,7 @@ class Q_WIDGETS_EXPORT QTableWidgetItem
friend class QTableModel;
public:
enum ItemType { Type = 0, UserType = 1000 };
- QTableWidgetItem(int type = Type);
+ explicit QTableWidgetItem(int type = Type);
explicit QTableWidgetItem(const QString &text, int type = Type);
explicit QTableWidgetItem(const QIcon &icon, const QString &text, int type = Type);
QTableWidgetItem(const QTableWidgetItem &other);
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index acc485c371..be78cdbf14 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1849,7 +1849,7 @@ void QTreeView::mousePressEvent(QMouseEvent *event)
{
Q_D(QTreeView);
bool handled = false;
- if (style()->styleHint(QStyle::SH_Q3ListViewExpand_SelectMouseType, 0, this) == QEvent::MouseButtonPress)
+ if (style()->styleHint(QStyle::SH_ListViewExpand_SelectMouseType, 0, this) == QEvent::MouseButtonPress)
handled = d->expandOrCollapseItemAtPos(event->pos());
if (!handled && d->itemDecorationAt(event->pos()) == -1)
QAbstractItemView::mousePressEvent(event);
@@ -1866,7 +1866,7 @@ void QTreeView::mouseReleaseEvent(QMouseEvent *event)
} else {
if (state() == QAbstractItemView::DragSelectingState)
setState(QAbstractItemView::NoState);
- if (style()->styleHint(QStyle::SH_Q3ListViewExpand_SelectMouseType, 0, this) == QEvent::MouseButtonRelease)
+ if (style()->styleHint(QStyle::SH_ListViewExpand_SelectMouseType, 0, this) == QEvent::MouseButtonRelease)
d->expandOrCollapseItemAtPos(event->pos());
}
}
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index f8e3a375a4..e2d84825f0 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2655,16 +2655,6 @@ QTreeWidgetItem *QTreeWidget::takeTopLevelItem(int index)
}
/*!
- \internal
-*/
-int QTreeWidget::indexOfTopLevelItem(QTreeWidgetItem *item)
-{
- Q_D(QTreeWidget);
- d->treeModel()->executePendingSort();
- return d->treeModel()->rootItem->children.indexOf(item);
-}
-
-/*!
Returns the index of the given top-level \a item, or -1 if the item
cannot be found.
@@ -2900,26 +2890,6 @@ void QTreeWidget::sortItems(int column, Qt::SortOrder order)
}
/*!
- \internal
-
- ### Qt 5: remove
-*/
-void QTreeWidget::setSortingEnabled(bool enable)
-{
- QTreeView::setSortingEnabled(enable);
-}
-
-/*!
- \internal
-
- ### Qt 5: remove
-*/
-bool QTreeWidget::isSortingEnabled() const
-{
- return QTreeView::isSortingEnabled();
-}
-
-/*!
Starts editing the \a item in the given \a column if it is editable.
*/
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index c9654d3e8e..7420894dfb 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -69,7 +69,7 @@ class Q_WIDGETS_EXPORT QTreeWidgetItem
public:
enum ItemType { Type = 0, UserType = 1000 };
explicit QTreeWidgetItem(int type = Type);
- QTreeWidgetItem(const QStringList &strings, int type = Type);
+ explicit QTreeWidgetItem(const QStringList &strings, int type = Type);
explicit QTreeWidgetItem(QTreeWidget *view, int type = Type);
QTreeWidgetItem(QTreeWidget *view, const QStringList &strings, int type = Type);
QTreeWidgetItem(QTreeWidget *view, QTreeWidgetItem *after, int type = Type);
@@ -277,7 +277,6 @@ public:
void insertTopLevelItem(int index, QTreeWidgetItem *item);
void addTopLevelItem(QTreeWidgetItem *item);
QTreeWidgetItem *takeTopLevelItem(int index);
- int indexOfTopLevelItem(QTreeWidgetItem *item); // ### Qt 5: remove me
int indexOfTopLevelItem(QTreeWidgetItem *item) const;
void insertTopLevelItems(int index, const QList<QTreeWidgetItem*> &items);
@@ -300,8 +299,6 @@ public:
int sortColumn() const;
void sortItems(int column, Qt::SortOrder order);
- void setSortingEnabled(bool enable);
- bool isSortingEnabled() const;
void editItem(QTreeWidgetItem *item, int column = 0);
void openPersistentEditor(QTreeWidgetItem *item, int column = 0);
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index f450d13a39..c4f7995087 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -879,7 +879,7 @@ QString QAction::statusTip() const
the action. The text may contain rich text. There is no default
"What's This?" text.
- \sa QWhatsThis Q3StyleSheet
+ \sa QWhatsThis
*/
void QAction::setWhatsThis(const QString &whatsthis)
{
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 3e11db0863..6c1ced1623 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -244,7 +244,6 @@ private:
friend class QWidgetPrivate;
friend class QWidgetWindow;
friend class QETWidget;
- friend class Q3AccelManager;
friend class QTranslator;
friend class QWidgetAnimator;
#ifndef QT_NO_SHORTCUT
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 97fc794252..7c969b4928 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -305,7 +305,6 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton");
setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton");
setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView");
- setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "Q3Header");
setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView");
setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPelette), "QMessageBoxLabel");
setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar");
@@ -354,10 +353,8 @@ void QApplicationPrivate::initializeWidgetFontHash()
fontHash->insert(QByteArrayLiteral("QAbstractItemView"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ListViewFont))
fontHash->insert(QByteArrayLiteral("QListViewFont"), *font);
- if (const QFont *font = theme->font(QPlatformTheme::HeaderViewFont)) {
+ if (const QFont *font = theme->font(QPlatformTheme::HeaderViewFont))
fontHash->insert(QByteArrayLiteral("QHeaderViewFont"), *font);
- fontHash->insert(QByteArrayLiteral("Q3Header"), *font);
- }
if (const QFont *font = theme->font(QPlatformTheme::ListBoxFont))
fontHash->insert(QByteArrayLiteral("QListBox"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ComboMenuItemFont))
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index 9b40063e65..0d2e7716e5 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -477,6 +477,38 @@ void QStackedLayout::setGeometry(const QRect &rect)
}
/*!
+ \reimp
+*/
+bool QStackedLayout::hasHeightForWidth() const
+{
+ const int n = count();
+
+ for (int i = 0; i < n; ++i) {
+ if (QLayoutItem *item = itemAt(i)) {
+ if (item->hasHeightForWidth())
+ return true;
+ }
+ }
+ return false;
+}
+
+/*!
+ \reimp
+*/
+int QStackedLayout::heightForWidth(int width) const
+{
+ const int n = count();
+
+ int hfw = 0;
+ for (int i = 0; i < n; ++i) {
+ if (QLayoutItem *item = itemAt(i)) {
+ hfw = qMax(hfw, item->heightForWidth(width));
+ }
+ }
+ return hfw;
+}
+
+/*!
\enum QStackedLayout::StackingMode
\since 4.4
diff --git a/src/widgets/kernel/qstackedlayout.h b/src/widgets/kernel/qstackedlayout.h
index e54efa886e..fa77341c52 100644
--- a/src/widgets/kernel/qstackedlayout.h
+++ b/src/widgets/kernel/qstackedlayout.h
@@ -94,6 +94,8 @@ public:
QLayoutItem *itemAt(int) const;
QLayoutItem *takeAt(int);
void setGeometry(const QRect &rect);
+ bool hasHeightForWidth() const;
+ int heightForWidth(int width) const;
Q_SIGNALS:
void widgetRemoved(int index);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 63eb2540ff..8a3fea9c8a 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -8441,6 +8441,7 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
+ Q_UNUSED(event);
}
#ifndef QT_NO_WHEELEVENT
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 3d23b04ddf..0f55646958 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -440,9 +440,9 @@ static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen
void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
- q->setAttribute(Qt::WA_Mapped);
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
invalidateBuffer(q->rect());
+ q->setAttribute(Qt::WA_Mapped);
return;
}
@@ -483,8 +483,8 @@ void QWidgetPrivate::show_sys()
void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
- q->setAttribute(Qt::WA_Mapped, false);
deactivateWidgetCleanup();
+
if (!q->isWindow()) {
QWidget *p = q->parentWidget();
if (p &&p->isVisible()) {
@@ -492,7 +492,12 @@ void QWidgetPrivate::hide_sys()
}
return;
}
- if (QWindow *window = q->windowHandle()) {
+
+ invalidateBuffer(q->rect());
+
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ q->setAttribute(Qt::WA_Mapped, false);
+ } else if (QWindow *window = q->windowHandle()) {
window->setVisible(false);
}
}
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index b331356e66..2e9f072a0f 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -914,29 +914,7 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
{
- if (!tlw || !tlwExtra)
- return true;
-
-#ifdef Q_WS_X11
- // Delay the sync until we get an Expose event from X11 (initial show).
- // Qt::WA_Mapped is set to true, but the actual mapping has not yet occurred.
- // However, we must repaint immediately regardless of the state if someone calls repaint().
- if (tlwExtra->waitingForMapNotify && !tlwExtra->inRepaint)
- return true;
-#endif
-
- if (!tlw->testAttribute(Qt::WA_Mapped))
- return true;
-
- if (!tlw->isVisible()
-#ifndef Q_WS_X11
- // If we're minimized on X11, WA_Mapped will be false and we
- // will return in the case above. Some window managers on X11
- // sends us the PropertyNotify to change the minimized state
- // *AFTER* we've received the expose event, which is baaad.
- || tlw->isMinimized()
-#endif
- )
+ if (!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible())
return true;
return false;
@@ -1345,6 +1323,9 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
return;
Q_Q(QWidget);
+ if (discardSyncRequest(q, maybeTopData()))
+ return;
+
if (q->testAttribute(Qt::WA_StaticContents)) {
if (!extra)
createExtra();
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index 81847681e4..f6817cec8a 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -184,12 +184,4 @@ void qRegisterWidgetsVariant()
}
Q_CONSTRUCTOR_FUNCTION(qRegisterWidgetsVariant)
-void qUnregisterWidgetsVariant()
-{
- QVariantPrivate::unregisterHandler(QModulesPrivate::Widgets);
- qMetaTypeWidgetsHelper = 0;
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterWidgetsVariant)
-
-
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 7a13e2032e..aa7ccfeb4f 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -146,15 +146,6 @@ bool QWidgetWindow::event(QEvent *event)
handleDragEvent(event);
break;
- case QEvent::Map:
- m_widget->setAttribute(Qt::WA_Mapped);
- m_widget->d_func()->syncBackingStore();
- return true;
-
- case QEvent::Unmap:
- m_widget->setAttribute(Qt::WA_Mapped, false);
- return true;
-
case QEvent::Expose:
handleExposeEvent(static_cast<QExposeEvent *>(event));
return true;
@@ -441,7 +432,13 @@ void QWidgetWindow::handleDragEvent(QEvent *event)
void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
{
- m_widget->d_func()->syncBackingStore(event->region());
+ if (isExposed()) {
+ m_widget->setAttribute(Qt::WA_Mapped);
+ if (!event->region().isNull())
+ m_widget->d_func()->syncBackingStore(event->region());
+ } else {
+ m_widget->setAttribute(Qt::WA_Mapped, false);
+ }
}
void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event)
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 174e94e63d..ca06cda2b0 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -460,9 +460,6 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
}
p->restore();
break;
- case PE_Q3DockWindowSeparator:
- proxy()->drawPrimitive(PE_IndicatorToolBarSeparator, opt, p, widget);
- break;
case PE_IndicatorToolBarSeparator:
{
QPoint p1, p2;
@@ -4106,10 +4103,8 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
}
int frameWidth = 0;
- if (!(widget && widget->inherits("Q3GroupBox"))
- && ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)) {
+ if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)
frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget);
- }
ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin,
-frameWidth, -frameWidth);
break;
@@ -4233,10 +4228,6 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
case PM_DialogButtonsButtonHeight:
ret = int(QStyleHelper::dpiScaled(30.));
break;
- case PM_CheckListControllerSize:
- case PM_CheckListButtonSize:
- ret = int(QStyleHelper::dpiScaled(16.));
- break;
case PM_TitleBarHeight: {
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) {
@@ -4711,7 +4702,6 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case CT_MenuBar:
case CT_Menu:
case CT_MenuBarItem:
- case CT_Q3Header:
case CT_Slider:
case CT_ProgressBar:
case CT_TabBarTab:
@@ -4756,7 +4746,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
break;
#endif // QT_NO_GROUPBOX
- case SH_Q3ListViewExpand_SelectMouseType:
+ case SH_ListViewExpand_SelectMouseType:
case SH_TabBar_SelectMouseType:
ret = QEvent::MouseButtonPress;
break;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 7e07cc1532..55c603896b 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2145,20 +2145,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
else
ret = sz.height();
break; }
- case PM_CheckListButtonSize: {
- switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- GetThemeMetric(kThemeMetricCheckBoxWidth, &ret);
- break;
- case QAquaSizeMini:
- GetThemeMetric(kThemeMetricMiniCheckBoxWidth, &ret);
- break;
- case QAquaSizeSmall:
- GetThemeMetric(kThemeMetricSmallCheckBoxWidth, &ret);
- break;
- }
- break; }
case PM_DialogButtonsButtonWidth: {
QSize sz;
ret = d->aquaSizeConstrain(opt, 0, QStyle::CT_PushButton, QSize(-1, -1), &sz);
@@ -2583,7 +2569,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_ScrollBar_StopMouseOverSlider:
ret = true;
break;
- case SH_Q3ListViewExpand_SelectMouseType:
+ case SH_ListViewExpand_SelectMouseType:
ret = QEvent::MouseButtonRelease;
break;
case SH_TabBar_SelectMouseType:
@@ -3094,8 +3080,6 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
p->restore();
break; }
case PE_IndicatorViewItemCheck:
- case PE_Q3CheckListExclusiveIndicator:
- case PE_Q3CheckListIndicator:
case PE_IndicatorRadioButton:
case PE_IndicatorCheckBox: {
bool drawColorless = (!(opt->state & State_Active))
@@ -3108,8 +3092,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
bdi.adornment = kThemeDrawIndicatorOnly;
if (opt->state & State_HasFocus)
bdi.adornment |= kThemeAdornmentFocus;
- bool isRadioButton = (pe == PE_Q3CheckListExclusiveIndicator
- || pe == PE_IndicatorRadioButton);
+ bool isRadioButton = (pe == PE_IndicatorRadioButton);
switch (d->aquaSizeConstrain(opt, w)) {
case QAquaSizeUnknown:
case QAquaSizeLarge:
@@ -3137,11 +3120,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
bdi.value = kThemeButtonOn;
else
bdi.value = kThemeButtonOff;
- HIRect macRect;
- if (pe == PE_Q3CheckListExclusiveIndicator || pe == PE_Q3CheckListIndicator)
- macRect = qt_hirectForQRect(opt->rect);
- else
- macRect = qt_hirectForQRect(opt->rect);
+ HIRect macRect = qt_hirectForQRect(opt->rect);
if (!drawColorless)
HIThemeDrawButton(&macRect, &bdi, cg, kHIThemeOrientationNormal, 0);
else
@@ -4931,35 +4910,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
}
break;
- case CC_Q3ListView:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if (lv->subControls & SC_Q3ListView)
- QWindowsStyle::drawComplexControl(cc, lv, p, widget);
- if (lv->subControls & (SC_Q3ListViewBranch | SC_Q3ListViewExpand)) {
- int y = lv->rect.y();
- int h = lv->rect.height();
- int x = lv->rect.right() - 10;
- for (int i = 1; i < lv->items.size() && y < h; ++i) {
- QStyleOptionQ3ListViewItem item = lv->items.at(i);
- if (y + item.height > 0 && (item.childCount > 0
- || (item.features & (QStyleOptionQ3ListViewItem::Expandable
- | QStyleOptionQ3ListViewItem::Visible))
- == (QStyleOptionQ3ListViewItem::Expandable
- | QStyleOptionQ3ListViewItem::Visible))) {
- QStyleOption treeOpt(0);
- treeOpt.rect.setRect(x, y + item.height / 2 - 4, 9, 9);
- treeOpt.palette = lv->palette;
- treeOpt.state = lv->state;
- treeOpt.state |= State_Children;
- if (item.state & State_Open)
- treeOpt.state |= State_Open;
- proxy()->drawPrimitive(PE_IndicatorBranch, &treeOpt, p, widget);
- }
- y += item.totalHeight;
- }
- }
- }
- break;
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QStyleOptionSpinBox newSB = *sb;
diff --git a/src/widgets/styles/qmotifstyle.cpp b/src/widgets/styles/qmotifstyle.cpp
index 331b70f153..f02771ab61 100644
--- a/src/widgets/styles/qmotifstyle.cpp
+++ b/src/widgets/styles/qmotifstyle.cpp
@@ -346,41 +346,6 @@ void QMotifStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP
const QWidget *w) const
{
switch(pe) {
- case PE_Q3CheckListExclusiveIndicator:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if (lv->items.isEmpty())
- return;
-
- if (lv->state & State_Enabled)
- p->setPen(QPen(opt->palette.text().color()));
- else
- p->setPen(QPen(lv->palette.color(QPalette::Disabled, QPalette::Text)));
- QPolygon a;
-
- int cx = opt->rect.width()/2 - 1;
- int cy = opt->rect.height()/2;
- int e = opt->rect.width()/2 - 1;
- for (int i = 0; i < 3; i++) { //penWidth 2 doesn't quite work
- a.setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e);
- p->drawPolygon(a);
- e--;
- }
- if (opt->state & State_On) {
- if (lv->state & State_Enabled)
- p->setPen(QPen(opt->palette.text().color()));
- else
- p->setPen(QPen(lv->palette.color(QPalette::Disabled,
- QPalette::Text)));
- QBrush saveBrush = p->brush();
- p->setBrush(opt->palette.text());
- e = e - 2;
- a.setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e);
- p->drawPolygon(a);
- p->setBrush(saveBrush);
- }
- }
- break;
-
case PE_FrameTabWidget:
case PE_FrameWindow:
qDrawShadePanel(p, opt->rect, opt->palette, QStyle::State_None, proxy()->pixelMetric(PM_DefaultFrameWidth));
@@ -1672,105 +1637,6 @@ void QMotifStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComple
break; }
#endif
- case CC_Q3ListView:
- if (opt->subControls & (SC_Q3ListViewBranch | SC_Q3ListViewExpand)) {
- int i;
- if (opt->subControls & SC_Q3ListView)
- QCommonStyle::drawComplexControl(cc, opt, p, widget);
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- QStyleOptionQ3ListViewItem item = lv->items.at(0);
- int y = opt->rect.y();
- int c;
- QPolygon dotlines;
- if ((opt->activeSubControls & SC_All) && (opt->subControls & SC_Q3ListViewExpand)) {
- c = 2;
- dotlines.resize(2);
- dotlines[0] = QPoint(opt->rect.right(), opt->rect.top());
- dotlines[1] = QPoint(opt->rect.right(), opt->rect.bottom());
- } else {
- int linetop = 0, linebot = 0;
- // each branch needs at most two lines, ie. four end points
- dotlines.resize(item.childCount * 4);
- c = 0;
-
- // skip the stuff above the exposed rectangle
- for (i = 1; i < lv->items.size(); ++i) {
- QStyleOptionQ3ListViewItem child = lv->items.at(i);
- if (child.height + y > 0)
- break;
- y += child.totalHeight;
- }
-
- int bx = opt->rect.width() / 2;
-
- // paint stuff in the magical area
- while (i < lv->items.size() && y < lv->rect.height()) {
- QStyleOptionQ3ListViewItem child = lv->items.at(i);
- if (child.features & QStyleOptionQ3ListViewItem::Visible) {
- int lh;
- if (!(item.features & QStyleOptionQ3ListViewItem::MultiLine))
- lh = child.height;
- else
- lh = p->fontMetrics().height() + 2 * lv->itemMargin;
- lh = qMax(lh, QApplication::globalStrut().height());
- if (lh % 2 > 0)
- lh++;
- linebot = y + lh/2;
- if ((child.features & QStyleOptionQ3ListViewItem::Expandable || child.childCount > 0) &&
- child.height > 0) {
- // needs a box
- p->setPen(opt->palette.text().color());
- p->drawRect(bx-4, linebot-4, 9, 9);
- QPolygon a;
- if ((child.state & State_Open))
- a.setPoints(3, bx-2, linebot-2,
- bx, linebot+2,
- bx+2, linebot-2); //Qt::RightArrow
- else
- a.setPoints(3, bx-2, linebot-2,
- bx+2, linebot,
- bx-2, linebot+2); //Qt::DownArrow
- p->setBrush(opt->palette.text());
- p->drawPolygon(a);
- p->setBrush(Qt::NoBrush);
- // dotlinery
- dotlines[c++] = QPoint(bx, linetop);
- dotlines[c++] = QPoint(bx, linebot - 5);
- dotlines[c++] = QPoint(bx + 5, linebot);
- dotlines[c++] = QPoint(opt->rect.width(), linebot);
- linetop = linebot + 5;
- } else {
- // just dotlinery
- dotlines[c++] = QPoint(bx+1, linebot);
- dotlines[c++] = QPoint(opt->rect.width(), linebot);
- }
- y += child.totalHeight;
- }
- ++i;
- }
-
- // Expand line height to edge of rectangle if there's any
- // visible child below
- while (i < lv->items.size() && lv->items.at(i).height <= 0)
- ++i;
- if (i < lv->items.size())
- linebot = opt->rect.height();
-
- if (linetop < linebot) {
- dotlines[c++] = QPoint(bx, linetop);
- dotlines[c++] = QPoint(bx, linebot);
- }
- }
-
- int line; // index into dotlines
- p->setPen(opt->palette.text().color());
- if (opt->subControls & SC_Q3ListViewBranch) for(line = 0; line < c; line += 2) {
- p->drawLine(dotlines[line].x(), dotlines[line].y(),
- dotlines[line+1].x(), dotlines[line+1].y());
- }
- }
- break; }
-
default:
QCommonStyle::drawComplexControl(cc, opt, p, widget);
break;
@@ -2123,20 +1989,6 @@ QMotifStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidge
break;
}
- case SE_Q3DockWindowHandleRect:
- if (const QStyleOptionQ3DockWindow *dw = qstyleoption_cast<const QStyleOptionQ3DockWindow *>(opt)) {
- if (!dw->docked || !dw->closeEnabled)
- rect.setRect(0, 0, opt->rect.width(), opt->rect.height());
- else {
- if (dw->state == State_Horizontal)
- rect.setRect(2, 15, opt->rect.width()-2, opt->rect.height() - 15);
- else
- rect.setRect(0, 2, opt->rect.width() - 15, opt->rect.height() - 2);
- }
- rect = visualRect(dw->direction, dw->rect, rect);
- }
- break;
-
case SE_ProgressBarLabel:
case SE_ProgressBarGroove:
case SE_ProgressBarContents:
diff --git a/src/widgets/styles/qplastiquestyle.cpp b/src/widgets/styles/qplastiquestyle.cpp
index 79893f066d..0bf443fe00 100644
--- a/src/widgets/styles/qplastiquestyle.cpp
+++ b/src/widgets/styles/qplastiquestyle.cpp
@@ -5631,8 +5631,7 @@ void QPlastiqueStyle::polish(QWidget *widget)
if (widget->inherits("QWorkspaceTitleBar")
|| widget->inherits("QDockSeparator")
- || widget->inherits("QDockWidgetSeparator")
- || widget->inherits("Q3DockWindowResizeHandle")) {
+ || widget->inherits("QDockWidgetSeparator")) {
widget->setAttribute(Qt::WA_Hover);
}
@@ -5687,8 +5686,7 @@ void QPlastiqueStyle::unpolish(QWidget *widget)
if (widget->inherits("QWorkspaceTitleBar")
|| widget->inherits("QDockSeparator")
- || widget->inherits("QDockWidgetSeparator")
- || widget->inherits("Q3DockWindowResizeHandle")) {
+ || widget->inherits("QDockWidgetSeparator")) {
widget->setAttribute(Qt::WA_Hover, false);
}
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index db387fecec..d78a2ee2fb 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -596,8 +596,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value PE_IndicatorCheckBox On/off indicator, for example, a QCheckBox.
\value PE_IndicatorRadioButton Exclusive on/off indicator, for example, a QRadioButton.
- \value PE_Q3DockWindowSeparator Item separator for Qt 3 compatible dock window
- and toolbar contents.
\value PE_IndicatorDockWidgetResizeHandle Resize handle for dock windows.
\value PE_Frame Generic frame
@@ -619,16 +617,10 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value PE_FrameWindow Frame around a MDI window or a docking window.
- \value PE_Q3Separator Qt 3 compatible generic separator.
-
\value PE_IndicatorMenuCheckMark Check mark used in a menu.
\value PE_IndicatorProgressChunk Section of a progress bar indicator; see also QProgressBar.
- \value PE_Q3CheckListController Qt 3 compatible controller part of a list view item.
- \value PE_Q3CheckListIndicator Qt 3 compatible checkbox part of a list view item.
- \value PE_Q3CheckListExclusiveIndicator Qt 3 compatible radio button part of a list view item.
-
\value PE_IndicatorBranch Lines used to represent the branch of a tree in a tree view.
\value PE_IndicatorToolBarHandle The handle of a toolbar.
\value PE_IndicatorToolBarSeparator The separator in a toolbar.
@@ -740,9 +732,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\row \li \l State_On \li Indicates the indicator is checked.
\row \li \l PE_IndicatorRadioButton \li \l QStyleOptionButton
\li \l State_On \li Indicates that a radio button is selected.
- \row \li{1,3} \l PE_Q3CheckListExclusiveIndicator, \l PE_Q3CheckListIndicator
- \li{1,3} \l QStyleOptionQ3ListView \li \l State_On
- \li Indicates whether or not the controller is selected.
\row \li \l State_NoChange \li Indicates a "tri-state" controller.
\row \li \l State_Enabled \li Indicates the controller is enabled.
\row \li{1,4} \l PE_IndicatorBranch \li{1,4} \l QStyleOption
@@ -760,9 +749,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\row \li \l PE_IndicatorToolBarHandle \li \l QStyleOption
\li \l State_Horizontal \li Indicates that the window handle is horizontal
instead of vertical.
- \row \li \l PE_Q3DockWindowSeparator \li \l QStyleOption
- \li \l State_Horizontal \li Indicates that the separator is horizontal
- instead of vertical.
\row \li \l PE_IndicatorSpinPlus, \l PE_IndicatorSpinMinus, \l PE_IndicatorSpinUp,
\l PE_IndicatorSpinDown,
\li \l QStyleOptionSpinBox
@@ -826,8 +812,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value CE_MenuHMargin The horizontal extra space on the left/right of a menu.
\value CE_MenuVMargin The vertical extra space on the top/bottom of a menu.
- \value CE_Q3DockWindowEmptyArea The empty area of a QDockWidget.
-
\value CE_ToolBoxTab The toolbox's tab and label within a QToolBox.
\value CE_SizeGrip Window resize handle; see also QSizeGrip.
@@ -988,22 +972,11 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SE_SpinBoxLayoutItem Area that counts for the parent layout.
- \value SE_Q3DockWindowHandleRect Area for the tear-off handle.
-
\value SE_ProgressBarGroove Area for the groove.
\value SE_ProgressBarContents Area for the progress indicator.
\value SE_ProgressBarLabel Area for the text label.
\value SE_ProgressBarLayoutItem Area that counts for the parent layout.
- \omitvalue SE_DialogButtonAccept
- \omitvalue SE_DialogButtonReject
- \omitvalue SE_DialogButtonApply
- \omitvalue SE_DialogButtonHelp
- \omitvalue SE_DialogButtonAll
- \omitvalue SE_DialogButtonRetry
- \omitvalue SE_DialogButtonAbort
- \omitvalue SE_DialogButtonIgnore
- \omitvalue SE_DialogButtonCustom
\omitvalue SE_ViewItemCheckIndicator
\value SE_FrameContents Area for a frame's contents.
@@ -1087,7 +1060,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\row \li \l SE_RadioButtonContents \li \l QStyleOptionButton
\row \li \l SE_RadioButtonFocusRect \li \l QStyleOptionButton
\row \li \l SE_ComboBoxFocusRect \li \l QStyleOptionComboBox
- \row \li \l SE_Q3DockWindowHandleRect \li \l QStyleOptionQ3DockWindow
\row \li \l SE_ProgressBarGroove \li \l QStyleOptionProgressBar
\row \li \l SE_ProgressBarContents \li \l QStyleOptionProgressBar
\row \li \l SE_ProgressBarLabel \li \l QStyleOptionProgressBar
@@ -1107,7 +1079,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value CC_Slider A slider, like QSlider.
\value CC_ToolButton A tool button, like QToolButton.
\value CC_TitleBar A Title bar, like those used in QMdiSubWindow.
- \value CC_Q3ListView Used for drawing the Q3ListView class.
\value CC_GroupBox A group box, like QGroupBox.
\value CC_Dial A dial, like QDial.
\value CC_MdiControls The minimize, close, and normal
@@ -1157,7 +1128,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SC_ToolButton Tool button (see also QToolButton).
\value SC_ToolButtonMenu Sub-control for opening a popup menu in a
- tool button; see also Q3PopupMenu.
+ tool button.
\value SC_TitleBarSysMenu System menu button (i.e., restore, close, etc.).
\value SC_TitleBarMinButton Minimize button.
@@ -1169,9 +1140,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SC_TitleBarUnshadeButton Unshade button.
\value SC_TitleBarContextHelpButton Context Help button.
- \value SC_Q3ListView The list view area.
- \value SC_Q3ListViewExpand Expand item (i.e., show/hide child items).
-
\value SC_DialHandle The handle of the dial (i.e. what you use to control the dial).
\value SC_DialGroove The groove for the dial.
\value SC_DialTickmarks The tickmarks for the dial.
@@ -1189,7 +1157,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
in the menu bar.
\value SC_All Special value that matches all sub-controls.
- \omitvalue SC_Q3ListViewBranch
\omitvalue SC_CustomBase
\sa ComplexControl
@@ -1257,9 +1224,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\row \li \l{CC_TitleBar} \li \l QStyleOptionTitleBar
\li \l State_Enabled \li Set if the title bar is enabled.
- \row \li \l{CC_Q3ListView} \li \l QStyleOptionQ3ListView
- \li \l State_Enabled \li Set if the list view is enabled.
-
\endtable
\sa drawPrimitive(), drawControl()
@@ -1418,11 +1382,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value PM_MenuTearoffHeight Height of a tear off area in a QMenu.
\value PM_MenuDesktopFrameWidth The frame width for the menu on the desktop.
- \value PM_CheckListButtonSize Area (width/height) of the
- checkbox/radio button in a Q3CheckListItem.
- \value PM_CheckListControllerSize Area (width/height) of the
- controller in a Q3CheckListItem.
-
\omitvalue PM_DialogButtonsSeparator
\omitvalue PM_DialogButtonsButtonWidth
\omitvalue PM_DialogButtonsButtonHeight
@@ -1520,11 +1479,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value CT_CheckBox A check box, like QCheckBox.
\value CT_ComboBox A combo box, like QComboBox.
\omitvalue CT_DialogButtons
- \value CT_Q3DockWindow A Q3DockWindow.
\value CT_HeaderSection A header section, like QHeader.
\value CT_LineEdit A line edit, like QLineEdit.
\value CT_Menu A menu, like QMenu.
- \value CT_Q3Header A Qt 3 header section, like Q3Header.
\value CT_MenuBar A menu bar, like QMenuBar.
\value CT_MenuBarItem A menu bar item, like the buttons in a QMenuBar.
\value CT_MenuItem A menu item, like QMenuItem.
@@ -1575,7 +1532,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\row \li \l CT_ToolButton \li \l QStyleOptionToolButton
\row \li \l CT_ComboBox \li \l QStyleOptionComboBox
\row \li \l CT_Splitter \li \l QStyleOption
- \row \li \l CT_Q3DockWindow \li \l QStyleOptionQ3DockWindow
\row \li \l CT_ProgressBar \li \l QStyleOptionProgressBar
\row \li \l CT_MenuItem \li \l QStyleOptionMenuItem
\endtable
@@ -1712,7 +1668,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SH_TabBar_SelectMouseType Which type of mouse event should
cause a tab to be selected.
- \value SH_Q3ListViewExpand_SelectMouseType Which type of mouse event should
+ \value SH_ListViewExpand_SelectMouseType Which type of mouse event should
cause a list view expansion to be selected.
\value SH_TabBar_PreferNoArrows Whether a tab bar should suggest a size
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index a8ec8c8c3e..985e7a88aa 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -136,12 +136,6 @@ public:
enum PrimitiveElement {
- PE_Q3CheckListController,
- PE_Q3CheckListExclusiveIndicator,
- PE_Q3CheckListIndicator,
- PE_Q3DockWindowSeparator,
- PE_Q3Separator,
-
PE_Frame,
PE_FrameDefaultButton,
PE_FrameDockWidget,
@@ -243,7 +237,6 @@ public:
CE_HeaderSection,
CE_HeaderLabel,
- CE_Q3DockWindowEmptyArea,
CE_ToolBoxTab,
CE_SizeGrip,
CE_Splitter,
@@ -297,23 +290,10 @@ public:
SE_SliderFocusRect,
- SE_Q3DockWindowHandleRect,
-
SE_ProgressBarGroove,
SE_ProgressBarContents,
SE_ProgressBarLabel,
- // ### Qt 5: These values are unused; eliminate them
- SE_DialogButtonAccept,
- SE_DialogButtonReject,
- SE_DialogButtonApply,
- SE_DialogButtonHelp,
- SE_DialogButtonAll,
- SE_DialogButtonAbort,
- SE_DialogButtonIgnore,
- SE_DialogButtonRetry,
- SE_DialogButtonCustom,
-
SE_ToolBoxTabContents,
SE_HeaderLabel,
@@ -383,7 +363,6 @@ public:
CC_Slider,
CC_ToolButton,
CC_TitleBar,
- CC_Q3ListView,
CC_Dial,
CC_GroupBox,
CC_MdiControls,
@@ -431,10 +410,6 @@ public:
SC_TitleBarContextHelpButton = 0x00000080,
SC_TitleBarLabel = 0x00000100,
- SC_Q3ListView = 0x00000001,
- SC_Q3ListViewBranch = 0x00000002,
- SC_Q3ListViewExpand = 0x00000004,
-
SC_DialGroove = 0x00000001,
SC_DialHandle = 0x00000002,
SC_DialTickmarks = 0x00000004,
@@ -514,8 +489,6 @@ public:
PM_IndicatorHeight,
PM_ExclusiveIndicatorWidth,
PM_ExclusiveIndicatorHeight,
- PM_CheckListButtonSize,
- PM_CheckListControllerSize,
PM_DialogButtonsSeparator,
PM_DialogButtonsButtonWidth,
@@ -596,7 +569,6 @@ public:
CT_ToolButton,
CT_ComboBox,
CT_Splitter,
- CT_Q3DockWindow,
CT_ProgressBar,
CT_MenuItem,
CT_MenuBarItem,
@@ -605,7 +577,6 @@ public:
CT_TabBarTab,
CT_Slider,
CT_ScrollBar,
- CT_Q3Header,
CT_LineEdit,
CT_SpinBox,
CT_SizeGrip,
@@ -669,7 +640,7 @@ public:
SH_ToolBox_SelectedPageTitleBold,
SH_TabBar_PreferNoArrows,
SH_ScrollBar_LeftClickAbsolutePosition,
- SH_Q3ListViewExpand_SelectMouseType,
+ SH_ListViewExpand_SelectMouseType,
SH_UnderlineShortcut,
SH_SpinBox_AnimateButton,
SH_SpinBox_KeyPressAutoRepeatRate,
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index d72ba1bac5..0b0c6e2393 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -136,12 +136,6 @@ QT_BEGIN_NAMESPACE
\value SO_ComplexCustomBase Reserved for custom QStyleOptions;
all custom complex controls values must be above this value
- Some style options are defined for various Qt3Support controls:
-
- \value SO_Q3DockWindow \l QStyleOptionQ3DockWindow
- \value SO_Q3ListView \l QStyleOptionQ3ListView
- \value SO_Q3ListViewItem \l QStyleOptionQ3ListViewItem
-
\sa type
*/
@@ -2233,382 +2227,6 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
#endif // QT_NO_SPINBOX
/*!
- \class QStyleOptionQ3ListViewItem
- \brief The QStyleOptionQ3ListViewItem class is used to describe an
- item drawn in a Q3ListView.
-
- \inmodule QtWidgets
-
- This class is used for drawing the compatibility Q3ListView's
- items. \b {It is not recommended for new classes}.
-
- QStyleOptionQ3ListViewItem contains all the information that
- QStyle functions need to draw the Q3ListView items.
-
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator). This low-level feel
- makes the structures straightforward to use and emphasizes that
- these are simply parameters used by the style functions.
-
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
-
- \sa QStyleOption, QStyleOptionQ3ListView, Q3ListViewItem
-*/
-
-/*!
- \enum QStyleOptionQ3ListViewItem::Q3ListViewItemFeature
-
- This enum describes the features a list view item can have.
-
- \value None A standard item.
- \value Expandable The item has children that can be shown.
- \value MultiLine The item is more than one line tall.
- \value Visible The item is visible.
- \value ParentControl The item's parent is a type of item control (Q3CheckListItem::Controller).
-
- \sa features, Q3ListViewItem::isVisible(), Q3ListViewItem::multiLinesEnabled(),
- Q3ListViewItem::isExpandable()
-*/
-
-/*!
- Constructs a QStyleOptionQ3ListViewItem, initializing the members
- variables to their default values.
-*/
-
-QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem()
- : QStyleOption(Version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
- itemY(0), childCount(0)
-{
-}
-
-/*!
- \internal
-*/
-QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(int version)
- : QStyleOption(version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
- itemY(0), childCount(0)
-{
-}
-
-/*!
- \fn QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other)
-
- Constructs a copy of the \a other style option.
-*/
-
-/*!
- \enum QStyleOptionQ3ListViewItem::StyleOptionType
-
- This enum is used to hold information about the type of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Type The type of style option provided (\l{SO_Q3ListViewItem} for this class).
-
- The type is used internally by QStyleOption, its subclasses, and
- qstyleoption_cast() to determine the type of style option. In
- general you do not need to worry about this unless you want to
- create your own QStyleOption subclass and your own styles.
-
- \sa StyleOptionVersion
-*/
-
-/*!
- \enum QStyleOptionQ3ListViewItem::StyleOptionVersion
-
- This enum is used to hold information about the version of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Version 1
-
- The version is used by QStyleOption subclasses to implement
- extensions without breaking compatibility. If you use
- qstyleoption_cast(), you normally do not need to check it.
-
- \sa StyleOptionType
-*/
-
-/*!
- \variable QStyleOptionQ3ListViewItem::features
- \brief the features for this item
-
- This variable is a bitwise OR of the features of the item. The deafult value is \l None.
-
- \sa Q3ListViewItemFeature
-*/
-
-/*!
- \variable QStyleOptionQ3ListViewItem::height
- \brief the height of the item
-
- This doesn't include the height of the item's children. The default height is 0.
-
- \sa Q3ListViewItem::height()
-*/
-
-/*!
- \variable QStyleOptionQ3ListViewItem::totalHeight
- \brief the total height of the item, including its children
-
- The default total height is 0.
-
- \sa Q3ListViewItem::totalHeight()
-*/
-
-/*!
- \variable QStyleOptionQ3ListViewItem::itemY
- \brief the Y-coordinate for the item
-
- The default value is 0.
-
- \sa Q3ListViewItem::itemPos()
-*/
-
-/*!
- \variable QStyleOptionQ3ListViewItem::childCount
- \brief the number of children the item has
-*/
-
-/*!
- \class QStyleOptionQ3ListView
- \brief The QStyleOptionQ3ListView class is used to describe the
- parameters for drawing a Q3ListView.
-
- \inmodule QtWidgets
-
- This class is used for drawing the compatibility Q3ListView. \b
- {It is not recommended for new classes}.
-
- QStyleOptionQ3ListView contains all the information that QStyle
- functions need to draw Q3ListView.
-
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator). This low-level feel
- makes the structures straightforward to use and emphasizes that
- these are simply parameters used by the style functions.
-
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
-
- \sa QStyleOptionComplex, Q3ListView, QStyleOptionQ3ListViewItem
-*/
-
-/*!
- Creates a QStyleOptionQ3ListView, initializing the members
- variables to their default values.
-*/
-
-QStyleOptionQ3ListView::QStyleOptionQ3ListView()
- : QStyleOptionComplex(Version, SO_Q3ListView), viewportBGRole(QPalette::Base),
- sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false)
-{
-}
-
-/*!
- \internal
-*/
-QStyleOptionQ3ListView::QStyleOptionQ3ListView(int version)
- : QStyleOptionComplex(version, SO_Q3ListView), viewportBGRole(QPalette::Base),
- sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false)
-{
-}
-
-/*!
- \fn QStyleOptionQ3ListView::QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other)
-
- Constructs a copy of the \a other style option.
-*/
-
-/*!
- \enum QStyleOptionQ3ListView::StyleOptionType
-
- This enum is used to hold information about the type of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Type The type of style option provided (\l{SO_Q3ListView} for this class).
-
- The type is used internally by QStyleOption, its subclasses, and
- qstyleoption_cast() to determine the type of style option. In
- general you do not need to worry about this unless you want to
- create your own QStyleOption subclass and your own styles.
-
- \sa StyleOptionVersion
-*/
-
-/*!
- \enum QStyleOptionQ3ListView::StyleOptionVersion
-
- This enum is used to hold information about the version of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Version 1
-
- The version is used by QStyleOption subclasses to implement
- extensions without breaking compatibility. If you use
- qstyleoption_cast(), you normally do not need to check it.
-
- \sa StyleOptionType
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::items
- \brief a list of items in the Q3ListView
-
- This is a list of \l {QStyleOptionQ3ListViewItem}s. The first item
- can be used for most of the calculation that are needed for
- drawing a list view. Any additional items are the children of
- this first item, which may be used for additional information.
-
- \sa QStyleOptionQ3ListViewItem
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::viewportPalette
- \brief the palette of Q3ListView's viewport
-
- By default, the application's default palette is used.
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::viewportBGRole
- \brief the background role of Q3ListView's viewport
-
- The default value is QPalette::Base.
-
- \sa QWidget::backgroundRole()
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::sortColumn
- \brief the sort column of the list view
-
- The default value is 0.
-
- \sa Q3ListView::sortColumn()
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::itemMargin
- \brief the margin for items in the list view
-
- The default value is 0.
-
- \sa Q3ListView::itemMargin()
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::treeStepSize
- \brief the number of pixel to offset children items from their
- parents
-
- The default value is 0.
-
- \sa Q3ListView::treeStepSize()
-*/
-
-/*!
- \variable QStyleOptionQ3ListView::rootIsDecorated
- \brief whether root items are decorated
-
- The default value is false.
-
- \sa Q3ListView::rootIsDecorated()
-*/
-
-/*!
- \class QStyleOptionQ3DockWindow
- \brief The QStyleOptionQ3DockWindow class is used to describe the
- parameters for drawing various parts of a Q3DockWindow.
-
- \inmodule QtWidgets
-
- This class is used for drawing the old Q3DockWindow and its
- parts. \b {It is not recommended for new classes}.
-
- QStyleOptionQ3DockWindow contains all the information that QStyle
- functions need to draw Q3DockWindow and its parts.
-
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator). This low-level feel
- makes the structures straightforward to use and emphasizes that
- these are simply parameters used by the style functions.
-
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
-
- \sa QStyleOption, Q3DockWindow
-*/
-
-/*!
- Constructs a QStyleOptionQ3DockWindow, initializing the member
- variables to their default values.
-*/
-
-QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow()
- : QStyleOption(Version, SO_Q3DockWindow), docked(false), closeEnabled(false)
-{
-}
-
-/*!
- \internal
-*/
-QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(int version)
- : QStyleOption(version, SO_Q3DockWindow), docked(false), closeEnabled(false)
-{
-}
-
-/*!
- \fn QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other)
-
- Constructs a copy of the \a other style option.
-*/
-
-/*!
- \enum QStyleOptionQ3DockWindow::StyleOptionType
-
- This enum is used to hold information about the type of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Type The type of style option provided (\l{SO_Q3DockWindow} for this class).
-
- The type is used internally by QStyleOption, its subclasses, and
- qstyleoption_cast() to determine the type of style option. In
- general you do not need to worry about this unless you want to
- create your own QStyleOption subclass and your own styles.
-
- \sa StyleOptionVersion
-*/
-
-/*!
- \enum QStyleOptionQ3DockWindow::StyleOptionVersion
-
- This enum is used to hold information about the version of the style option, and
- is defined for each QStyleOption subclass.
-
- \value Version 1
-
- The version is used by QStyleOption subclasses to implement
- extensions without breaking compatibility. If you use
- qstyleoption_cast(), you normally do not need to check it.
-
- \sa StyleOptionType
-*/
-
-/*!
- \variable QStyleOptionQ3DockWindow::docked
- \brief whether the dock window is currently docked
-
- The default value is false.
-*/
-
-/*!
- \variable QStyleOptionQ3DockWindow::closeEnabled
- \brief whether the dock window has a close button
-
- The default value is false.
-*/
-
-/*!
\class QStyleOptionDockWidget
\brief The QStyleOptionDockWidget class is used to describe the
parameters for drawing a dock widget.
@@ -4376,12 +3994,8 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
debug << "SO_ToolBox"; break;
case QStyleOption::SO_Header:
debug << "SO_Header"; break;
- case QStyleOption::SO_Q3DockWindow:
- debug << "SO_Q3DockWindow"; break;
case QStyleOption::SO_DockWidget:
debug << "SO_DockWidget"; break;
- case QStyleOption::SO_Q3ListViewItem:
- debug << "SO_Q3ListViewItem"; break;
case QStyleOption::SO_ViewItem:
debug << "SO_ViewItem"; break;
case QStyleOption::SO_TabWidgetFrame:
@@ -4400,8 +4014,6 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
debug << "SO_ToolButton"; break;
case QStyleOption::SO_ComboBox:
debug << "SO_ComboBox"; break;
- case QStyleOption::SO_Q3ListView:
- debug << "SO_Q3ListView"; break;
case QStyleOption::SO_TitleBar:
debug << "SO_TitleBar"; break;
case QStyleOption::SO_CustomBase:
diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
index 677a48ec20..588898637f 100644
--- a/src/widgets/styles/qstyleoption.h
+++ b/src/widgets/styles/qstyleoption.h
@@ -68,12 +68,12 @@ class Q_WIDGETS_EXPORT QStyleOption
public:
enum OptionType {
SO_Default, SO_FocusRect, SO_Button, SO_Tab, SO_MenuItem,
- SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header, SO_Q3DockWindow,
- SO_DockWidget, SO_Q3ListViewItem, SO_ViewItem, SO_TabWidgetFrame,
+ SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header,
+ SO_DockWidget, SO_ViewItem, SO_TabWidgetFrame,
SO_TabBarBase, SO_RubberBand, SO_ToolBar, SO_GraphicsItem,
SO_Complex = 0xf0000, SO_Slider, SO_SpinBox, SO_ToolButton, SO_ComboBox,
- SO_Q3ListView, SO_TitleBar, SO_GroupBox, SO_SizeGrip,
+ SO_TitleBar, SO_GroupBox, SO_SizeGrip,
SO_CustomBase = 0xf00,
SO_ComplexCustomBase = 0xf000000
@@ -363,47 +363,6 @@ protected:
QStyleOptionMenuItem(int version);
};
-class Q_WIDGETS_EXPORT QStyleOptionQ3ListViewItem : public QStyleOption
-{
-public:
- enum StyleOptionType { Type = SO_Q3ListViewItem };
- enum StyleOptionVersion { Version = 1 };
-
- enum Q3ListViewItemFeature { None = 0x00, Expandable = 0x01, MultiLine = 0x02, Visible = 0x04,
- ParentControl = 0x08 };
- Q_DECLARE_FLAGS(Q3ListViewItemFeatures, Q3ListViewItemFeature)
-
- Q3ListViewItemFeatures features;
- int height;
- int totalHeight;
- int itemY;
- int childCount;
-
- QStyleOptionQ3ListViewItem();
- QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other) : QStyleOption(Version, Type) { *this = other; }
-
-protected:
- QStyleOptionQ3ListViewItem(int version);
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionQ3ListViewItem::Q3ListViewItemFeatures)
-
-class Q_WIDGETS_EXPORT QStyleOptionQ3DockWindow : public QStyleOption
-{
-public:
- enum StyleOptionType { Type = SO_Q3DockWindow };
- enum StyleOptionVersion { Version = 1 };
-
- bool docked;
- bool closeEnabled;
-
- QStyleOptionQ3DockWindow();
- QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other) : QStyleOption(Version, Type) { *this = other; }
-
-protected:
- QStyleOptionQ3DockWindow(int version);
-};
-
class Q_WIDGETS_EXPORT QStyleOptionDockWidget : public QStyleOption
{
public:
@@ -585,27 +544,6 @@ protected:
};
#endif // QT_NO_SPINBOX
-class Q_WIDGETS_EXPORT QStyleOptionQ3ListView : public QStyleOptionComplex
-{
-public:
- enum StyleOptionType { Type = SO_Q3ListView };
- enum StyleOptionVersion { Version = 1 };
-
- QList<QStyleOptionQ3ListViewItem> items;
- QPalette viewportPalette;
- QPalette::ColorRole viewportBGRole;
- int sortColumn;
- int itemMargin;
- int treeStepSize;
- bool rootIsDecorated;
-
- QStyleOptionQ3ListView();
- QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other) : QStyleOptionComplex(Version, Type) { *this = other; }
-
-protected:
- QStyleOptionQ3ListView(int version);
-};
-
class Q_WIDGETS_EXPORT QStyleOptionToolButton : public QStyleOptionComplex
{
public:
diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp
index 5bd2de290a..49d4e74aaf 100644
--- a/src/widgets/styles/qwindowscestyle.cpp
+++ b/src/widgets/styles/qwindowscestyle.cpp
@@ -264,14 +264,13 @@ void QWindowsCEStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
option->rect.x() + 1, option->rect.y() + option->rect.height() - 1);
//fall through...
}
- case PE_IndicatorViewItemCheck:
- case PE_Q3CheckListIndicator: {
+ case PE_IndicatorViewItemCheck: {
if (!doRestore) {
painter->save();
doRestore = true;
}
int arrowSize= 2;
- if (element == PE_Q3CheckListIndicator || element == PE_IndicatorViewItemCheck) {
+ if (element == PE_IndicatorViewItemCheck) {
QLinearGradient linearGradient(QPoint(option->rect.x(),option->rect.y()), QPoint(option->rect.x()+option->rect.width(),
option->rect.y()+option->rect.height()));
linearGradient.setColorAt(0, windowsCECheckBoxGradientColorBegin);
diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp
index 30269751ca..863bd1aa62 100644
--- a/src/widgets/styles/qwindowsmobilestyle.cpp
+++ b/src/widgets/styles/qwindowsmobilestyle.cpp
@@ -4875,13 +4875,12 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp
}
//fall through...
}
- case PE_IndicatorViewItemCheck:
- case PE_Q3CheckListIndicator: {
+ case PE_IndicatorViewItemCheck: {
if (!doRestore) {
painter->save();
doRestore = true;
}
- if (element == PE_Q3CheckListIndicator || element == PE_IndicatorViewItemCheck) {
+ if (element == PE_IndicatorViewItemCheck) {
painter->setPen(option->palette.shadow().color());
if (option->state & State_NoChange)
painter->setBrush(option->palette.brush(QPalette::Button));
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 1cd53c8073..97721da297 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -1461,12 +1461,11 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
p->setPen(opt->palette.text().color());
} // Fall through!
case PE_IndicatorViewItemCheck:
- case PE_Q3CheckListIndicator:
if (!doRestore) {
p->save();
doRestore = true;
}
- if (pe == PE_Q3CheckListIndicator || pe == PE_IndicatorViewItemCheck) {
+ if (pe == PE_IndicatorViewItemCheck) {
const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
p->setPen(itemViewOpt
&& itemViewOpt->showDecorationSelected
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index f40bd22fca..aa68d4c31b 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -1178,8 +1178,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
|| qobject_cast<QAbstractSpinBox*>(widget)
|| qobject_cast<QSpinBox*>(widget)
#endif // QT_NO_SPINBOX
- || widget->inherits("QWorkspaceChild")
- || widget->inherits("Q3TitleBar"))
+ || widget->inherits("QWorkspaceChild"))
widget->setAttribute(Qt::WA_Hover);
#ifndef QT_NO_RUBBERBAND
@@ -1250,8 +1249,7 @@ void QWindowsXPStyle::unpolish(QWidget *widget)
|| qobject_cast<QAbstractSpinBox*>(widget)
|| qobject_cast<QSpinBox*>(widget)
#endif // QT_NO_SPINBOX
- || widget->inherits("QWorkspaceChild")
- || widget->inherits("Q3TitleBar"))
+ || widget->inherits("QWorkspaceChild"))
widget->setAttribute(Qt::WA_Hover, false);
QWindowsStyle::unpolish(widget);
}
@@ -1822,14 +1820,6 @@ case PE_Frame:
}
break;
- case PE_Q3DockWindowSeparator:
- name = QLatin1String("TOOLBAR");
- if (flags & State_Horizontal)
- partId = TP_SEPARATOR;
- else
- partId = TP_SEPARATORVERT;
- break;
-
case PE_FrameWindow:
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option))
{
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index a960ce8d9c..dc96321599 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -1489,6 +1489,16 @@ void QAbstractScrollArea::setupViewport(QWidget *viewport)
Q_UNUSED(viewport);
}
+/*!
+ \internal
+
+ This method is reserved for future use.
+*/
+QSize QAbstractScrollArea::viewportSizeHint() const
+{
+ return QSize();
+}
+
QT_END_NAMESPACE
#include "moc_qabstractscrollarea.cpp"
diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h
index f155f52920..2f1168a4f1 100644
--- a/src/widgets/widgets/qabstractscrollarea.h
+++ b/src/widgets/widgets/qabstractscrollarea.h
@@ -122,6 +122,8 @@ protected:
virtual void scrollContentsBy(int dx, int dy);
+ virtual QSize viewportSizeHint() const;
+
private:
Q_DECLARE_PRIVATE(QAbstractScrollArea)
Q_DISABLE_COPY(QAbstractScrollArea)
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index 9a57175716..ffb8503d5e 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -168,8 +168,8 @@ public:
bool event(QEvent *event);
Q_SIGNALS:
- void dateTimeChanged(const QDateTime &date);
- void timeChanged(const QTime &date);
+ void dateTimeChanged(const QDateTime &dateTime);
+ void timeChanged(const QTime &time);
void dateChanged(const QDate &date);
public Q_SLOTS:
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 1fa7195170..e4e6390a9d 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -190,7 +190,6 @@ private:
friend class QMenuBar;
friend class QMenuBarPrivate;
friend class QTornOffMenu;
- friend class Q3PopupMenu;
friend class QComboBox;
friend class QAction;
friend class QToolButtonPrivate;
diff --git a/src/widgets/widgets/qstackedwidget.cpp b/src/widgets/widgets/qstackedwidget.cpp
index 9617d6de58..5406f5dcf5 100644
--- a/src/widgets/widgets/qstackedwidget.cpp
+++ b/src/widgets/widgets/qstackedwidget.cpp
@@ -49,54 +49,12 @@
QT_BEGIN_NAMESPACE
-/**
- QStackedLayout does not support height for width (simply because it does not reimplement
- heightForWidth() and hasHeightForWidth()). That is not possible to fix without breaking
- binary compatibility. (QLayout is subject to multiple inheritance).
- However, we can fix QStackedWidget by simply using a modified version of QStackedLayout
- that reimplements the hfw-related functions:
- */
-class QStackedLayoutHFW : public QStackedLayout
-{
-public:
- QStackedLayoutHFW(QWidget *parent = 0) : QStackedLayout(parent) {}
- bool hasHeightForWidth() const;
- int heightForWidth(int width) const;
-};
-
-bool QStackedLayoutHFW::hasHeightForWidth() const
-{
- const int n = count();
-
- for (int i = 0; i < n; ++i) {
- if (QLayoutItem *item = itemAt(i)) {
- if (item->hasHeightForWidth())
- return true;
- }
- }
- return false;
-}
-
-int QStackedLayoutHFW::heightForWidth(int width) const
-{
- const int n = count();
-
- int hfw = 0;
- for (int i = 0; i < n; ++i) {
- if (QLayoutItem *item = itemAt(i)) {
- hfw = qMax(hfw, item->heightForWidth(width));
- }
- }
- return hfw;
-}
-
-
class QStackedWidgetPrivate : public QFramePrivate
{
Q_DECLARE_PUBLIC(QStackedWidget)
public:
QStackedWidgetPrivate():layout(0){}
- QStackedLayoutHFW *layout;
+ QStackedLayout *layout;
bool blockChildAdd;
};
@@ -180,7 +138,7 @@ QStackedWidget::QStackedWidget(QWidget *parent)
: QFrame(*new QStackedWidgetPrivate, parent)
{
Q_D(QStackedWidget);
- d->layout = new QStackedLayoutHFW(this);
+ d->layout = new QStackedLayout(this);
connect(d->layout, SIGNAL(widgetRemoved(int)), this, SIGNAL(widgetRemoved(int)));
connect(d->layout, SIGNAL(currentChanged(int)), this, SIGNAL(currentChanged(int)));
}
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 8263bf8546..7b5b3b6559 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -429,7 +429,7 @@ void QTabBarPrivate::layoutTabs()
tabList[i].maxRect = QRect(x, 0, sz.width(), sz.height());
x += sz.width();
maxHeight = qMax(maxHeight, sz.height());
- sz = minimumTabSizeHint(i);
+ sz = q->minimumTabSizeHint(i);
tabList[i].minRect = QRect(minx, 0, sz.width(), sz.height());
minx += sz.width();
tabChain[tabChainIndex].init();
@@ -454,7 +454,7 @@ void QTabBarPrivate::layoutTabs()
tabList[i].maxRect = QRect(0, y, sz.width(), sz.height());
y += sz.height();
maxWidth = qMax(maxWidth, sz.width());
- sz = minimumTabSizeHint(i);
+ sz = q->minimumTabSizeHint(i);
tabList[i].minRect = QRect(0, miny, sz.width(), sz.height());
miny += sz.height();
tabChain[tabChainIndex].init();
@@ -1296,14 +1296,18 @@ static QString computeElidedText(Qt::TextElideMode mode, const QString &text)
return ret;
}
-QSize QTabBarPrivate::minimumTabSizeHint(int index)
+/*!
+ Returns the minimum tab size hint for the tab at position \a index.
+ \since Qt 5.0
+*/
+
+QSize QTabBar::minimumTabSizeHint(int index) const
{
- Q_Q(QTabBar);
- // ### Qt 5: make this a protected virtual function in QTabBar
- Tab &tab = tabList[index];
+ Q_D(const QTabBar);
+ QTabBarPrivate::Tab &tab = const_cast<QTabBarPrivate::Tab&>(d->tabList[index]);
QString oldText = tab.text;
- tab.text = computeElidedText(elideMode, oldText);
- QSize size = q->tabSizeHint(index);
+ tab.text = computeElidedText(d->elideMode, oldText);
+ QSize size = tabSizeHint(index);
tab.text = oldText;
return size;
}
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index 85586f5e57..2698213d07 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -178,6 +178,7 @@ Q_SIGNALS:
protected:
virtual QSize tabSizeHint(int index) const;
+ virtual QSize minimumTabSizeHint(int index) const;
virtual void tabInserted(int index);
virtual void tabRemoved(int index);
virtual void tabLayoutChange();
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index c907b48eeb..aa9db38677 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -165,8 +165,6 @@ public:
inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); }
void setCurrentNextEnabledIndex(int offset);
- QSize minimumTabSizeHint(int index);
-
QToolButton* rightB; // right or bottom
QToolButton* leftB; // left or top
diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h
index 26d9243eb9..4e8d4d4583 100644
--- a/src/widgets/widgets/qtabwidget.h
+++ b/src/widgets/widgets/qtabwidget.h
@@ -175,7 +175,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_removeTab(int))
Q_PRIVATE_SLOT(d_func(), void _q_tabMoved(int, int))
void setUpLayout(bool = false);
- friend class Q3TabDialog;
};
#endif // QT_NO_TABWIDGET