-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole );
QIcon icon;
if ( iconData.isValid() ) {
- if ( qVariantCanConvert<QIcon>( iconData ) )
- icon = qVariantValue<QIcon>( iconData );
- else if ( qVariantCanConvert<QPixmap>( iconData ) )
- icon = qVariantValue<QPixmap>( iconData );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ if ( iconData.canConvert( QVariant::Icon ) )
+ icon = iconData.value<QIcon>();
+ else if ( iconData.canConvert( QVariant::Pixmap ) )
+ icon = iconData.value<QPixmap>();
+#else
+ if ( iconData.canConvert( QMetaType::QIcon ) )
+ icon = iconData.value<QIcon>();
+ else if ( iconData.canConvert( QMetaType::QPixmap ) )
+ icon = iconData.value<QPixmap>();
+#endif
}
if( ( !lab.isEmpty() || !icon.isNull() ) &&
appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
}
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<QtxTreeView*>( parent() );
if ( view ) {
view->emitSortingEnabled( a->isChecked() );
: QTreeView( parent )
{
setHeader( new Header( false, this ) );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
header()->setMovable( true );
+#else
+ header()->setSectionsMovable( true );
+#endif
}
/*!
: QTreeView( parent )
{
setHeader( new Header( enableSortMenu, this ) );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
header()->setMovable( true );
+#else
+ header()->setSectionsMovable( true );
+#endif
}
/*!