From a79f2baeee218c8c42cc1bc82ff178b9d497bbf1 Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Wed, 5 Jun 2019 18:55:47 -0600 Subject: [PATCH] Ensure layer legend graphics are horizontally scrollable (fixes #28050) Redmine: https://issues.qgis.org/issues/20229 --- src/gui/layertree/qgslayertreeview.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 );