mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix SEGV Mac with LTM spanslider style
.. applying to buttons before they had been created.
This commit is contained in:
@@ -72,19 +72,6 @@ LTMWindow::LTMWindow(Context *context) :
|
||||
|
||||
ltmPlot = new LTMPlot(this, context, true);
|
||||
spanSlider = new QxtSpanSlider(Qt::Horizontal, this);
|
||||
#ifdef Q_OS_MAC
|
||||
// BUG in QMacStyle and painting of spanSlider
|
||||
// so we use a plain style to avoid it, but only
|
||||
// on a MAC, since win and linux are fine
|
||||
#if QT_VERSION > 0x5000
|
||||
QStyle *style = QStyleFactory::create("fusion");
|
||||
#else
|
||||
QStyle *style = QStyleFactory::create("Cleanlooks");
|
||||
#endif
|
||||
spanSlider->setStyle(style);
|
||||
scrollLeft->setStyle(style);
|
||||
scrollRight->setStyle(style);
|
||||
#endif
|
||||
spanSlider->setFocusPolicy(Qt::NoFocus);
|
||||
spanSlider->setHandleMovementMode(QxtSpanSlider::NoOverlapping);
|
||||
spanSlider->setLowerValue(0);
|
||||
@@ -114,6 +101,20 @@ LTMWindow::LTMWindow(Context *context) :
|
||||
plotLayout->addWidget(ltmPlot);
|
||||
plotLayout->addLayout(span);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// BUG in QMacStyle and painting of spanSlider
|
||||
// so we use a plain style to avoid it, but only
|
||||
// on a MAC, since win and linux are fine
|
||||
#if QT_VERSION > 0x5000
|
||||
QStyle *style = QStyleFactory::create("fusion");
|
||||
#else
|
||||
QStyle *style = QStyleFactory::create("Cleanlooks");
|
||||
#endif
|
||||
spanSlider->setStyle(style);
|
||||
scrollLeft->setStyle(style);
|
||||
scrollRight->setStyle(style);
|
||||
#endif
|
||||
|
||||
// the stack of plots
|
||||
plotsWidget = new QWidget(this);
|
||||
plotsWidget->setPalette(palette);
|
||||
|
||||
Reference in New Issue
Block a user