PDA

View Full Version : QwtLegend obscured by "as needed" horizontal scrollbar



philw
1st December 2016, 21:43
Is there a way of preventing the optionally needed horizontal scrollbar from obscuring items shown in the legend (QwtLegend)?

The first of this sequence of three images illustrates the problem. The plot dialog needs to be sufficiently wide for the content of the QwtLegend to be seen.

12236
http://cadswes2.colorado.edu/~philw/pub/2016/ScrollbarObscuresPlotLegend.png

Any ideas would be appreciated. Is there way of getting notifications from an "as needed" scrollbar being shown and hidden (without subclassing), e.g. to conditionally impose a minimum height on the QwtLegend widget? OR, might there there a higher-level solution?

We're using Qwt 6.1.3 with Qt 5.5.1 on Windows.

Uwe
2nd December 2016, 07:29
QScrollArea *scrollArea = legend->findChild<QScrollArea *>();
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );Uwe