mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Modifications for compile with Qt6
This commit is contained in:
parent
6459548aba
commit
9b8dfed53b
@ -10,7 +10,10 @@ endif()
|
||||
|
||||
find_package(OpenGL)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
if (CEE_USE_QT6)
|
||||
find_package(Qt6 COMPONENTS REQUIRED OpenGLWidgets)
|
||||
set(QT_LIBRARIES Qt6::OpenGLWidgets )
|
||||
elseif (CEE_USE_QT5)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Widgets)
|
||||
set(QT_LIBRARIES Qt5::Widgets)
|
||||
else()
|
||||
@ -44,8 +47,10 @@ QMVMainWindow.h
|
||||
QMVWidget.h
|
||||
)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES} )
|
||||
if (CEE_USE_QT6)
|
||||
qt_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
elseif (CEE_USE_QT5)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT_NAME} ${CEE_CODE_FILES} ${MOC_SOURCE_FILES})
|
||||
|
@ -52,8 +52,13 @@ QSRRunPanel.h
|
||||
QSRSnippetWidget.h
|
||||
)
|
||||
|
||||
|
||||
# Qt
|
||||
if (CEE_USE_QT5)
|
||||
if (CEE_USE_QT6)
|
||||
find_package(Qt6 COMPONENTS REQUIRED OpenGLWidgets)
|
||||
set(QT_LIBRARIES Qt6::OpenGLWidgets )
|
||||
qt_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
elseif (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets OpenGL)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES} )
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
class QStringList;
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -127,7 +127,7 @@ void QSRMainWindow::createActions()
|
||||
}
|
||||
|
||||
m_activateLastUsedSnippetAction = new QAction("Load last used snippet", this);
|
||||
m_activateLastUsedSnippetAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
|
||||
m_activateLastUsedSnippetAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_L));
|
||||
connect(m_activateLastUsedSnippetAction, SIGNAL(triggered()), SLOT(slotRunLastUsedSnippet()));
|
||||
|
||||
m_closeCurrentSnippetAction = new QAction("Close Current Snippet", this);
|
||||
@ -136,19 +136,19 @@ void QSRMainWindow::createActions()
|
||||
// View menu
|
||||
m_showHUDAction = new QAction("Show HUD", this);
|
||||
m_showHUDAction->setCheckable(true);
|
||||
m_showHUDAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H));
|
||||
m_showHUDAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_H));
|
||||
connect(m_showHUDAction, SIGNAL(triggered()), SLOT(slotShowHUD()));
|
||||
|
||||
m_redrawAction = new QAction("Redraw view", this);
|
||||
m_redrawAction ->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
|
||||
m_redrawAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R));
|
||||
connect(m_redrawAction, SIGNAL(triggered()), SLOT(slotViewRedraw()));
|
||||
|
||||
m_multipleRedrawAction = new QAction("Redraw 10 times", this);
|
||||
m_multipleRedrawAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
||||
m_multipleRedrawAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_M));
|
||||
connect(m_multipleRedrawAction, SIGNAL(triggered()), SLOT(slotViewMultipleRedraw()));
|
||||
|
||||
m_multipleRedrawManyAction = new QAction("Redraw 50 times", this);
|
||||
m_multipleRedrawManyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M));
|
||||
m_multipleRedrawManyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_M));
|
||||
connect(m_multipleRedrawManyAction, SIGNAL(triggered()), SLOT(slotViewMultipleRedrawMany()));
|
||||
|
||||
|
||||
@ -360,7 +360,7 @@ void QSRMainWindow::executeTestSnippetInNewWidget(const cvf::String& snippetId,
|
||||
|
||||
// Store ID of this 'last run' snippet in registry
|
||||
QSettings settings("Ceetron", "SnippetRunner");
|
||||
settings.setValue("LastUsedSnippetID", snippetId.toAscii().ptr());
|
||||
settings.setValue("LastUsedSnippetID", cvfqt::Utils::toQString(snippetId));
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
|
||||
using cvfu::TestSnippet;
|
||||
|
@ -45,17 +45,16 @@
|
||||
|
||||
#include "cvfuTestSnippet.h"
|
||||
|
||||
#include "cvfqtGLWidget.h"
|
||||
#include "cvfqtOpenGLWidget.h"
|
||||
|
||||
class QTimer;
|
||||
|
||||
|
||||
#define QSR_USE_OPENGLWIDGET
|
||||
|
||||
#ifdef QSR_USE_OPENGLWIDGET
|
||||
#include "cvfqtOpenGLWidget.h"
|
||||
typedef cvfqt::OpenGLWidget OglWidgetBaseClass;
|
||||
#else
|
||||
#include "cvfqtGLWidget.h"
|
||||
typedef cvfqt::GLWidget OglWidgetBaseClass;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user