Merge pull request #1181 from ra3xdh/deprecate_qt5

Deprecate Qt5
This commit is contained in:
Vadim Kuznetsov 2025-01-05 08:29:54 +01:00 committed by GitHub
commit 38434ff353
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 94 additions and 387 deletions

View File

@ -54,54 +54,6 @@ jobs:
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
build-linux-qt5:
runs-on: ubuntu-22.04
continue-on-error: true
needs: setup
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglx-dev libgl1-mesa-dev flex bison gperf dos2unix flex bison gperf dos2unix cups libcups2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: 'Install Qt5'
uses: jurplel/install-qt-action@v4
with:
version: 5.15.2
host: 'linux'
target: 'desktop'
cache: true
arch: 'gcc_64'
install-deps: 'true'
modules: 'qtcharts'
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build'
# Build your program with the given configuration
run: |
cmake --build ${{github.workspace}}/build -j`nproc` --config ${{env.BUILD_TYPE}}
build-linux-appimage-qt6:
runs-on: ubuntu-22.04
needs: setup

View File

@ -39,14 +39,8 @@ endif()
message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX} ${qucs-suite_BINARY_DIR}" )
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets LinguistTools)
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets LinguistTools)
set(QT_VERSION ${Qt6Core_VERSION})
message(STATUS "Qt Version: " ${QT_VERSION})

View File

@ -33,30 +33,15 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
if(QT_VERSION_MAJOR EQUAL 6)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg SvgWidgets)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Svg SvgWidgets)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Svg_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}SvgWidgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Svg_INCLUDE_DIRS}
${Qt6SvgWidgets_INCLUDE_DIRS}
)
else()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Svg_INCLUDE_DIRS}
)
endif()
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -109,13 +94,8 @@ helpdialog.h
)
SET(RESOURCES qucsactivefilter.qrc)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP(QUCS-ACTIVE-FILTER_MOC_SRCS ${QUCS-ACTIVE-FILTER_MOC_HDRS})
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ELSE()
QT5_WRAP_CPP(QUCS-ACTIVE-FILTER_MOC_SRCS ${QUCS-ACTIVE-FILTER_MOC_HDRS})
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ENDIF()
@ -143,13 +123,7 @@ ADD_EXECUTABLE(${QUCS_NAME}activefilter MACOSX_BUNDLE WIN32
${RESOURCES_SRCS} )
if(QT_VERSION_MAJOR EQUAL 6)
TARGET_LINK_LIBRARIES(${QUCS_NAME}activefilter Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::SvgWidgets)
else()
TARGET_LINK_LIBRARIES(${QUCS_NAME}activefilter Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg )
endif()
TARGET_LINK_LIBRARIES(${QUCS_NAME}activefilter Qt6::Core Qt6::Widgets Qt6::Svg Qt6::SvgWidgets)
SET_TARGET_PROPERTIES(${QUCS_NAME}activefilter PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

View File

@ -32,20 +32,14 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
)
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -87,13 +81,8 @@ SET( attenuator_moc_headers qucsattenuator.h )
SET(RESOURCES qucsattenuator.qrc)
if(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( attenuator_moc_sources ${attenuator_moc_headers} )
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
else()
QT5_WRAP_CPP( attenuator_moc_sources ${attenuator_moc_headers} )
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
endif()
IF(APPLE)
# set information on Info.plist file
@ -118,7 +107,7 @@ ADD_EXECUTABLE( ${QUCS_NAME}attenuator MACOSX_BUNDLE WIN32
${attenuator_moc_sources}
${RESOURCES_SRCS} )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}attenuator Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}attenuator Qt6::Core Qt6::Gui Qt6::Widgets )
SET_TARGET_PROPERTIES(${QUCS_NAME}attenuator PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
#INSTALL (TARGETS ${QUCS_NAME}attenuator DESTINATION bin)
#

View File

@ -33,21 +33,15 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
)
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -121,13 +115,8 @@ SET(QUCS-FILTER_MOC_HDRS
SET(RESOURCES qucsfilter.qrc)
if(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP(QUCS-FILTER_MOC_SRCS ${QUCS-FILTER_MOC_HDRS})
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
else()
QT5_WRAP_CPP(QUCS-FILTER_MOC_SRCS ${QUCS-FILTER_MOC_HDRS})
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
endif()
IF(APPLE)
# set information on Info.plist file
@ -153,7 +142,7 @@ ADD_EXECUTABLE(${QUCS_NAME}filter MACOSX_BUNDLE WIN32
${QUCS-FILTER_MOC_SRCS}
${RESOURCES_SRCS} )
TARGET_LINK_LIBRARIES(${QUCS_NAME}filter Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets)
TARGET_LINK_LIBRARIES(${QUCS_NAME}filter Qt6::Core Qt6::Gui Qt6::Widgets)
SET_TARGET_PROPERTIES(${QUCS_NAME}filter PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
INSTALL(TARGETS ${QUCS_NAME}filter

View File

@ -33,30 +33,15 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
if(QT_VERSION_MAJOR EQUAL 6)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg SvgWidgets)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Svg SvgWidgets)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Svg_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}SvgWidgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Svg_INCLUDE_DIRS}
${Qt6SvgWidgets_INCLUDE_DIRS}
)
else()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Svg_INCLUDE_DIRS}
)
endif()
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -104,13 +89,9 @@ SET(QUCS-POWCOMB_MOC_HDRS
)
SET(RESOURCES qucspowercombining.qrc)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP(QUCS-POWCOMB_MOC_SRCS ${QUCS-POWCOMB_MOC_HDRS})
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ELSE()
QT5_WRAP_CPP(QUCS-POWCOMB_MOC_SRCS ${QUCS-POWCOMB_MOC_HDRS})
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ENDIF()
IF(APPLE)
# set information on Info.plist file
@ -136,13 +117,8 @@ ADD_EXECUTABLE(${QUCS_NAME}powercombining MACOSX_BUNDLE WIN32
${QUCS-POWCOMB_MOC_SRCS}
${RESOURCES_SRCS} )
if(QT_VERSION_MAJOR EQUAL 6)
TARGET_LINK_LIBRARIES(${QUCS_NAME}powercombining Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::SvgWidgets)
else()
TARGET_LINK_LIBRARIES(${QUCS_NAME}powercombining Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg )
endif()
TARGET_LINK_LIBRARIES(${QUCS_NAME}powercombining Qt6::Core
Qt6::Widgets Qt6::Svg Qt6::SvgWidgets)
SET_TARGET_PROPERTIES(${QUCS_NAME}powercombining PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

View File

@ -32,16 +32,11 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets Charts)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Charts)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
)
@ -85,13 +80,8 @@ SET( spar_viewer_moc_headers qucs-s-spar-viewer.h codeeditor.h)
SET(RESOURCES qucs-s-spar-viewer.qrc)
if(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( spar_viewer_moc_sources ${spar_viewer_moc_headers} )
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
else()
QT5_WRAP_CPP( spar_viewer_moc_sources ${spar_viewer_moc_headers} )
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
endif()
IF(APPLE)
# set information on Info.plist file
@ -118,7 +108,7 @@ ADD_EXECUTABLE( ${QUCS_NAME}spar-viewer MACOSX_BUNDLE WIN32
codeeditor.cpp
codeeditor.h )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}spar-viewer Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}spar-viewer Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Charts )
SET_TARGET_PROPERTIES(${QUCS_NAME}spar-viewer PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
#INSTALL (TARGETS ${QUCS_NAME}spar-viewer DESTINATION bin)
#

View File

@ -15,10 +15,6 @@
#include <QtGlobal>
#include <complex>
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
using namespace QtCharts;
#endif
class QComboBox;
class QTableWidget;
class QLineEdit;

View File

@ -32,21 +32,15 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets )
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets )
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
)
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -116,13 +110,8 @@ SET( LIB_SRC
SET(RESOURCES qucstrans_.qrc)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( QUCSTRANS_MOC_SRCS ${QUCSTRANS_MOC_HDRS} )
QT6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ELSE()
QT5_WRAP_CPP( QUCSTRANS_MOC_SRCS ${QUCSTRANS_MOC_HDRS} )
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ENDIF()
ADD_LIBRARY(transcalc STATIC ${LIB_SRC} )
@ -151,7 +140,7 @@ ADD_EXECUTABLE(${QUCS_NAME}trans MACOSX_BUNDLE WIN32
${QUCSTRANS_MOC_SRCS}
${RESOURCES_SRCS} )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}trans Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets transcalc )
TARGET_LINK_LIBRARIES( ${QUCS_NAME}trans Qt6::Core Qt6::Gui Qt6::Widgets transcalc )
SET_TARGET_PROPERTIES(${QUCS_NAME}trans PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
#INSTALL(TARGETS ${QUCS_NAME}trans DESTINATION bin)

View File

@ -59,19 +59,13 @@ endif()
add_compile_definitions(HAVE_CONFIG_H)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(WITH_QT6)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport)
include_directories(
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Svg_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Xml_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}PrintSupport_INCLUDE_DIRS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Svg_INCLUDE_DIRS}
${Qt6Xml_INCLUDE_DIRS}
${Qt6PrintSupport_INCLUDE_DIRS}
)
@ -85,13 +79,11 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
IF(QT_VERSION_MAJOR EQUAL 6)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
ENDIF()
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(QT_VERSION ${Qt${QT_VERSION_MAJOR}Core_VERSION})
set(QT_VERSION ${Qt6Core_VERSION})
if (${QT_VERSION} VERSION_LESS "6.7.0")
set(CMAKE_CXX_STANDARD 17)
@ -196,13 +188,8 @@ SET(QUCS_MOC_HDRS
# headers that need to be moc'ed
# generate rules for building source files from bitmap resources
SET(RESOURCES qucs.qrc)
IF(QT_VERSION_MAJOR EQUAL 6)
Qt6_WRAP_CPP( QUCS_MOC_SRCS ${QUCS_MOC_HDRS} )
Qt6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ELSE()
Qt5_WRAP_CPP( QUCS_MOC_SRCS ${QUCS_MOC_HDRS} )
Qt5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
ENDIF()
if(UNIX AND NOT APPLE)
@ -275,8 +262,7 @@ ADD_EXECUTABLE( ${QUCS_NAME} MACOSX_BUNDLE WIN32
#
TARGET_LINK_LIBRARIES( ${QUCS_NAME}
components diagrams dialogs paintings extsimkernels spicecomponents qt3_compat
Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::PrintSupport )
Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Svg Qt6::Xml Qt6::PrintSupport )
SET_TARGET_PROPERTIES(${QUCS_NAME} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
#
# Prepare the installation

View File

@ -245,11 +245,7 @@ spicefile.h
)
IF(QT_VERSION_MAJOR EQUAL 6)
qt6_wrap_cpp(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS})
else()
qt5_wrap_cpp(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS})
endif()
qt6_wrap_cpp(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS})

View File

@ -34,10 +34,6 @@ diagramdialog.h
markerdialog.h
)
IF(QT_VERSION_MAJOR EQUAL 6)
qt6_wrap_cpp( DIAGRAMS_MOC_SRCS ${DIAGRAMS_MOC_HDRS} )
else()
qt5_wrap_cpp( DIAGRAMS_MOC_SRCS ${DIAGRAMS_MOC_HDRS} )
endif()
qt6_wrap_cpp( DIAGRAMS_MOC_SRCS ${DIAGRAMS_MOC_HDRS} )
ADD_LIBRARY(diagrams STATIC ${DIAGRAMS_HDRS} ${DIAGRAMS_SRCS} ${DIAGRAMS_MOC_SRCS})

View File

@ -74,13 +74,7 @@ searchdialog.ui
)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} )
QT6_WRAP_UI( DIALOGS_UIC_SRCS ${DIALOGS_UIC_HDRS} )
else()
QT5_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} )
QT5_WRAP_UI( DIALOGS_UIC_SRCS ${DIALOGS_UIC_HDRS} )
endif()
QT6_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} )
QT6_WRAP_UI( DIALOGS_UIC_SRCS ${DIALOGS_UIC_HDRS} )
ADD_LIBRARY(dialogs STATIC ${DIALOGS_HDRS} ${DIALOGS_SRCS} ${DIALOGS_MOC_SRCS} ${DIALOGS_UIC_SRCS})

View File

@ -48,12 +48,7 @@ simsettingsdialog.h
spicelibcompdialog.h
)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( EXTSIMKERNELS_MOC_SRCS ${EXTSIMKERNELS_MOC_HDRS} )
else()
QT5_WRAP_CPP( EXTSIMKERNELS_MOC_SRCS ${EXTSIMKERNELS_MOC_HDRS} )
endif()
QT6_WRAP_CPP( EXTSIMKERNELS_MOC_SRCS ${EXTSIMKERNELS_MOC_HDRS} )
ADD_LIBRARY(extsimkernels STATIC ${EXTSIMKERNELS_HDRS} ${EXTSIMKERNELS_SRCS} ${EXTSIMKERNELS_MOC_SRCS})

View File

@ -437,7 +437,7 @@ void AbstractSpiceKernel::parseHBOutput(QString ngspice_file, QList<QList<double
continue;
}
if (lin.startsWith("Index")) { // CSV heading
QStringList vars1 = lin.split(" ",qucs::SkipEmptyParts);
QStringList vars1 = lin.split(" ",Qt::SkipEmptyParts);
vars1.removeFirst();
vars1.removeFirst();
QStringList norm_vars;
@ -450,7 +450,7 @@ void AbstractSpiceKernel::parseHBOutput(QString ngspice_file, QList<QList<double
var_list.append(norm_vars);
}
if ((lin.contains(QRegularExpression("\\d*\\.\\d+[+-]*[eE]*[\\d]*")))) { // CSV dataline
QStringList vals = lin.split(" ",qucs::SkipEmptyParts);
QStringList vals = lin.split(" ",Qt::SkipEmptyParts);
QList <double> sim_point;
sim_point.clear();
for (int i=1;i<vals.count();i++) {
@ -495,7 +495,7 @@ void AbstractSpiceKernel::parseFourierOutput(QString ngspice_file, QList<QList<d
QString lin = ngsp_data.readLine();
if (lin.isEmpty()) continue;
if (lin.contains("Fourier analysis for")) {
QStringList tokens = lin.split(sep,qucs::SkipEmptyParts);
QStringList tokens = lin.split(sep,Qt::SkipEmptyParts);
QString var; // TODO chech
for (const QString& var1 : tokens) {
if (var1.contains('(')&&var1.contains(')')) {
@ -717,8 +717,8 @@ void AbstractSpiceKernel::parseDC_OPoutputXY(QString xyce_file)
QTextStream ngsp_data(&ofile);
QStringList lines = ngsp_data.readAll().split("\n");
if (lines.count()>=2) {
QStringList nods = lines.at(0).split(QRegularExpression("\\s"),qucs::SkipEmptyParts);
QStringList vals = lines.at(1).split(QRegularExpression("\\s"),qucs::SkipEmptyParts);
QStringList nods = lines.at(0).split(QRegularExpression("\\s"), Qt::SkipEmptyParts);
QStringList vals = lines.at(1).split(QRegularExpression("\\s"), Qt::SkipEmptyParts);
QStringList::iterator n,v;
for(n = nods.begin(),v = vals.begin();n!=nods.end()||v!=vals.end();n++,v++) {
if ((*n).startsWith("I(")) {
@ -918,7 +918,7 @@ bool AbstractSpiceKernel::extractASCIISamples(QString &lin, QTextStream &ngsp_da
sim_point.append(indep_val);
for (int i=0;i<NumVars;i++) {
if (isComplex) {
QStringList lst = ngsp_data.readLine().split(sep,qucs::SkipEmptyParts);
QStringList lst = ngsp_data.readLine().split(sep, Qt::SkipEmptyParts);
if (lst.count()==2) {
double re_dep_val = lst.at(0).toDouble(); // for complex sim results
double im_dep_val = lst.at(1).toDouble(); // imaginary part follows
@ -969,7 +969,7 @@ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList<QList<doubl
}
if (lin.startsWith("End of ")) continue;
if (lin.startsWith("Index ",Qt::CaseInsensitive)) {
var_list = lin.split(" ",qucs::SkipEmptyParts);
var_list = lin.split(" ", Qt::SkipEmptyParts);
var_list.removeFirst(); // Drop Index
for(int i = 0; i < var_list.count()-1; i++) {
QString var_re = var_list.at(i);
@ -986,7 +986,7 @@ void AbstractSpiceKernel::parseXYCESTDOutput(QString std_file, QList<QList<doubl
}
continue;
} else {
QStringList val_lst = lin.split(" ",qucs::SkipEmptyParts);
QStringList val_lst = lin.split(" ", Qt::SkipEmptyParts);
QList<double> sim_point;
for (int i = 1; i <= var_list.count(); i++ ) {
if (isComplex && i != 1) {
@ -1074,10 +1074,10 @@ void AbstractSpiceKernel::parseResFile(QString resfile, QString &var, QStringLis
while (!swp_data.atEnd()) {
QString lin = swp_data.readLine();
if (var_pattern.match(lin).hasMatch()) {
var = lin.split(sep,qucs::SkipEmptyParts).last();
var = lin.split(sep, Qt::SkipEmptyParts).last();
}
if (point_pattern.match(lin).hasMatch()) {
values.append(lin.split(sep,qucs::SkipEmptyParts).last());
values.append(lin.split(sep, Qt::SkipEmptyParts).last());
}
}
ofile.close();

View File

@ -222,7 +222,7 @@ void Ngspice::createNetlist(QTextStream &stream, int ,
spiceNetlist.append(pc->getSpiceNetlist());
nods = pc->Props.at(1)->Value;
nods.replace(';', ' ');
outputs.append(pc->Props.at(2)->Value.split(';', qucs::SkipEmptyParts));
outputs.append(pc->Props.at(2)->Value.split(';', Qt::SkipEmptyParts));
QRegularExpression ac_rx("^\\s*ac\\s.*", QRegularExpression::CaseInsensitiveOption);
QRegularExpression sp_rx("^\\s*sp\\s.*", QRegularExpression::CaseInsensitiveOption);

View File

@ -125,7 +125,7 @@ QString qucs2spice::convert_netlist(QString netlist, bool xyce)
QString qucs2spice::convert_rcl(const QString& line)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString s1 = lst.takeFirst();
s += s1.remove(':');
s += " " + lst.takeFirst();
@ -141,7 +141,7 @@ QString qucs2spice::convert_header(QString line)
{
QString s = line;
s.replace(".Def:",".SUBCKT ");
QStringList lst = s.split(' ',qucs::SkipEmptyParts);
QStringList lst = s.split(' ', Qt::SkipEmptyParts);
lst.insert(2," gnd "); // ground
s = lst.join(" ");
s += "\n";
@ -151,7 +151,7 @@ QString qucs2spice::convert_header(QString line)
QString qucs2spice::convert_diode(QString line,bool xyce)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -168,7 +168,7 @@ QString qucs2spice::convert_diode(QString line,bool xyce)
QString qucs2spice::convert_mosfet(QString line, bool xyce)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -210,7 +210,7 @@ QString qucs2spice::convert_mosfet(QString line, bool xyce)
QString qucs2spice::convert_jfet(const QString& line, bool xyce)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -241,7 +241,7 @@ QString qucs2spice::convert_jfet(const QString& line, bool xyce)
QString qucs2spice::convert_bjt(const QString& line)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -291,7 +291,7 @@ QString qucs2spice::convert_ccvs(const QString& line)
QString qucs2spice::convert_ccs(const QString& line, bool voltage)
{
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -323,7 +323,7 @@ QString qucs2spice::convert_vcvs(const QString& line)
QString qucs2spice::convert_vcs(const QString& line,bool voltage)
{
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString name = lst.takeFirst();
auto idx = name.indexOf(':');
name = name.right(name.size()-idx-1); // name
@ -346,7 +346,7 @@ QString qucs2spice::convert_vcs(const QString& line,bool voltage)
QString qucs2spice::convert_dc_src(const QString& line)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString s1 = lst.takeFirst();
s += s1.remove(':');
s += " " + lst.takeFirst();
@ -361,7 +361,7 @@ QString qucs2spice::convert_dc_src(const QString& line)
QString qucs2spice::convert_edd(const QString& line, QStringList &EqnsAndVars)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QStringList nods;
QString nam = lst.takeFirst().remove(':');
@ -406,7 +406,7 @@ QString qucs2spice::convert_edd(const QString& line, QStringList &EqnsAndVars)
QString qucs2spice::convert_subckt(QString line)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString s1 = lst.takeFirst();
s += "X" + s1.remove("Sub:") + " gnd ";
@ -440,7 +440,7 @@ QString qucs2spice::convert_subckt(QString line)
QString qucs2spice::convert_gyrator(QString line)
{
QString s="";
QStringList lst = line.split(" ",qucs::SkipEmptyParts);
QStringList lst = line.split(" ", Qt::SkipEmptyParts);
QString Name = lst.takeFirst();
Name = Name.section(':',1,1);
QString n1 = lst.takeFirst();

View File

@ -109,7 +109,7 @@ bool S2Spice::convertTouchstone(QTextStream *stream)
}
/* input impedances */
QStringList tmp_lst = next_line.split(" ",qucs::SkipEmptyParts);
QStringList tmp_lst = next_line.split(" ", Qt::SkipEmptyParts);
z[0] = tmp_lst.at(tmp_lst.count()-1).toDouble();
for (int i = 0; i < ports; i++ ) {
if ( a_z0 < 0 ) { /* takes the Z value from the input file */
@ -140,10 +140,10 @@ bool S2Spice::convertTouchstone(QTextStream *stream)
break;
}
if(next_line.at(0)=='!') continue;
tmp_lst = next_line.split(QRegularExpression("[ \\t]"), qucs::SkipEmptyParts);
tmp_lst = next_line.split(QRegularExpression("[ \\t]"), Qt::SkipEmptyParts);
if (tmp_lst.count() < 2*(ports*ports)+1) {
while (in_stream.readLineInto(&next_line)) { // line continuation
auto new_items = next_line.split(QRegularExpression("[ \\t]"), qucs::SkipEmptyParts);
auto new_items = next_line.split(QRegularExpression("[ \\t]"), Qt::SkipEmptyParts);
tmp_lst.append(new_items);
if (tmp_lst.count() >= 2*(ports*ports)+1 ) break;
}

View File

@ -305,7 +305,7 @@ int spicecompat::getPins(const QString &file, const QString &compname, QStringLi
}
if (subckt_header.match(lin).hasMatch()) {
QStringList lst2 = lin.split(sep,qucs::SkipEmptyParts);
QStringList lst2 = lin.split(sep, Qt::SkipEmptyParts);
QString name = lin.section(sep,1,1,QString::SectionSkipEmpty).toLower();
QString refname = compname.toLower();
if (name != refname) continue;

View File

@ -143,7 +143,7 @@ bool loadSettings()
QucsSettings.GraphAntiAliasing = _settings::Get().item<bool>("GraphAntiAliasing");
QucsSettings.TextAntiAliasing = _settings::Get().item<bool>("TextAntiAliasing");
QucsSettings.fullTraceName = _settings::Get().item<bool>("fullTraceName");
QucsSettings.RecentDocs = _settings::Get().item<QString>("RecentDocs").split("*",qucs::SkipEmptyParts);
QucsSettings.RecentDocs = _settings::Get().item<QString>("RecentDocs").split("*", Qt::SkipEmptyParts);
QucsSettings.numRecentDocs = QucsSettings.RecentDocs.count();
QucsSettings.spiceExtensions << "*.sp" << "*.cir" << "*.spc" << "*.spi";
@ -762,11 +762,6 @@ int main(int argc, char *argv[])
QucsSettings.maxUndo = 20;
QucsSettings.NodeWiring = 0;
#if QT_VERSION < 0x060000
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling,true);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps,true);
#endif
// initially center the application
QApplication a(argc, argv);
//QDesktopWidget *d = a.desktop();

View File

@ -26,16 +26,6 @@
#define Q_UINT32 uint32_t
namespace qucs {
#if QT_VERSION >= 0x050e00
const auto SkipEmptyParts = Qt::SkipEmptyParts;
#else
const auto SkipEmptyParts = QString::SkipEmptyParts;
#endif
}
class Schematic;
namespace misc {

View File

@ -39,11 +39,7 @@ id_dialog.h
)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( PAINTINGS_MOC_SRCS ${PAINTINGS_MOC_HDRS} )
else()
QT5_WRAP_CPP( PAINTINGS_MOC_SRCS ${PAINTINGS_MOC_HDRS} )
endif()
QT6_WRAP_CPP( PAINTINGS_MOC_SRCS ${PAINTINGS_MOC_HDRS} )
ADD_LIBRARY(paintings STATIC ${PAINTINGS_HDRS} ${PAINTINGS_SRCS} ${PAINTINGS_MOC_SRCS} )

View File

@ -31,10 +31,6 @@ q3frame.h
)
IF(QT_VERSION_MAJOR EQUAL 6)
QT6_WRAP_CPP( QT3_COMPAT_SRCS ${QT3_COMPAT_MOC_HDRS} )
else()
QT5_WRAP_CPP( QT3_COMPAT_SRCS ${QT3_COMPAT_MOC_HDRS} )
endif()
QT6_WRAP_CPP( QT3_COMPAT_SRCS ${QT3_COMPAT_MOC_HDRS} )
ADD_LIBRARY(qt3_compat STATIC ${QT3_COMPAT_HDRS} ${QT3_COMPAT_SRCS})

View File

@ -1141,17 +1141,12 @@ void Q3ScrollView::mouseMoveEvent(QMouseEvent *e)
#ifndef QT_NO_WHEELEVENT
void Q3ScrollView::wheelEvent(QWheelEvent *e)
{
#if QT_VERSION >= 0x050f00
QPoint pe(e->globalPosition().x(),e->globalPosition().y());
QPoint pg = viewport()->mapFromGlobal(pe);
QPointF pgf(pg.x(),pg.y());
QWheelEvent ce(pgf,
e->globalPosition(), e->pixelDelta(), e->angleDelta(),
e->buttons(), e->modifiers(), e->phase(), e->inverted());
#else
QWheelEvent ce(viewport()->mapFromGlobal(e->globalPos()),
e->globalPos(), e->delta(), e->buttons(), e->modifiers());
#endif
viewportWheelEvent(&ce);
if (!ce.isAccepted()) {
if (e->angleDelta().x() != 0 && horizontalScrollBar())
@ -1508,11 +1503,7 @@ bool Q3ScrollView::eventFilter(QObject *obj, QEvent *e)
if (disabled)
return false;
if (d->drag_autoscroll) {
#if QT_VERSION >= 0x060000
QPoint vp = ((QDragMoveEvent*) e)->position().toPoint();
#else
QPoint vp = ((QDragMoveEvent*) e)->pos();
#endif
QRect inside_margin(autoscroll_margin, autoscroll_margin,
visibleWidth() - autoscroll_margin * 2,
visibleHeight() - autoscroll_margin * 2);
@ -1752,13 +1743,8 @@ void Q3ScrollView::viewportResizeEvent(QResizeEvent * /* event */)
*/
void Q3ScrollView::viewportMousePressEvent(QMouseEvent* e)
{
#if QT_VERSION >= 0x060000
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPosition(), e->button(), e->buttons(), e->modifiers());
#else
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPos(), e->button(), e->buttons(), e->modifiers());
#endif
contentsMousePressEvent(&ce);
if (!ce.isAccepted())
e->ignore();
@ -1774,13 +1760,8 @@ void Q3ScrollView::viewportMousePressEvent(QMouseEvent* e)
*/
void Q3ScrollView::viewportMouseReleaseEvent(QMouseEvent* e)
{
#if QT_VERSION >= 0x060000
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPosition(), e->button(), e->buttons(), e->modifiers());
#else
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPos(), e->button(), e->buttons(), e->modifiers());
#endif
contentsMouseReleaseEvent(&ce);
if (!ce.isAccepted())
e->ignore();
@ -1796,13 +1777,8 @@ void Q3ScrollView::viewportMouseReleaseEvent(QMouseEvent* e)
*/
void Q3ScrollView::viewportMouseDoubleClickEvent(QMouseEvent* e)
{
#if QT_VERSION >= 0x060000
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPosition(), e->button(), e->buttons(), e->modifiers());
#else
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPos(), e->button(), e->buttons(), e->modifiers());
#endif
contentsMouseDoubleClickEvent(&ce);
if (!ce.isAccepted())
e->ignore();
@ -1818,13 +1794,8 @@ void Q3ScrollView::viewportMouseDoubleClickEvent(QMouseEvent* e)
*/
void Q3ScrollView::viewportMouseMoveEvent(QMouseEvent* e)
{
#if QT_VERSION >= 0x060000
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPosition(), e->button(), e->buttons(), e->modifiers());
#else
QMouseEvent ce(e->type(), viewportToContents(e->pos()),
e->globalPos(), e->button(), e->buttons(), e->modifiers());
#endif
contentsMouseMoveEvent(&ce);
if (!ce.isAccepted())
e->ignore();
@ -1842,15 +1813,9 @@ void Q3ScrollView::viewportMouseMoveEvent(QMouseEvent* e)
*/
void Q3ScrollView::viewportDragEnterEvent(QDragEnterEvent* e)
{
#if QT_VERSION >= 0x060000
QDragEnterEvent de(viewportToContents(e->position().toPoint()),
e->possibleActions(),e->mimeData(),
e->buttons(),e->modifiers());
#else
QDragEnterEvent de(viewportToContents(e->pos()),
e->possibleActions(),e->mimeData(),
e->mouseButtons(),e->keyboardModifiers());
#endif
//e->setPoint(viewportToContents(e->pos()));
contentsDragEnterEvent(&de);
if (de.isAccepted()) e->accept();
@ -1868,15 +1833,9 @@ void Q3ScrollView::viewportDragEnterEvent(QDragEnterEvent* e)
*/
void Q3ScrollView::viewportDragMoveEvent(QDragMoveEvent* e)
{
#if QT_VERSION >= 0x060000
QDragMoveEvent de(viewportToContents(e->position().toPoint()),
e->possibleActions(),e->mimeData(),
e->buttons(),e->modifiers());
#else
QDragMoveEvent de(viewportToContents(e->pos()),
e->possibleActions(),e->mimeData(),
e->mouseButtons(),e->keyboardModifiers());
#endif
//e->setPoint(viewportToContents(e->pos()));
contentsDragMoveEvent(&de);
if (de.isAccepted()) e->accept();
@ -1907,15 +1866,9 @@ void Q3ScrollView::viewportDragLeaveEvent(QDragLeaveEvent* e)
*/
void Q3ScrollView::viewportDropEvent(QDropEvent* e)
{
#if QT_VERSION >= 0x060000
QDropEvent de(viewportToContents(e->position().toPoint()),
e->possibleActions(),e->mimeData(),
e->buttons(),e->modifiers());
#else
QDropEvent de(viewportToContents(e->pos()),
e->possibleActions(),e->mimeData(),
e->mouseButtons(),e->keyboardModifiers());
#endif
//e->setPoint(viewportToContents(e->pos()));
contentsDropEvent(&de);
if (de.isAccepted()) e->accept();
@ -1946,17 +1899,12 @@ void Q3ScrollView::viewportWheelEvent(QWheelEvent* e)
be sent to the focus widget if the widget-under-mouse doesn't want
the event itself.
*/
#if QT_VERSION >= 0x050f00
QPoint pe(e->globalPosition().x(),e->globalPosition().y());
QPoint pg = viewport()->mapFromGlobal(pe);
QPointF pgf(pg.x(),pg.y());
QWheelEvent ce(pgf,
e->globalPosition(), e->pixelDelta(), e->angleDelta(),
e->buttons(), e->modifiers(), e->phase(), e->inverted());
#else
QWheelEvent ce(viewport()->mapFromGlobal(e->globalPos()),
e->globalPos(), e->delta(), e->buttons(), e->modifiers());
#endif
contentsWheelEvent(&ce);
if (ce.isAccepted())
e->accept();

View File

@ -89,9 +89,6 @@
QucsApp::QucsApp()
{
#if QT_VERSION_MAJOR == 5
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#endif
windowTitle = misc::getWindowTitle();
setWindowTitle(windowTitle);

View File

@ -1810,7 +1810,7 @@ int Schematic::adjustPortNumbers()
VInfo = VHDL_File_Info(Name, true);
if (!VInfo.PortNames.isEmpty())
Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts);
Names = VInfo.PortNames.split(",", Qt::SkipEmptyParts);
for (pp = a_SymbolPaints.first(); pp != 0; pp = a_SymbolPaints.next())
if (pp->Name == ".ID ") {
@ -1818,11 +1818,11 @@ int Schematic::adjustPortNumbers()
id->Prefix = VInfo.EntityName.toUpper();
id->Parameter.clear();
if (!VInfo.GenNames.isEmpty())
GNames = VInfo.GenNames.split(",", qucs::SkipEmptyParts);
GNames = VInfo.GenNames.split(",", Qt::SkipEmptyParts);
if (!VInfo.GenTypes.isEmpty())
GTypes = VInfo.GenTypes.split(",", qucs::SkipEmptyParts);
GTypes = VInfo.GenTypes.split(",", Qt::SkipEmptyParts);
if (!VInfo.GenDefs.isEmpty())
GDefs = VInfo.GenDefs.split(",", qucs::SkipEmptyParts);
GDefs = VInfo.GenDefs.split(",", Qt::SkipEmptyParts);
;
for (Number = 1, it = GNames.begin(); it != GNames.end(); ++it) {
id->Parameter.append(
@ -1871,7 +1871,7 @@ int Schematic::adjustPortNumbers()
else
VInfo = Verilog_File_Info(Name, true);
if (!VInfo.PortNames.isEmpty())
Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts);
Names = VInfo.PortNames.split(",", Qt::SkipEmptyParts);
for (pp = a_SymbolPaints.first(); pp != 0; pp = a_SymbolPaints.next())
if (pp->Name == ".ID ") {
@ -1918,7 +1918,7 @@ int Schematic::adjustPortNumbers()
VInfo = VerilogA_File_Info(Name, true);
if (!VInfo.PortNames.isEmpty())
Names = VInfo.PortNames.split(",", qucs::SkipEmptyParts);
Names = VInfo.PortNames.split(",", Qt::SkipEmptyParts);
for (pp = a_SymbolPaints.first(); pp != 0; pp = a_SymbolPaints.next())
if (pp->Name == ".ID ") {
@ -2340,15 +2340,9 @@ void Schematic::contentsWheelEvent(QWheelEvent *Event)
// zoom factor scaled according to the wheel delta, to accommodate
// values different from 60 (slower or faster zoom)
double scaleCoef = pow(1.1, verticalWheelAngleDelta / 60.0);
#if QT_VERSION >= 0x050f00
const QPoint pointer{
static_cast<int>(Event->position().x()),
static_cast<int>(Event->position().y())};
#else
const QPoint pointer{
Event->pos().x(),
Event->pos().y()};
#endif
zoomAroundPoint(scaleCoef, pointer);
}
// Scroll vertically
@ -2557,13 +2551,8 @@ void Schematic::contentsDropEvent(QDropEvent *Event)
return;
}
#if QT_VERSION >= 0x060000
auto ev_pos = Event->position();
QPoint inModel = contentsToModel(ev_pos.toPoint());
#else
auto ev_pos = Event->pos();
QPoint inModel = contentsToModel(ev_pos);
#endif
//QMouseEvent e(QEvent::MouseButtonPress, ev_pos, Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
QMouseEvent e(QEvent::MouseButtonPress, ev_pos, mapToGlobal(ev_pos), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
@ -2641,11 +2630,7 @@ void Schematic::contentsNativeGestureZoomEvent( QNativeGestureEvent* Event) {
a_App->editText->setHidden(true); // disable edit of component property
const auto factor = 1.0 + Event->value();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const auto pointer = mapFromGlobal(Event->globalPosition().toPoint());
#else
const auto pointer = mapFromGlobal(Event->globalPos());
#endif
zoomAroundPoint(factor,pointer);
}
@ -2658,7 +2643,6 @@ void Schematic::contentsDragMoveEvent(QDragMoveEvent *Event)
return;
}
#if QT_VERSION >= 0x060000
auto ev_pos = Event->position();
/*QMouseEvent e(QEvent::MouseMove,
Event->position(),
@ -2666,10 +2650,6 @@ void Schematic::contentsDragMoveEvent(QDragMoveEvent *Event)
Qt::NoButton,
Qt::NoModifier);*/
QMouseEvent e(QEvent::MouseButtonPress, ev_pos, mapToGlobal(ev_pos), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
#else
QMouseEvent e(QEvent::MouseMove, Event->pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
#endif
a_App->view->MMoveElement(this, &e);
}

View File

@ -299,7 +299,7 @@ int Schematic::savePropsJSON()
continue;
}
if (line.contains("parameter")) {
auto tokens = line.split(QRegularExpression("[\\s=;]"),qucs::SkipEmptyParts);
auto tokens = line.split(QRegularExpression("[\\s=;]"), Qt::SkipEmptyParts);
if (tokens.count() >= 4) {
for(int ic = 0; ic <= tokens.count(); ic++) {
if (tokens.at(ic) == "parameter") {

View File

@ -191,9 +191,6 @@ spicelibcomp.h
)
#QT4_WRAP_CPP(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS})
ADD_LIBRARY(spicecomponents STATIC ${COMPONENTS_HDRS} ${COMPONENTS_SRCS} ${COMPONENTS_MOC_SRCS} )

View File

@ -13,19 +13,11 @@ file (GLOB TRANSLATIONS_FILES qucs_*.ts)
# WARNING: make clean might delete the source .ts files! Danger!
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts" "OFF")
IF(WITH_QT6)
IF (UPDATE_TRANSLATIONS)
QT6_CREATE_TRANSLATION ( QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
ELSE (UPDATE_TRANSLATIONS)
QT6_ADD_TRANSLATION ( QM_FILES ${TRANSLATIONS_FILES})
ENDIF (UPDATE_TRANSLATIONS)
ELSE()
IF (UPDATE_TRANSLATIONS)
QT5_CREATE_TRANSLATION ( QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
ELSE (UPDATE_TRANSLATIONS)
QT5_ADD_TRANSLATION ( QM_FILES ${TRANSLATIONS_FILES})
ENDIF (UPDATE_TRANSLATIONS)
ENDIF()
ADD_CUSTOM_TARGET (translations ALL DEPENDS ${QM_FILES})