Skip to content

Commit 42418b1

Browse files
committedAug 17, 2011
Browser: do not show header in tree view
1 parent a29b49f commit 42418b1

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed
 

‎src/app/qgsbrowserdockwidget.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,27 @@ items on the tree view although the drop is actually managed by qgis app.
2222
*/
2323
class QgsBrowserTreeView : public QTreeView
2424
{
25-
public:
26-
QgsBrowserTreeView( QWidget* parent ) : QTreeView(parent)
27-
{
28-
setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled
29-
setSelectionMode( QAbstractItemView::ExtendedSelection );
30-
setContextMenuPolicy( Qt::CustomContextMenu );
31-
}
25+
public:
26+
QgsBrowserTreeView( QWidget* parent ) : QTreeView( parent )
27+
{
28+
setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled
29+
setSelectionMode( QAbstractItemView::ExtendedSelection );
30+
setContextMenuPolicy( Qt::CustomContextMenu );
31+
setHeaderHidden( true );
32+
}
3233

33-
void dragEnterEvent(QDragEnterEvent* e)
34-
{
35-
// accept drag enter so that our widget will not get ignored
36-
// and drag events will not get passed to QgisApp
37-
e->accept();
38-
}
39-
void dragMoveEvent(QDragMoveEvent* e)
40-
{
41-
// ignore all possibilities where an item could be dropped
42-
// because we want that user drops the item on canvas / legend / app
43-
e->ignore();
44-
}
34+
void dragEnterEvent( QDragEnterEvent* e )
35+
{
36+
// accept drag enter so that our widget will not get ignored
37+
// and drag events will not get passed to QgisApp
38+
e->accept();
39+
}
40+
void dragMoveEvent( QDragMoveEvent* e )
41+
{
42+
// ignore all possibilities where an item could be dropped
43+
// because we want that user drops the item on canvas / legend / app
44+
e->ignore();
45+
}
4546
};
4647

4748
QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :

‎src/browser/qgsbrowserbase.ui

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>714</width>
10-
<height>471</height>
9+
<width>712</width>
10+
<height>469</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -51,6 +51,9 @@
5151
<property name="dragDropMode">
5252
<enum>QAbstractItemView::DragOnly</enum>
5353
</property>
54+
<attribute name="headerVisible">
55+
<bool>false</bool>
56+
</attribute>
5457
</widget>
5558
<widget class="QTabWidget" name="tabWidget">
5659
<property name="enabled">

0 commit comments

Comments
 (0)
Please sign in to comment.