Convert features.treeview to QT_[REQUIRE_]CONFIG
Change-Id: I4a036a0410615ac563b17f7715c47acccb8abfca Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
a23568be6c
commit
773178900f
|
|
@ -53,7 +53,6 @@
|
|||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qtreeview.h>
|
||||
#include <private/qtabbar_p.h>
|
||||
#include <QAbstractScrollArea>
|
||||
#include <QScrollArea>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -45,11 +45,10 @@
|
|||
|
||||
class tst_QTreeView;
|
||||
|
||||
QT_REQUIRE_CONFIG(treeview);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_TREEVIEW
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@
|
|||
#include <QComboBox>
|
||||
#include <QAbstractItemView>
|
||||
#include <QListView>
|
||||
#include <QTreeView>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QAbstractScrollArea>
|
||||
#include <QScrollBar>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue