columnNames.append( tr( "GEOM_EDGE" ));
columnNames.append( tr( "GEOM_FACE_CONSTRAINT" ) );
myTreeConstraints->setHeaderLabels( columnNames );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- myTreeConstraints->header()->setMovable( false );
- myTreeConstraints->header()->setResizeMode( QHeaderView::ResizeToContents );
-#else
myTreeConstraints->header()->setSectionsMovable( false );
myTreeConstraints->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
-#endif
myTreeConstraints->setMinimumHeight( 140 );
QHBoxLayout* l = new QHBoxLayout( myGroupWireConstraints->Box );
void CurveCreator_TreeViewModel::setCurve( CurveCreator_ICurve* theCurve )
{
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- myCurve = theCurve;
- reset();
-#else
beginResetModel();
myCurve = theCurve;
endResetModel();
-#endif
}
/*****************************************************************************************/
QTreeView(parent)
{
header()->hide();
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- header()->setResizeMode(QHeaderView::ResizeToContents);
-#else
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
-#endif
setUniformRowHeights(true);
setContextMenuPolicy( Qt::CustomContextMenu );
CurveCreator_TreeViewModel* aModel = new CurveCreator_TreeViewModel(theCurve, this);
DependencyTree_Arrow::DependencyTree_Arrow( DependencyTree_Object* theStartItem,
DependencyTree_Object* theEndItem,
QGraphicsItem* parent, QGraphicsScene* scene )
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-:QGraphicsLineItem( parent, scene ),
-#else
:QGraphicsLineItem( parent ),
-#endif
myIsBiLink( false ),
myStartItem( theStartItem ),
myEndItem( theEndItem )
myParamsTreeWd->setColumnCount( 2 );
myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) );
myParamsTreeWd->header()->setStretchLastSection( true );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
-#else
myParamsTreeWd->header()->setSectionResizeMode( 0, QHeaderView::ResizeToContents );
-#endif
QVBoxLayout* aLayout = new QVBoxLayout( this );
aLayout->addWidget( myParamsTreeWd );
headerItem->setIcon( 1, myVisibleIcon );
setHeaderItem ( headerItem );
header()->moveSection( 1, 0 );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- header()->setResizeMode( 1, QHeaderView::ResizeToContents );
-#else
header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
-#endif
+
QStringList rootNames;
rootNames << tr("GEOM_DIMENSIONS") << "";
myDimensionsItem = new QTreeWidgetItem( this, rootNames );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
headerItem->setIcon( 2, QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ) );
myTreeWidget->setHeaderItem ( headerItem );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- myTreeWidget->header()->setClickable( true );
-#else
myTreeWidget->header()->setSectionsClickable( true );
-#endif
myTreeWidget->header()->setSortIndicatorShown( true );
myTreeWidget->header()->moveSection( 2, 0 );
myTreeWidget->setSortingEnabled( true );
QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
theTreeWidget->setHeaderItem ( headerItem );
theTreeWidget->header()->moveSection( 1, 0 );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- theTreeWidget->header()->setClickable( true );
- theTreeWidget->header()->setMovable( false );
- theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
-#else
theTreeWidget->header()->setSectionsClickable( true );
theTreeWidget->header()->setSectionsMovable( false );
theTreeWidget->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
-#endif
+
theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
}
const int nbCols = 2;
QTableWidget* table = new QTableWidget( nbRows, nbCols, this );
table->setEditTriggers( QAbstractItemView::NoEditTriggers );
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- table->horizontalHeader()->setResizeMode( 1, QHeaderView::Interactive );
-#else
table->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::Interactive );
-#endif
+
table->horizontalHeader()->setStretchLastSection( true );
QStringList headers;
headerItem->setIcon(1, myInvisible);
theTreeObjects->setHeaderItem(headerItem);
theTreeObjects->header()->moveSection(1, 0);
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- theTreeObjects->header()->setClickable(true);
- theTreeObjects->header()->setMovable(false);
- theTreeObjects->header()->setResizeMode( 1, QHeaderView::ResizeToContents);
-#else
theTreeObjects->header()->setSectionsClickable(true);
theTreeObjects->header()->setSectionsMovable(false);
theTreeObjects->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents);
-#endif
+
theTreeObjects->setSelectionMode(QAbstractItemView::ExtendedSelection);
theTreeObjects->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
// set custom item delegate