summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-12 14:11:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-12 14:11:54 (GMT)
commit068551cfb24c9cd3606ef698cfcc2403c44469fc (patch)
tree20e88eddaaca7dc6bfb62be5339432d2237f4afc /Source/QtDialog/QCMakeCacheView.cxx
parentd55ab3526c57d2dbe9d9950516d7a01b9e49216c (diff)
parent4037beb7477590569ef5290f34103a7015450fe0 (diff)
downloadCMake-068551cfb24c9cd3606ef698cfcc2403c44469fc.zip
CMake-068551cfb24c9cd3606ef698cfcc2403c44469fc.tar.gz
CMake-068551cfb24c9cd3606ef698cfcc2403c44469fc.tar.bz2
Merge topic 'cmake-gui-qt5-only'
4037beb747 QtDialog: remove Qt4 definition ce9dbceb42 QtDialog: remove Qt4-only code 8ea50749da QtDialog: use Qt5's imported targets 4ccc9921be QtDialog: use qt5 functions for special Qt sources e4d6015460 QtDialog: remove Qt4 support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4836
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx33
1 files changed, 1 insertions, 32 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 541d3e9..928494b 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -155,11 +155,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
void QCMakeCacheView::setShowAdvanced(bool s)
{
-#if QT_VERSION >= 040300
- // new 4.3 API that needs to be called. what about an older Qt?
this->SearchFilter->invalidate();
-#endif
-
this->AdvancedFilter->setShowAdvanced(s);
}
@@ -209,9 +205,7 @@ void QCMakeCacheModel::clear()
void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->beginResetModel();
-#endif
QSet<QCMakeProperty> newProps;
QSet<QCMakeProperty> newProps2;
@@ -334,11 +328,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
}
this->blockSignals(b);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->endResetModel();
-#else
- this->reset();
-#endif
}
QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const
@@ -348,9 +338,7 @@ QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const
void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->beginResetModel();
-#endif
this->View = t;
@@ -367,11 +355,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
this->setProperties(oldProps);
this->setProperties(props);
this->blockSignals(b);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->endResetModel();
-#else
- this->reset();
-#endif
}
void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
@@ -497,8 +481,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
// go to the next in the tree
while (!idxs.isEmpty() &&
(
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && \
- QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
+#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
(idxs.last().row() + 1) >= rowCount(idxs.last().parent()) ||
#endif
!idxs.last().sibling(idxs.last().row() + 1, 0).isValid())) {
@@ -658,20 +641,6 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e,
return success;
}
-// Issue 205903 fixed in Qt 4.5.0.
-// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
-bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
-{
- // workaround for what looks like a bug in Qt on macOS
- // where it doesn't create a QWidget wrapper for the native file dialog
- // so the Qt library ends up assuming the focus was lost to something else
-
- if (evt->type() == QEvent::FocusOut && this->FileDialogFlag) {
- return false;
- }
- return QItemDelegate::eventFilter(object, evt);
-}
-
void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
QAbstractItemModel* model,
const QModelIndex& index) const