X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FQtx%2FQtxTreeView.cxx;h=4da1f00adff15d29e71346bf315682e3c7d97fd2;hb=d6bd12111347879cd8dbe1a15ac4d6ba32ce0d6b;hp=8a7537a2cd698a2af8af506d2a2c92083b322575;hpb=11abf4b9333c8945432cca3d7e288dc24a004f42;p=modules%2Fgui.git diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx index 8a7537a2c..4da1f00ad 100644 --- a/src/Qtx/QtxTreeView.cxx +++ b/src/Qtx/QtxTreeView.cxx @@ -107,10 +107,17 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e ) QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole ); QIcon icon; if ( iconData.isValid() ) { +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) if ( iconData.canConvert( QVariant::Icon ) ) icon = iconData.value(); else if ( iconData.canConvert( QVariant::Pixmap ) ) icon = iconData.value(); +#else + if ( iconData.canConvert( QMetaType::QIcon ) ) + icon = iconData.value(); + else if ( iconData.canConvert( QMetaType::QPixmap ) ) + icon = iconData.value(); +#endif } if( ( !lab.isEmpty() || !icon.isNull() ) && appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true ) @@ -136,7 +143,11 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e ) } else if ( a && a == sortAction ) { setSortIndicatorShown( a->isChecked() ); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) setClickable( a->isChecked() ); +#else + setSectionsClickable( a->isChecked() ); +#endif QtxTreeView* view = qobject_cast( parent() ); if ( view ) { view->emitSortingEnabled( a->isChecked() ); @@ -181,7 +192,11 @@ QtxTreeView::QtxTreeView( QWidget* parent ) : QTreeView( parent ) { setHeader( new Header( false, this ) ); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) header()->setMovable( true ); +#else + header()->setSectionsMovable( true ); +#endif } /*! @@ -193,7 +208,11 @@ QtxTreeView::QtxTreeView( const bool enableSortMenu, QWidget* parent ) : QTreeView( parent ) { setHeader( new Header( enableSortMenu, this ) ); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) header()->setMovable( true ); +#else + header()->setSectionsMovable( true ); +#endif } /*!