From dfb8c387b69768c6ee900a0ded23fa3ca0c2b88b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 23 Jul 2016 12:54:00 +0300 Subject: [PATCH 1/3] Added checking which minimal OSX version supports current Qt version. From time to time Qt change minimal supported OS X version. This checking will help build Valentina on older Qt version without fixing .pro files. --HG-- branch : develop --- src/app/tape/tape.pro | 12 +++++++++++- src/app/valentina/valentina.pro | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index cbe7f04af..8acecf751 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -200,7 +200,17 @@ unix{ # Some macx stuff QMAKE_MAC_SDK = macosx - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 + # Check which minimal OSX version supports current Qt version + equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 6) { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 + } else { + equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 3) { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 + } else { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 + } + } + # Path to resources in app bundle #RESOURCES_DIR = "Contents/Resources" defined in translation.pri FRAMEWORKS_DIR = "Contents/Frameworks" diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 7c2a33e5c..79d7dc143 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -214,7 +214,17 @@ unix{ # Some macx stuff QMAKE_MAC_SDK = macosx - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 + # Check which minimal OSX version supports current Qt version + equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 6) { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 + } else { + equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 3) { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 + } else { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 + } + } + # Path to resources in app bundle #RESOURCES_DIR = "Contents/Resources" defined in translation.pri FRAMEWORKS_DIR = "Contents/Frameworks" From 524419e53f9aaf3404d31d7ecaddc72513116a41 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 23 Jul 2016 12:56:22 +0300 Subject: [PATCH 2/3] Fixed build on OS X. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 13 +++++++----- src/app/tape/tmainwindow.h | 1 + src/app/valentina/mainwindow.cpp | 34 +++++++++++++++++++++----------- src/app/valentina/mainwindow.h | 2 ++ 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index ca3e7feb5..1a632e3be 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -462,6 +462,13 @@ void TMainWindow::CreateFromExisting() } } +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::Preferences() +{ + TapeConfigDialog dlg(this); + dlg.exec(); +} + //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::closeEvent(QCloseEvent *event) { @@ -1734,11 +1741,7 @@ void TMainWindow::SetupMenu() connect(ui->actionExportToCSV, &QAction::triggered, this, &TMainWindow::ExportToCSV); connect(ui->actionReadOnly, &QAction::triggered, this, &TMainWindow::ReadOnly); - connect(ui->actionPreferences, &QAction::triggered, [this]() - { - TapeConfigDialog dlg(this); - dlg.exec(); - }); + connect(ui->actionPreferences, &QAction::triggered, this, &TMainWindow::Preferences); for (int i = 0; i < MaxRecentFiles; ++i) { diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index 80683d98f..c9a5eb8ae 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -75,6 +75,7 @@ private slots: void OpenStandard(); void OpenTemplate(); void CreateFromExisting(); + void Preferences(); void FileSave(); void FileSaveAs(); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 03e8cbb00..dcae0ecf1 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3553,18 +3553,7 @@ void MainWindow::CreateActions() connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close); - connect(ui->actionPreferences, &QAction::triggered, [this]() - { - ConfigDialog dlg(this); - connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first - connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions); - connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::ToolBarStyles); - if (dlg.exec() == QDialog::Accepted) - { - InitAutoSave(); - } - }); - + connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::Preferences); connect(ui->actionReportBug, &QAction::triggered, [this]() { qCDebug(vMainWindow, "Reporting bug"); @@ -3954,6 +3943,27 @@ void MainWindow::ShowPaper(int index) ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); } +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::Preferences() +{ + ConfigDialog dlg(this); + connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first + connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions); + connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::ToolBarStyles); + if (dlg.exec() == QDialog::Accepted) + { + InitAutoSave(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::CreateMeasurements() +{ + const QString tape = qApp->TapeFilePath(); + const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath(); + QProcess::startDetached(tape, QStringList(), workingDirectory); +} + //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ToolBarStyle(QToolBar *bar) { diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 11bf1f229..581159fae 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -111,6 +111,8 @@ private slots: void WindowsLocale(); void ToolBarStyles(); void ShowPaper(int index); + void Preferences(); + void CreateMeasurements(); void ArrowTool(); void ToolEndLine(bool checked); From 5da965ba69a02abbf1e00d15ede8d452f95059e0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 23 Jul 2016 14:48:16 +0300 Subject: [PATCH 3/3] After update to Qt 5.7 custom libraries: qmuparser and vpropertybrpwser lost "@rpath" prefix. Setting QMAKE_SONAME_PREFIX fix it. --HG-- branch : develop --- src/libs/qmuparser/qmuparser.pro | 3 +++ src/libs/vpropertyexplorer/vpropertyexplorer.pro | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index 3982eeb7b..154b90fea 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -41,6 +41,9 @@ include(qmuparser.pri) VERSION = 2.4.1 +# Allow MAC OS X to find library inside a bundle +macx:QMAKE_SONAME_PREFIX = @rpath + # Set "make install" command for Unix-like systems. unix:!macx{ isEmpty(PREFIX_LIB){ diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pro b/src/libs/vpropertyexplorer/vpropertyexplorer.pro index a5eff9e62..2af77b837 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pro +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pro @@ -37,6 +37,9 @@ MOC_DIR = moc # objecs files OBJECTS_DIR = obj +# Allow MAC OS X to find library inside a bundle +macx:QMAKE_SONAME_PREFIX = @rpath + include(vpropertyexplorer.pri) # Set "make install" command for Unix-like systems.