From de1262b01094e1da1b17af50df62379fe72e5a10 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 25 Apr 2015 15:18:22 +0100 Subject: [PATCH] Fix SEGV Mac with LTM spanslider style .. applying to buttons before they had been created. --- src/LTMWindow.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/LTMWindow.cpp b/src/LTMWindow.cpp index d7ddc195d..1212a304c 100644 --- a/src/LTMWindow.cpp +++ b/src/LTMWindow.cpp @@ -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);