Skip to content

Commit 3f70d32

Browse files
committed
Horizontal scroll bar in browser dock (#4274)
1 parent 6999c89 commit 3f70d32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/app/qgsbrowserdockwidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "qgsbrowserdockwidget.h"
22

3+
#include <QHeaderView>
34
#include <QTreeView>
45
#include <QMenu>
56
#include <QSettings>
@@ -56,6 +57,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
5657
connect( mBrowserView, SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( showContextMenu( const QPoint & ) ) );
5758
//connect( mBrowserView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
5859
connect( mBrowserView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
60+
5961
}
6062

6163
void QgsBrowserDockWidget::showEvent( QShowEvent * e )
@@ -65,6 +67,11 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
6567
{
6668
mModel = new QgsBrowserModel( mBrowserView );
6769
mBrowserView->setModel( mModel );
70+
71+
// provide a horizontal scroll bar instead of using ellipse (...) for longer items
72+
mBrowserView->setTextElideMode( Qt::ElideNone );
73+
mBrowserView->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
74+
mBrowserView->header()->setStretchLastSection( false );
6875
}
6976

7077
QDockWidget::showEvent( e );

0 commit comments

Comments
 (0)