Commit 5ef6d226 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make compile against qt6

parent 9cb58500
Pipeline #198752 passed with stage
in 49 seconds
......@@ -47,6 +47,9 @@ add_definitions(-DQT_NO_CAST_TO_ASCII)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ConfigWidgets WidgetsAddons KIO DocTools)
find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6 REQUIRED NO_MODULE COMPONENTS OpenGLWidgets)
endif()
if(KF5DocTools_FOUND AND Qt${QT_MAJOR_VERSION}WebEngineWidgets_FOUND AND KF5ConfigWidgets_FOUND AND KF5WidgetsAddons_FOUND AND KF5KIO_FOUND AND NOT CMAKE_SYSTEM MATCHES Android*)
......
......@@ -19,7 +19,6 @@
#include "kalgebramobile.h"
#include <analitzaplot/plotsmodel.h>
#include <analitza/variables.h>
#include <analitza/expression.h>
#include "../src/consolemodel.h"
......
......@@ -21,10 +21,10 @@
#include <QObject>
#include <QSharedPointer>
#include <analitza/variables.h>
class QModelIndex;
namespace Analitza {
class Variables;
class PlotsModel;
}
......
......@@ -46,7 +46,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
#ifdef Q_OS_ANDROID
QQuickStyle::setStyle("Material");
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv);
#else
......
......@@ -30,6 +30,10 @@ target_link_libraries(kalgebra Qt::Widgets Qt::PrintSupport Qt::WebEngineWidgets
KF5::I18n
KF5::Analitza KF5::AnalitzaWidgets KF5::AnalitzaGui KF5::AnalitzaPlot)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(kalgebra Qt6::OpenGLWidgets)
endif()
install(TARGETS kalgebra ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kalgebra.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
install(FILES kalgebra.xml DESTINATION ${KDE_INSTALL_DATADIR}/katepart5/syntax )
......
......@@ -24,7 +24,7 @@
#include <QDialog>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QRegExpValidator>
#include <QRegularExpressionValidator>
class AskName : public QDialog
{
......@@ -32,7 +32,7 @@ class AskName : public QDialog
AskName(const QString& text, QWidget* parent) : QDialog(parent)
{
edit=new QLineEdit(this);
edit->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[a-zA-Z][\\w]*")), edit));
edit->setValidator(new QRegularExpressionValidator(QRegularExpression(QStringLiteral("[a-zA-Z][\\w]*")), edit));
QDialogButtonBox * buttonBox;
QVBoxLayout *items=new QVBoxLayout(this);
......
......@@ -22,6 +22,7 @@
#include <QObject>
#include <analitza/expression.h>
#include <analitza/analyzer.h>
#include <analitza/variables.h>
class ConsoleModel : public QObject
{
......
......@@ -38,6 +38,7 @@
#include <analitza/value.h>
#include <QVBoxLayout>
#include <QActionGroup>
#include <QHeaderView>
#include <QDockWidget>
#include <QTableView>
......@@ -170,13 +171,13 @@ KAlgebra::KAlgebra(QWidget *parent)
c_menu = menuBar()->addMenu(i18n("C&alculator"));
c_menu->addAction(QIcon::fromTheme(QStringLiteral("document-open")), i18nc("@item:inmenu", "&Load Script..."),
this, SLOT(loadScript()), Qt::CTRL+Qt::Key_L);
this, SLOT(loadScript()), Qt::CTRL | Qt::Key_L);
c_recentScripts=new KRecentFilesAction(QIcon::fromTheme(QStringLiteral("document-open-recent")), i18n("Recent Scripts"), this);
connect(c_recentScripts, SIGNAL(urlSelected(QUrl)), this, SLOT(loadScript(QUrl)));
c_menu->addAction(c_recentScripts);
c_menu->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("@item:inmenu", "&Save Script..."),
this, &KAlgebra::saveScript, Qt::CTRL+Qt::Key_G);
this, &KAlgebra::saveScript, Qt::CTRL | Qt::Key_G);
c_menu->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("@item:inmenu", "&Export Log..."),
this, &KAlgebra::saveLog, QKeySequence::Save);
c_menu->addSeparator();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment