Ignore:
Timestamp:
May 10, 2017, 3:20:54 PM (7 years ago)
Author:
stoecker
Message:

update qwt and qwtpolar, many QT5 fixes (unfinished)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwtpolar/qwt_polar_layout.cpp

    r7990 r8127  
    2323    {
    2424        int frameWidth;
    25         int vScrollBarWidth;
    26         int hScrollBarHeight;
     25        int hScrollExtent;
     26        int vScrollExtent;
    2727        QSizeF hint;
    2828    } legend;
     
    4949    {
    5050        legend.frameWidth = plot->legend()->frameWidth();
    51         legend.vScrollBarWidth =
    52             plot->legend()->verticalScrollBar()->sizeHint().width();
    53         legend.hScrollBarHeight =
    54             plot->legend()->horizontalScrollBar()->sizeHint().height();
     51        legend.hScrollExtent =
     52            plot->legend()->scrollExtent( Qt::Horizontal );
     53        legend.vScrollExtent =
     54            plot->legend()->scrollExtent( Qt::Vertical );
    5555
    5656        const QSizeF hint = plot->legend()->sizeHint();
     
    6262
    6363        if ( h > rect.height() )
    64             w += legend.vScrollBarWidth;
     64            w += legend.hScrollExtent;
    6565
    6666        legend.hint = QSizeF( w, h );
     
    279279        // half of the available space.
    280280
    281         dim = qMin( hint.width(), qreal(rect.width() * d_data->legendRatio) );
     281        dim = qMin( double( hint.width() ), rect.width() * d_data->legendRatio );
    282282
    283283        if ( !( options & IgnoreScrollbars ) )
     
    288288                // space for the vertical scrollbar.
    289289
    290                 dim += d_data->layoutData.legend.vScrollBarWidth;
     290                dim += d_data->layoutData.legend.hScrollExtent;
    291291            }
    292292        }
     
    294294    else
    295295    {
    296         dim = qMin( hint.width(), qreal(rect.width() * d_data->legendRatio) );
    297         dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
     296        dim = qMin( double( hint.height() ), rect.height() * d_data->legendRatio );
     297        dim = qMax( dim, d_data->layoutData.legend.vScrollExtent );
    298298    }
    299299
Note: See TracChangeset for help on using the changeset viewer.