diff --git a/src/gui/layertree/qgslayertreeview.cpp b/src/gui/layertree/qgslayertreeview.cpp index 2dc4b3011f4..6c967c74573 100644 --- a/src/gui/layertree/qgslayertreeview.cpp +++ b/src/gui/layertree/qgslayertreeview.cpp @@ -26,6 +26,7 @@ #include #include +#include #include "qgslayertreeviewindicator.h" #include "qgslayertreeviewitemdelegate.h" @@ -43,6 +44,10 @@ QgsLayerTreeView::QgsLayerTreeView( QWidget *parent ) setEditTriggers( EditKeyPressed ); setExpandsOnDoubleClick( false ); // normally used for other actions + // Ensure legend graphics are scrollable + header()->setStretchLastSection( false ); + header()->setSectionResizeMode( QHeaderView::ResizeToContents ); + setSelectionMode( ExtendedSelection ); setDefaultDropAction( Qt::MoveAction );