summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/complexwidgets.cpp1
-rw-r--r--src/widgets/accessible/itemviews.cpp21
-rw-r--r--src/widgets/accessible/itemviews_p.h6
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp6
-rw-r--r--src/widgets/itemviews/itemviews.pri11
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp1
-rw-r--r--src/widgets/itemviews/qtreeview.cpp3
-rw-r--r--src/widgets/itemviews/qtreeview.h7
-rw-r--r--src/widgets/itemviews/qtreeview_p.h4
-rw-r--r--src/widgets/styles/qcommonstyle.cpp5
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm6
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h2
-rw-r--r--src/widgets/styles/qpixmapstyle.cpp1
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p_p.h2
-rw-r--r--src/widgets/util/qcompleter_p.h2
-rw-r--r--src/widgets/widgets/qcombobox.cpp6
16 files changed, 47 insertions, 37 deletions
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index dd9bea1aec..50aba759c3 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -53,7 +53,6 @@
#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
#endif
-#include <qtreeview.h>
#include <private/qtabbar_p.h>
#include <QAbstractScrollArea>
#include <QScrollArea>
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index 87c0a59563..4d1a4589ee 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -44,8 +44,11 @@
#include <qtableview.h>
#endif
#include <qlistview.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
#include <private/qtreeview_p.h>
+#endif
+#include <private/qwidget_p.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -88,7 +91,7 @@ QAccessibleTable::QAccessibleTable(QWidget *w)
m_role = QAccessible::Table;
} else
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (qobject_cast<const QTreeView*>(view())) {
m_role = QAccessible::Tree;
} else
@@ -123,7 +126,7 @@ QHeaderView *QAccessibleTable::horizontalHeader() const
} else if (const QTableView *tv = qobject_cast<const QTableView*>(view())) {
header = tv->horizontalHeader();
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
} else if (const QTreeView *tv = qobject_cast<const QTreeView*>(view())) {
header = tv->header();
#endif
@@ -647,7 +650,7 @@ void QAccessibleTable::modelChange(QAccessibleTableModelChangeEvent *event)
}
}
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
// TREE VIEW
@@ -820,7 +823,7 @@ bool QAccessibleTree::selectRow(int row)
return true;
}
-#endif // QT_NO_TREEVIEW
+#endif // QT_CONFIG(treeview)
// TABLE CELL
@@ -872,7 +875,7 @@ QHeaderView *QAccessibleTableCell::horizontalHeader() const
} else if (const QTableView *tv = qobject_cast<const QTableView*>(view)) {
header = tv->horizontalHeader();
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
} else if (const QTreeView *tv = qobject_cast<const QTreeView*>(view)) {
header = tv->header();
#endif
@@ -898,7 +901,7 @@ int QAccessibleTableCell::columnIndex() const
int QAccessibleTableCell::rowIndex() const
{
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (role() == QAccessible::TreeItem) {
const QTreeView *treeView = qobject_cast<const QTreeView*>(view);
Q_ASSERT(treeView);
@@ -1034,7 +1037,7 @@ QAccessible::State QAccessibleTableCell::state() const
if (view->selectionMode() == QAbstractItemView::ExtendedSelection)
st.extSelectable = true;
}
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (m_role == QAccessible::TreeItem) {
const QTreeView *treeView = qobject_cast<const QTreeView*>(view);
if (treeView->model()->hasChildren(m_index))
@@ -1135,7 +1138,7 @@ QRect QAccessibleTableHeaderCell::rect() const
header = tv->verticalHeader();
}
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
} else if (const QTreeView *tv = qobject_cast<const QTreeView*>(view)) {
header = tv->header();
#endif
@@ -1202,7 +1205,7 @@ QHeaderView *QAccessibleTableHeaderCell::headerView() const
header = tv->verticalHeader();
}
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
} else if (const QTreeView *tv = qobject_cast<const QTreeView*>(view)) {
header = tv->header();
#endif
diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h
index 1b3869f2fa..9542a569db 100644
--- a/src/widgets/accessible/itemviews_p.h
+++ b/src/widgets/accessible/itemviews_p.h
@@ -145,7 +145,7 @@ private:
QAccessible::Role m_role;
};
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
class QAccessibleTree :public QAccessibleTable
{
public:
@@ -223,7 +223,7 @@ private:
void unselectCell();
friend class QAccessibleTable;
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
friend class QAccessibleTree;
#endif
};
@@ -259,7 +259,7 @@ private:
Qt::Orientation orientation;
friend class QAccessibleTable;
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
friend class QAccessibleTree;
#endif
};
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index ccd176cd04..a39674dc7a 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -46,7 +46,9 @@
#include "itemviews_p.h"
#include <qtoolbutton.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
+#endif
#include <qvariant.h>
#include <qaccessible.h>
@@ -140,10 +142,10 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QMenu")) {
iface = new QAccessibleMenu(widget);
#endif
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
} else if (classname == QLatin1String("QTreeView")) {
iface = new QAccessibleTree(widget);
-#endif // QT_NO_TREEVIEW
+#endif // QT_CONFIG(treeview)
#ifndef QT_NO_ITEMVIEWS
} else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) {
iface = new QAccessibleTable(widget);
diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri
index 4101be5631..c68aa590bc 100644
--- a/src/widgets/itemviews/itemviews.pri
+++ b/src/widgets/itemviews/itemviews.pri
@@ -9,8 +9,6 @@ HEADERS += \
itemviews/qlistview.h \
itemviews/qlistview_p.h \
itemviews/qbsptree_p.h \
- itemviews/qtreeview.h \
- itemviews/qtreeview_p.h \
itemviews/qabstractitemdelegate.h \
itemviews/qabstractitemdelegate_p.h \
itemviews/qitemdelegate.h \
@@ -26,7 +24,6 @@ SOURCES += \
itemviews/qheaderview.cpp \
itemviews/qlistview.cpp \
itemviews/qbsptree.cpp \
- itemviews/qtreeview.cpp \
itemviews/qabstractitemdelegate.cpp \
itemviews/qitemdelegate.cpp \
itemviews/qdirmodel.cpp \
@@ -70,6 +67,14 @@ qtConfig(tablewidget) {
SOURCES += itemviews/qtablewidget.cpp
}
+qtConfig(treeview) {
+ HEADERS += \
+ itemviews/qtreeview.h \
+ itemviews/qtreeview_p.h
+
+ SOURCES += itemviews/qtreeview.cpp
+}
+
qtConfig(treewidget) {
HEADERS += \
itemviews/qtreewidget.h \
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index f96bafdb57..396016c44d 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -52,7 +52,6 @@
#include <qdatetime.h>
#include <qlineedit.h>
#include <qspinbox.h>
-#include <qtreeview.h>
#include <qheaderview.h>
#include <qstyleditemdelegate.h>
#include <private/qabstractitemview_p.h>
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index c1647cc2f1..2abb1a9c14 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qtreeview.h"
-#ifndef QT_NO_TREEVIEW
#include <qheaderview.h>
#include <qitemdelegate.h>
#include <qapplication.h>
@@ -3996,5 +3995,3 @@ int QTreeView::visualIndex(const QModelIndex &index) const
QT_END_NAMESPACE
#include "moc_qtreeview.cpp"
-
-#endif // QT_NO_TREEVIEW
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index 3c7cbddfbb..c32c127cd1 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -45,10 +45,9 @@
class tst_QTreeView;
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(treeview);
-#ifndef QT_NO_TREEVIEW
+QT_BEGIN_NAMESPACE
class QTreeViewPrivate;
class QHeaderView;
@@ -237,8 +236,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_sortIndicatorChanged(int column, Qt::SortOrder order))
};
-#endif // QT_NO_TREEVIEW
-
QT_END_NAMESPACE
#endif // QTREEVIEW_H
diff --git a/src/widgets/itemviews/qtreeview_p.h b/src/widgets/itemviews/qtreeview_p.h
index 63af41292b..9a391ee88a 100644
--- a/src/widgets/itemviews/qtreeview_p.h
+++ b/src/widgets/itemviews/qtreeview_p.h
@@ -57,7 +57,7 @@
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qvector.h>
-#ifndef QT_NO_TREEVIEW
+QT_REQUIRE_CONFIG(treeview);
QT_BEGIN_NAMESPACE
@@ -272,6 +272,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_TREEVIEW
-
#endif // QTREEVIEW_P_H
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 56f9bfb3e7..973e89b3ef 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -41,6 +41,7 @@
#include "qcommonstyle_p.h"
#include <qfile.h>
+#include <qabstractitemview.h>
#include <qapplication.h>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h>
@@ -71,7 +72,9 @@
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
+#if QT_CONFIG(treeview)
#include "qtreeview.h"
+#endif
#include <private/qcommonstylepixmaps_p.h>
#include <private/qmath_p.h>
#include <qdebug.h>
@@ -5250,7 +5253,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
break;
#endif
case SH_Widget_Animate:
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (qobject_cast<const QTreeView*>(widget)) {
ret = false;
} else
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 8a6e32105a..99526683dd 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -88,7 +88,9 @@
#include <qstyleoption.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
+#endif
#if QT_CONFIG(tableview)
#include <qtableview.h>
#endif
@@ -420,7 +422,7 @@ static int getControlSize(const QStyleOption *option, const QWidget *widget)
}
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
static inline bool isTreeView(const QWidget *widget)
{
return (widget && widget->parentWidget() &&
@@ -899,7 +901,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
break;
#endif
case QStyle::CT_HeaderSection:
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (isTreeView(widg))
ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricListHeaderHeight));
#endif
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 514cc8a14e..7ff6279284 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -93,7 +93,9 @@
#include <qtextstream.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
+#endif
#if QT_CONFIG(tableview)
#include <qtableview.h>
#endif
diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp
index de99b6ce7b..88482d28c9 100644
--- a/src/widgets/styles/qpixmapstyle.cpp
+++ b/src/widgets/styles/qpixmapstyle.cpp
@@ -55,7 +55,6 @@
#include <QComboBox>
#include <QAbstractItemView>
#include <QListView>
-#include <QTreeView>
#include <QStyledItemDelegate>
#include <QAbstractScrollArea>
#include <QScrollBar>
diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h
index 01fe32c1c6..5d772204a7 100644
--- a/src/widgets/styles/qwindowsvistastyle_p_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p_p.h
@@ -77,7 +77,9 @@
#include <qprogressbar.h>
#include <qdockwidget.h>
#include <qlistview.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
+#endif
#include <qtextedit.h>
#include <qmessagebox.h>
#if QT_CONFIG(dialogbuttonbox)
diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h
index c35f70b451..6629c47e06 100644
--- a/src/widgets/util/qcompleter_p.h
+++ b/src/widgets/util/qcompleter_p.h
@@ -57,7 +57,7 @@
#ifndef QT_NO_COMPLETER
-#include "QtWidgets/qtreeview.h"
+#include "QtWidgets/qabstractitemview.h"
#include "QtCore/qabstractproxymodel.h"
#include "qcompleter.h"
#include "QtWidgets/qitemdelegate.h"
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 84d81fa089..6a8167b5e5 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -56,7 +56,9 @@
#include <qevent.h>
#include <qlayout.h>
#include <qscrollbar.h>
+#if QT_CONFIG(treeview)
#include <qtreeview.h>
+#endif
#include <qheaderview.h>
#include <qmath.h>
#include <qmetaobject.h>
@@ -2602,7 +2604,7 @@ void QComboBox::showPopup()
int count = 0;
QStack<QModelIndex> toCheck;
toCheck.push(view()->rootIndex());
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
QTreeView *treeView = qobject_cast<QTreeView*>(view());
if (treeView && treeView->header() && !treeView->header()->isHidden())
listHeight += treeView->header()->height();
@@ -2614,7 +2616,7 @@ void QComboBox::showPopup()
if (!idx.isValid())
continue;
listHeight += view()->visualRect(idx).height();
-#ifndef QT_NO_TREEVIEW
+#if QT_CONFIG(treeview)
if (d->model->hasChildren(idx) && treeView && treeView->isExpanded(idx))
toCheck.push(idx);
#endif