diff --git a/applications/Mapple/dialogs/dialog_properties.cpp b/applications/Mapple/dialogs/dialog_properties.cpp index 1c8cb4c7..bb2bb34d 100644 --- a/applications/Mapple/dialogs/dialog_properties.cpp +++ b/applications/Mapple/dialogs/dialog_properties.cpp @@ -79,13 +79,13 @@ DialogProperties::DialogProperties(MainWindow *window) margins.setLeft(7); lineEditNewPropertyName->setTextMargins(margins); - connect(comboBoxCommand, SIGNAL(currentIndexChanged(const QString &)), this, + connect(comboBoxCommand, SIGNAL(currentTextChanged(const QString &)), this, SLOT(commandChanged(const QString &))); - connect(comboBoxModels, SIGNAL(currentIndexChanged(const QString &)), this, + connect(comboBoxModels, SIGNAL(currentTextChanged(const QString &)), this, SLOT(modelChanged(const QString &))); - connect(comboBoxPropertyLocation, SIGNAL(currentIndexChanged(const QString &)), this, + connect(comboBoxPropertyLocation, SIGNAL(currentTextChanged(const QString &)), this, SLOT(locationChanged(const QString &))); - connect(comboBoxPropertyName, SIGNAL(currentIndexChanged(const QString &)), this, + connect(comboBoxPropertyName, SIGNAL(currentTextChanged(const QString &)), this, SLOT(propertyChanged(const QString &))); connect(updateButton, SIGNAL(clicked()), this, SLOT(updateProperties())); connect(applyButton, SIGNAL(clicked()), this, SLOT(applyCommand())); @@ -176,7 +176,7 @@ void DialogProperties::modelChanged(const QString &text) { if (!model) return; - disconnect(comboBoxPropertyLocation, SIGNAL(currentIndexChanged(const QString &)), this, + disconnect(comboBoxPropertyLocation, SIGNAL(currentTextChanged(const QString &)), this, SLOT(locationChanged(const QString &))); if (dynamic_cast(model)) { @@ -203,7 +203,7 @@ void DialogProperties::modelChanged(const QString &text) { locationChanged(comboBoxPropertyLocation->currentText()); - connect(comboBoxPropertyLocation, SIGNAL(currentIndexChanged(const QString &)), this, + connect(comboBoxPropertyLocation, SIGNAL(currentTextChanged(const QString &)), this, SLOT(locationChanged(const QString &))); } @@ -1127,7 +1127,7 @@ void DialogProperties::updateProperties() { const std::string &model_text = comboBoxModels->currentText().toStdString(); bool model_text_has_match = false; - disconnect(comboBoxModels, SIGNAL(currentIndexChanged(const QString &)), this, + disconnect(comboBoxModels, SIGNAL(currentTextChanged(const QString &)), this, SLOT(modelChanged(const QString &))); comboBoxModels->clear(); @@ -1151,7 +1151,7 @@ void DialogProperties::updateProperties() { } modelChanged(comboBoxModels->currentText()); - connect(comboBoxModels, SIGNAL(currentIndexChanged(QString)), this, SLOT(modelChanged(QString))); + connect(comboBoxModels, SIGNAL(currentTextChanged(const QString&)), this, SLOT(modelChanged(const QString&))); } diff --git a/applications/Mapple/dialogs/dialog_surface_mesh_remeshing.cpp b/applications/Mapple/dialogs/dialog_surface_mesh_remeshing.cpp index 8b401b27..8d5212cc 100644 --- a/applications/Mapple/dialogs/dialog_surface_mesh_remeshing.cpp +++ b/applications/Mapple/dialogs/dialog_surface_mesh_remeshing.cpp @@ -46,7 +46,7 @@ DialogSurfaceMeshRemeshing::DialogSurfaceMeshRemeshing(MainWindow *window) comboBoxScheme->addItem("Adaptive Remeshing"); comboBoxScheme->setCurrentIndex(0); - connect(comboBoxScheme, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setRemeshingScheme(const QString &))); + connect(comboBoxScheme, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setRemeshingScheme(const QString &))); layout()->setSizeConstraint(QLayout::SetFixedSize); connect(okButton, SIGNAL(clicked()), this, SLOT(apply())); diff --git a/applications/Mapple/dialogs/dialog_surface_mesh_smoothing.cpp b/applications/Mapple/dialogs/dialog_surface_mesh_smoothing.cpp index ec0d692d..68852997 100644 --- a/applications/Mapple/dialogs/dialog_surface_mesh_smoothing.cpp +++ b/applications/Mapple/dialogs/dialog_surface_mesh_smoothing.cpp @@ -46,7 +46,7 @@ DialogSurfaceMeshSmoothing::DialogSurfaceMeshSmoothing(MainWindow *window) comboBoxScheme->addItem("Implicit Smoothing"); comboBoxScheme->setCurrentIndex(0); - connect(comboBoxScheme, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setSmoothingScheme(const QString &))); + connect(comboBoxScheme, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setSmoothingScheme(const QString &))); layout()->setSizeConstraint(QLayout::SetFixedSize); connect(okButton, SIGNAL(clicked()), this, SLOT(apply())); diff --git a/applications/Mapple/main.cpp b/applications/Mapple/main.cpp index f04d3ff7..ff79fca7 100644 --- a/applications/Mapple/main.cpp +++ b/applications/Mapple/main.cpp @@ -38,7 +38,6 @@ #include #include -#include #include #include @@ -123,8 +122,9 @@ int main(int argc, char *argv[]) { //QApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#if (defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif @@ -164,15 +164,6 @@ int main(int argc, char *argv[]) { } #endif - if (!QGLFormat::hasOpenGL()) { - LOG(ERROR) << "Mapple needs OpenGL to run"; - return EXIT_FAILURE; - } - if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_3_2) == 0) { - LOG(ERROR) << "Mapple needs OpenGL 3.2 at least to run"; - return EXIT_FAILURE; - } - try { MainWindow win; if (!logging::log_file().empty()) diff --git a/applications/Mapple/main_window.cpp b/applications/Mapple/main_window.cpp index 92ca58d8..bf7c6a9c 100644 --- a/applications/Mapple/main_window.cpp +++ b/applications/Mapple/main_window.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -835,12 +835,14 @@ void MainWindow::restoreCameraStateFromFile() { bool MainWindow::okToContinue() { if (isWindowModified()) { - int r = QMessageBox::warning(this, tr("Mapple"), - tr("The model has been modified.\n" - "Do you want to save your changes?"), - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + QMessageBox::StandardButton r = QMessageBox::warning( + this, + tr("Mapple"), + tr("The model has been modified.\n" + "Do you want to save your changes?"), + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, + QMessageBox::Yes + ); if (r == QMessageBox::Yes) return onSave(); else if (r == QMessageBox::Cancel) diff --git a/applications/Mapple/widgets/widget_drawable_lines.cpp b/applications/Mapple/widgets/widget_drawable_lines.cpp index ef834227..969634c2 100644 --- a/applications/Mapple/widgets/widget_drawable_lines.cpp +++ b/applications/Mapple/widgets/widget_drawable_lines.cpp @@ -65,7 +65,7 @@ WidgetLinesDrawable::WidgetLinesDrawable(QWidget *parent) void WidgetLinesDrawable::connectAll() { // which drawable - connect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setActiveDrawable(const QString &))); // visible @@ -75,11 +75,11 @@ void WidgetLinesDrawable::connectAll() { connect(ui_->doubleSpinBoxLineWidth, SIGNAL(valueChanged(double)), this, SLOT(setLineWidth(double))); // imposter - connect(ui_->comboBoxImposterStyle, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxImposterStyle, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setImposterStyle(const QString &))); // color scheme - connect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setColorScheme(const QString &))); // default color @@ -99,7 +99,7 @@ void WidgetLinesDrawable::connectAll() { connect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - connect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, + connect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); connect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } @@ -107,7 +107,7 @@ void WidgetLinesDrawable::connectAll() { void WidgetLinesDrawable::disconnectAll() { // which drawable - disconnect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setActiveDrawable(const QString &))); // visible @@ -117,11 +117,11 @@ void WidgetLinesDrawable::disconnectAll() { disconnect(ui_->doubleSpinBoxLineWidth, SIGNAL(valueChanged(double)), this, SLOT(setLineWidth(double))); // imposter - disconnect(ui_->comboBoxImposterStyle, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxImposterStyle, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setImposterStyle(const QString &))); // color scheme - disconnect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setColorScheme(const QString &))); // default color @@ -141,7 +141,7 @@ void WidgetLinesDrawable::disconnectAll() { disconnect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - disconnect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setVectorField(const QString&))); + disconnect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); disconnect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } diff --git a/applications/Mapple/widgets/widget_drawable_points.cpp b/applications/Mapple/widgets/widget_drawable_points.cpp index ebcf469c..c75bd3ab 100644 --- a/applications/Mapple/widgets/widget_drawable_points.cpp +++ b/applications/Mapple/widgets/widget_drawable_points.cpp @@ -67,7 +67,7 @@ WidgetPointsDrawable::WidgetPointsDrawable(QWidget *parent) void WidgetPointsDrawable::connectAll() { // which drawable - connect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setActiveDrawable(const QString &))); // visible @@ -77,15 +77,15 @@ void WidgetPointsDrawable::connectAll() { connect(ui_->doubleSpinBoxPointSize, SIGNAL(valueChanged(double)), this, SLOT(setPointSize(double))); // imposter - connect(ui_->comboBoxImposterStyle, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxImposterStyle, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setImposterStyle(const QString &))); // lighting - connect(ui_->comboBoxLightingOptions, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxLightingOptions, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setLighting(const QString &))); // color scheme - connect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)), + connect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setColorScheme(const QString &))); // default color @@ -109,7 +109,7 @@ void WidgetPointsDrawable::connectAll() { connect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - connect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, + connect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); connect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } @@ -117,7 +117,7 @@ void WidgetPointsDrawable::connectAll() { void WidgetPointsDrawable::disconnectAll() { // which drawable - disconnect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setActiveDrawable(const QString &))); // visible @@ -127,15 +127,15 @@ void WidgetPointsDrawable::disconnectAll() { disconnect(ui_->doubleSpinBoxPointSize, SIGNAL(valueChanged(double)), this, SLOT(setPointSize(double))); // imposter - disconnect(ui_->comboBoxImposterStyle, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxImposterStyle, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setImposterStyle(const QString &))); // lighting - disconnect(ui_->comboBoxLightingOptions, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxLightingOptions, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setLighting(const QString &))); // color scheme - disconnect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)), + disconnect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)), this, SLOT(setColorScheme(const QString &))); // default color @@ -159,7 +159,7 @@ void WidgetPointsDrawable::disconnectAll() { disconnect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - disconnect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setVectorField(const QString&))); + disconnect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); disconnect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } diff --git a/applications/Mapple/widgets/widget_drawable_triangles.cpp b/applications/Mapple/widgets/widget_drawable_triangles.cpp index 0ce476a3..83de5a2d 100644 --- a/applications/Mapple/widgets/widget_drawable_triangles.cpp +++ b/applications/Mapple/widgets/widget_drawable_triangles.cpp @@ -69,7 +69,7 @@ WidgetTrianglesDrawable::WidgetTrianglesDrawable(QWidget *parent) void WidgetTrianglesDrawable::connectAll() { // which drawable - connect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setActiveDrawable(const QString &))); + connect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setActiveDrawable(const QString &))); // visible connect(ui_->checkBoxVisible, SIGNAL(toggled(bool)), this, SLOT(setDrawableVisible(bool))); @@ -78,10 +78,10 @@ void WidgetTrianglesDrawable::connectAll() { connect(ui_->checkBoxPhongShading, SIGNAL(toggled(bool)), this, SLOT(setPhongShading(bool))); // lighting - connect(ui_->comboBoxLightingOptions, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setLighting(const QString &))); + connect(ui_->comboBoxLightingOptions, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setLighting(const QString &))); // color scheme - connect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setColorScheme(const QString &))); + connect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setColorScheme(const QString &))); // default color connect(ui_->toolButtonDefaultColor, SIGNAL(clicked()), this, SLOT(setDefaultColor())); @@ -112,14 +112,14 @@ void WidgetTrianglesDrawable::connectAll() { connect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - connect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setVectorField(const QString&))); + connect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); connect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } void WidgetTrianglesDrawable::disconnectAll() { // which drawable - disconnect(ui_->comboBoxDrawables, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setActiveDrawable(const QString &))); + disconnect(ui_->comboBoxDrawables, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setActiveDrawable(const QString &))); // visible disconnect(ui_->checkBoxVisible, SIGNAL(toggled(bool)), this, SLOT(setDrawableVisible(bool))); @@ -128,10 +128,10 @@ void WidgetTrianglesDrawable::disconnectAll() { disconnect(ui_->checkBoxPhongShading, SIGNAL(toggled(bool)), this, SLOT(setPhongShading(bool))); // lighting - disconnect(ui_->comboBoxLightingOptions, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setLighting(const QString &))); + disconnect(ui_->comboBoxLightingOptions, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setLighting(const QString &))); // color scheme - disconnect(ui_->comboBoxColorScheme, SIGNAL(currentIndexChanged(const QString &)),this, SLOT(setColorScheme(const QString &))); + disconnect(ui_->comboBoxColorScheme, SIGNAL(currentTextChanged(const QString &)),this, SLOT(setColorScheme(const QString &))); // default color disconnect(ui_->toolButtonDefaultColor, SIGNAL(clicked()), this, SLOT(setDefaultColor())); @@ -162,7 +162,7 @@ void WidgetTrianglesDrawable::disconnectAll() { disconnect(ui_->doubleSpinBoxScalarFieldClampUpper, SIGNAL(valueChanged(double)), this, SLOT(setScalarFieldClampUpper(double))); // vector field - disconnect(ui_->comboBoxVectorField, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setVectorField(const QString&))); + disconnect(ui_->comboBoxVectorField, SIGNAL(currentTextChanged(const QString&)), this, SLOT(setVectorField(const QString&))); disconnect(ui_->doubleSpinBoxVectorFieldScale, SIGNAL(valueChanged(double)), this, SLOT(setVectorFieldScale(double))); } diff --git a/easy3d/algo/CMakeLists.txt b/easy3d/algo/CMakeLists.txt index a0b95f4d..86b5dcbc 100755 --- a/easy3d/algo/CMakeLists.txt +++ b/easy3d/algo/CMakeLists.txt @@ -80,6 +80,9 @@ add_module(${module} "${${module}_headers}" "${${module}_sources}" "${private_de target_include_directories(easy3d_${module} PRIVATE ${Easy3D_THIRD_PARTY}/eigen ${Easy3D_THIRD_PARTY}/ransac) # It's "Boost", not "BOOST" or "boost". Case matters. +if (POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif () find_package(Boost COMPONENTS graph) if (Boost_FOUND) target_include_directories(easy3d_${module} PRIVATE ${Boost_INCLUDE_DIRS}) diff --git a/tutorials/Tutorial_204_Viewer_Qt/main.cpp b/tutorials/Tutorial_204_Viewer_Qt/main.cpp index a241c611..4c14a5a7 100644 --- a/tutorials/Tutorial_204_Viewer_Qt/main.cpp +++ b/tutorials/Tutorial_204_Viewer_Qt/main.cpp @@ -55,8 +55,8 @@ int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif diff --git a/tutorials/Tutorial_204_Viewer_Qt/window.cpp b/tutorials/Tutorial_204_Viewer_Qt/window.cpp index eb02b940..bb9a6d0a 100644 --- a/tutorials/Tutorial_204_Viewer_Qt/window.cpp +++ b/tutorials/Tutorial_204_Viewer_Qt/window.cpp @@ -322,12 +322,14 @@ namespace easy3d { bool Window::okToContinue() { if (isWindowModified()) { - int r = QMessageBox::warning(this, tr("Viewer"), - tr("The model has been modified.\n" - "Do you want to save your changes?"), - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + QMessageBox::StandardButton r = QMessageBox::warning( + this, + tr("Viewer"), + tr("The model has been modified.\n" + "Do you want to save your changes?"), + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, + QMessageBox::Yes + ); if (r == QMessageBox::Yes) return onSave(); else if (r == QMessageBox::Cancel)