Skip to content
Permalink
Browse files

Browser: do not show header in tree view

  • Loading branch information
wonder-sk committed Aug 17, 2011
1 parent a29b49f commit 42418b13a8644aa00bb50997a87847d121f37f26
Showing with 25 additions and 21 deletions.
  1. +20 −19 src/app/qgsbrowserdockwidget.cpp
  2. +5 −2 src/browser/qgsbrowserbase.ui
@@ -22,26 +22,27 @@ items on the tree view although the drop is actually managed by qgis app.
*/
class QgsBrowserTreeView : public QTreeView
{
public:
QgsBrowserTreeView( QWidget* parent ) : QTreeView(parent)
{
setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled
setSelectionMode( QAbstractItemView::ExtendedSelection );
setContextMenuPolicy( Qt::CustomContextMenu );
}
public:
QgsBrowserTreeView( QWidget* parent ) : QTreeView( parent )
{
setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled
setSelectionMode( QAbstractItemView::ExtendedSelection );
setContextMenuPolicy( Qt::CustomContextMenu );
setHeaderHidden( true );
}

void dragEnterEvent(QDragEnterEvent* e)
{
// accept drag enter so that our widget will not get ignored
// and drag events will not get passed to QgisApp
e->accept();
}
void dragMoveEvent(QDragMoveEvent* e)
{
// ignore all possibilities where an item could be dropped
// because we want that user drops the item on canvas / legend / app
e->ignore();
}
void dragEnterEvent( QDragEnterEvent* e )
{
// accept drag enter so that our widget will not get ignored
// and drag events will not get passed to QgisApp
e->accept();
}
void dragMoveEvent( QDragMoveEvent* e )
{
// ignore all possibilities where an item could be dropped
// because we want that user drops the item on canvas / legend / app
e->ignore();
}
};

QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>714</width>
<height>471</height>
<width>712</width>
<height>469</height>
</rect>
</property>
<property name="windowTitle">
@@ -51,6 +51,9 @@
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">

0 comments on commit 42418b1

Please sign in to comment.
You can’t perform that action at this time.