ADD_DEFINITIONS(${GUI_DEFINITIONS})
# Various
# Qt
- IF (NOT SALOME_GUI_BUILD_WITH_QT5)
- FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
- ELSE()
- FIND_PACKAGE(SalomeQt5 REQUIRED)
- ENDIF()
+ FIND_PACKAGE(SalomeQt5 REQUIRED)
ELSE(EXISTS ${GUI_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
ENDIF(EXISTS ${GUI_ROOT_DIR})
}
aParent->tabifyDockWidget( _dwPattern, _dwGroups );
aParent->tabifyDockWidget( _dwGroups, _dwMesh );
-
-#if QT_VERSION >= 0x040500
aParent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
-#endif
// popup menu on data tree view
_patternDataTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
};
-
-// QAbstractProxyModel::mapSelectionFromSource creates invalid ranges to we filter
-// those out manually in a loop. Hopefully fixed in Qt 4.7.2, so we ifdef it out.
-// http://qt.gitorious.org/qt/qt/merge_requests/2474
-// http://qt.gitorious.org/qt/qt/merge_requests/831
-#if QT_VERSION < 0x040702
-#define RANGE_FIX_HACK
-#endif
-
-#ifdef RANGE_FIX_HACK
-static QItemSelection klink_removeInvalidRanges(const QItemSelection &selection)
-{
-// std::cout<< " klink_removeInvalidRanges " << std::endl;
- QItemSelection result;
- Q_FOREACH(const QItemSelectionRange &range, selection)
- {
-
-// Q_FOREACH(const QModelIndex &i, range.indexes ())
-// {
-//// std::cout<< " =====> " << i.data().toString().toStdString() << std::endl;
-// }
- if (!range.isValid())
- continue;
-// std::cout<< " is VALID !!"<< std::endl;
- result << range;
- }
- return result;
-}
-#endif
-
-
class KLinkItemSelectionModelPrivate
{
public:
Q_Q(KLinkItemSelectionModel);
-#ifdef RANGE_FIX_HACK
-// std::cout<<"XXXXXXXXXXXXX sourceSelectionChanged!!!!!!!! RANGE_FIX_HACK"<<std::endl;
- QItemSelection _selected = klink_removeInvalidRanges(selected);
- QItemSelection _deselected = klink_removeInvalidRanges(deselected);
-#else
-// std::cout<<"XXXXXXXXXXXXX sourceSelectionChanged!!!!!!!! "<<std::endl;
QItemSelection _selected = selected;
QItemSelection _deselected = deselected;
-#endif
Q_ASSERT(assertSelectionValid(_selected));
Q_ASSERT(assertSelectionValid(_deselected));
return selection.indexes().first();
}
-// QAbstractProxyModel::mapSelectionFromSource creates invalid ranges to we filter
-// those out manually in a loop. Hopefully fixed in Qt 4.7.2, so we ifdef it out.
-// http://qt.gitorious.org/qt/qt/merge_requests/2474
-// http://qt.gitorious.org/qt/qt/merge_requests/831
-#if QT_VERSION < 0x040702
-#define RANGE_FIX_HACK
-#endif
-
-#ifdef RANGE_FIX_HACK
-static QItemSelection removeInvalidRanges(const QItemSelection &selection)
-{
- QItemSelection result;
- Q_FOREACH(const QItemSelectionRange &range, selection)
- {
- if (!range.isValid())
- continue;
- result << range;
- }
- return result;
-}
-#endif
-
QItemSelection KModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelection& selection) const
{
Q_D(const KModelIndexProxyMapper);
return QItemSelection();
seekSelection = proxy.data()->mapSelectionToSource(seekSelection);
-#ifdef RANGE_FIX_HACK
- seekSelection = removeInvalidRanges(seekSelection);
-#endif
Q_ASSERT(d->assertSelectionValid(seekSelection));
}
return QItemSelection();
seekSelection = proxy.data()->mapSelectionFromSource(seekSelection);
-#ifdef RANGE_FIX_HACK
- seekSelection = removeInvalidRanges(seekSelection);
-#endif
Q_ASSERT(d->assertSelectionValid(seekSelection));
}
return QItemSelection();
seekSelection = proxy.data()->mapSelectionToSource(seekSelection);
-#ifdef RANGE_FIX_HACK
- seekSelection = removeInvalidRanges(seekSelection);
-#endif
Q_ASSERT(d->assertSelectionValid(seekSelection));
}
return QItemSelection();
seekSelection = proxy.data()->mapSelectionFromSource(seekSelection);
-#ifdef RANGE_FIX_HACK
- seekSelection = removeInvalidRanges(seekSelection);
-#endif
Q_ASSERT(d->assertSelectionValid(seekSelection));
}