#include <QLayout>
#include <QListView>
-#include <QToolButton>
+#include <QPushButton>
#include <QSignalMapper>
#include <QSortFilterProxyModel>
// List view
myList = new QListView( this );
myList->setSelectionMode( QAbstractItemView::ExtendedSelection );
+ // enable drag and drop
myList->setDragEnabled( true );
myList->setAcceptDrops( true );
- myList->viewport()->setAcceptDrops( true );
+ // configure drag and drop
myList->setDropIndicatorShown( true );
myList->setDragDropMode( QAbstractItemView::InternalMove );
+ // Set the custom model
HYDROGUI_ListModel* aModel = new HYDROGUI_ListModel();
QSortFilterProxyModel* aFilteredModel = new QSortFilterProxyModel();
aFilteredModel->setSourceModel( aModel );
// Buttons top, up, down, bottom
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- myTop = new QToolButton;
+ myTop = new QPushButton( this );
myTop->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_TOP_ICO" ) ) );
myTop->setIconSize( QSize( 32, 32 ) );
- myUp = new QToolButton;
+ myTop->setToolTip( tr( "TOP_TLT" ) );
+ myUp = new QPushButton( this );
myUp->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_UP_ICO" ) ) );
myUp->setIconSize( myTop->iconSize() );
- myDown = new QToolButton;
+ myUp->setToolTip( tr( "UP_TLT" ) );
+ myDown = new QPushButton( this );
myDown->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_DOWN_ICO" ) ) );
myDown->setIconSize( myTop->iconSize() );
- myBottom = new QToolButton;
+ myDown->setToolTip( tr( "DOWN_TLT" ) );
+ myBottom = new QPushButton( this );
myBottom->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_BOTTOM_ICO" ) ) );
myBottom->setIconSize( myTop->iconSize() );
+ myBottom->setToolTip( tr( "BOTTOM_TLT" ) );
// Layout
// buttons