Skip to content
Permalink
Browse files

Horizontal scroll bar in browser dock (#4274)

  • Loading branch information
wonder-sk committed Oct 3, 2011
1 parent 6999c89 commit 3f70d32e85030e7f764e2df6f491d9a198a57214
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/app/qgsbrowserdockwidget.cpp
@@ -1,5 +1,6 @@
#include "qgsbrowserdockwidget.h"

#include <QHeaderView>
#include <QTreeView>
#include <QMenu>
#include <QSettings>
@@ -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 )
@@ -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 );

0 comments on commit 3f70d32

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