Skip to content

Commit

Permalink
Fix SEGV Mac with LTM spanslider style
Browse files Browse the repository at this point in the history
.. applying to buttons before they had been created.
  • Loading branch information
liversedge committed Apr 25, 2015
1 parent bc87b16 commit de1262b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/LTMWindow.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit de1262b

Please sign in to comment.