Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Horizontal scroll bar in browser dock (#4274)
  • Loading branch information
wonder-sk committed Oct 3, 2011
1 parent 6999c89 commit 3f70d32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgsbrowserdockwidget.cpp
@@ -1,5 +1,6 @@
#include "qgsbrowserdockwidget.h"

#include <QHeaderView>
#include <QTreeView>
#include <QMenu>
#include <QSettings>
Expand Down Expand Up @@ -56,6 +57,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
connect( mBrowserView, SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( showContextMenu( const QPoint & ) ) );
//connect( mBrowserView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
connect( mBrowserView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );

}

void QgsBrowserDockWidget::showEvent( QShowEvent * e )
Expand All @@ -65,6 +67,11 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
{
mModel = new QgsBrowserModel( mBrowserView );
mBrowserView->setModel( mModel );

// provide a horizontal scroll bar instead of using ellipse (...) for longer items
mBrowserView->setTextElideMode( Qt::ElideNone );
mBrowserView->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
mBrowserView->header()->setStretchLastSection( false );
}

QDockWidget::showEvent( e );
Expand Down

0 comments on commit 3f70d32

Please sign in to comment.