Fix Tape crash on Mac OS X.

This commit is contained in:
Roman Telezhynskyi 2020-10-25 15:25:57 +02:00
parent 188d7097e1
commit c6e2819587
5 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,6 @@
# Version 0.7.37 (unreleased)
- Fix Tape crash on Mac OS X.
# Version 0.7.36 October 24, 2020 # Version 0.7.36 October 24, 2020
- [#892] Show tooltip for piece node point. - [#892] Show tooltip for piece node point.
- [#894] Quick way to disable a passmark. - [#894] Quick way to disable a passmark.

View File

@ -1719,6 +1719,20 @@ void MainWindow::ExportToCSVData(const QString &fileName, bool withHeader, int m
csv.toCSV(fileName, error, withHeader, separator, QTextCodec::codecForMib(mib)); csv.toCSV(fileName, error, withHeader, separator, QTextCodec::codecForMib(mib));
} }
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ToolBarStyle(QToolBar *bar) const
{
MainWindowsNoGUI::ToolBarStyle(bar);
#if defined(Q_OS_MAC)
// Temporary fix issue with toolbar black background on mac with OpenGL render
if (qApp->getSceneView() && qApp->getSceneView()->IsOpenGLRender())
{
bar->setStyle(QStyleFactory::create("fusion"));
}
#endif
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::ScaleChanged(qreal scale) void MainWindow::ScaleChanged(qreal scale)
{ {

View File

@ -111,6 +111,7 @@ protected:
virtual void PrepareSceneList(PreviewQuatilty quality) override; virtual void PrepareSceneList(PreviewQuatilty quality) override;
virtual void ExportToCSVData(const QString &fileName, bool withHeader, int mib, virtual void ExportToCSVData(const QString &fileName, bool withHeader, int mib,
const QChar &separator) final; const QChar &separator) final;
virtual void ToolBarStyle(QToolBar *bar) const override;
private slots: private slots:
void ScaleChanged(qreal scale); void ScaleChanged(qreal scale);
void MouseMove(const QPointF &scenePos); void MouseMove(const QPointF &scenePos);

View File

@ -28,7 +28,7 @@
#include "vabstractmainwindow.h" #include "vabstractmainwindow.h"
#include "../vpropertyexplorer/checkablemessagebox.h" #include "../vpropertyexplorer/checkablemessagebox.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractapplication.h"
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "dialogs/dialogexporttocsv.h" #include "dialogs/dialogexporttocsv.h"
@ -166,25 +166,11 @@ bool VAbstractMainWindow::ContinueFormatRewrite(const QString &currentFormatVers
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VAbstractMainWindow::ToolBarStyle(QToolBar *bar) void VAbstractMainWindow::ToolBarStyle(QToolBar *bar) const
{ {
SCASSERT(bar != nullptr) SCASSERT(bar != nullptr)
if (qApp->Settings()->GetToolBarStyle()) qApp->Settings()->GetToolBarStyle() ? bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon)
{ : bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
}
else
{
bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
}
#if defined(Q_OS_MAC)
// Temporary fix issue with toolbar black background on mac with OpenGL render
if (qApp->getSceneView() && qApp->getSceneView()->IsOpenGLRender())
{
bar->setStyle(QStyleFactory::create("fusion"));
}
#endif
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -62,7 +62,7 @@ protected:
QAction *m_separatorAct{nullptr}; QAction *m_separatorAct{nullptr};
bool ContinueFormatRewrite(const QString &currentFormatVersion, const QString &maxFormatVersion); bool ContinueFormatRewrite(const QString &currentFormatVersion, const QString &maxFormatVersion);
void ToolBarStyle(QToolBar *bar); virtual void ToolBarStyle(QToolBar *bar) const;
QString CSVFilePath(); QString CSVFilePath();