Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 и др #159

Open
wants to merge 74 commits into
base: basesManagement
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
710fbd1
Исправил ошибку при при форматировании текста как код
PavelSann May 4, 2021
f6a3514
new mimetex from http://deb.debian.org/debian/pool/main/m/mimetex/mim…
Feb 13, 2022
7f52a70
mimetex: fix some compiler warnings
Feb 13, 2022
79af904
mimetex: fix/mask compile warnings
Feb 13, 2022
994df07
mimetex: remove implicitly unused var
Feb 13, 2022
2932414
mimetex: remove implicitly unused var
Feb 13, 2022
3cc087c
mimetex: remove unused functions new_chardef, delete_chardef
Feb 13, 2022
3a59adb
mimetex: remove unused functions rastile, cstruct_chardef, rastright,…
Feb 13, 2022
6f2547e
mimetex: remove unused cstruct_raster()
Feb 13, 2022
0a61790
mimetex: remove unused emit_string()
Feb 13, 2022
2708797
mimetex: move hex_bitmap() and xbitmap_raster() undef ifdef
Feb 13, 2022
88a07a4
mimetex: danger mask some warnings
Feb 13, 2022
5961450
mimetex: return code for windows build
Apr 11, 2022
b1b5fbe
mimetex: mask warning about double to int assignment
Apr 11, 2022
29733c0
fix warning 'Invalid path data; path truncated.' - use svgo for probl…
May 24, 2022
2fdcbec
remove qt4 version of qtsingleapplication, take significant updates o…
May 24, 2022
1909547
qtSingleApplication fixes for Qt6 and for windows building
May 24, 2022
3e7dff9
grammar: cant -> can't
Mar 30, 2022
60e0d84
delete unused code
Mar 30, 2022
51fd686
fix some include paths
Feb 13, 2022
5bc8b08
initial cmake support
May 24, 2022
f732047
remove ifdef's for Qt < 5.13
Mar 30, 2022
6161e53
grammar
Mar 30, 2022
c997e3e
fix 'dangling-else' warning. Use c++11 range-based for loop instead o…
Mar 30, 2022
a69bae8
fix uninitialized warning
Mar 30, 2022
09eda8a
remove unused instead of fix deprecation warning
Mar 31, 2022
5e7a6d5
fix deprecation: use default ctor for WindowFlags instead of 0
Mar 31, 2022
ef693c9
fix deprecation: QComboBox::currentIndexChanged now use index instead…
Mar 31, 2022
6b61878
fix deprecation: QLayout::setMargin
Mar 31, 2022
379dce2
fix deprecation: QPainter::HighQualityAntialiasing
Mar 31, 2022
8827bf6
fix deprecation: Qt::SystemLocaleDate
Mar 31, 2022
9ba0c8c
fix deprecation: different small changes
Mar 31, 2022
33eb772
fix deprecation: QPrinter.pageRect
Mar 31, 2022
756f50d
fix deprecation: QLabel::pixmap
May 24, 2022
2961d1b
remove unused vars
Apr 1, 2022
f5ea33d
use QString Multi-arg instead of several arg usage (warning clazy-qst…
Apr 1, 2022
29b1a11
simplify code instead of fix QString.mid() warning
Apr 1, 2022
a1182c0
avoid copying at for loops. See also
Apr 1, 2022
6005865
fix different clazy warnings
Apr 1, 2022
e499786
fix cellType can be uninitialized warning: specify its type as enum f…
Apr 1, 2022
f72a706
fix warning: virtual call from ctor bypass virtual dispatch
Apr 1, 2022
08d567c
fix signal-slots warnings
Apr 1, 2022
1c280fd
switch to Qt6 with Core5Compat
May 24, 2022
2464cfe
Qt6: high dpi by default now
Apr 2, 2022
c789edc
Qt6: QTextDocument::toHtml() save to UTF-8 only, QTextStream use UTF-…
Apr 2, 2022
bf63cee
Qt6: use QMetaType::Type instead of QVariant::Type
Apr 2, 2022
7872294
Qt6: use includes instead of forward declarations
Apr 2, 2022
e3238e6
Qt6: use QRegularExpression instead of deprecated QRegExp
May 23, 2022
a1e94f2
Qt6: variuos small fixes
May 23, 2022
f63d2bd
Qt6: QApplication->desktop() was deleted, can't easily find replaceme…
Apr 2, 2022
59e54e7
Qt6 without compat: minor changes
May 24, 2022
9d06506
Qt6 without compat: remove usage QTextCodec. Possible regression, but…
Apr 2, 2022
1a538af
Qt6: QAbstractItemView::startDrag() must havee 1 arg
May 24, 2022
d965d9c
Qt6: fixes after rebase to basesManagement branch
Apr 15, 2022
1b5b270
shorten code
Apr 5, 2022
a683542
remove unused code
Apr 5, 2022
d9f70dd
translation:
Apr 5, 2022
4bd2f07
cmake: support MSVC
Apr 11, 2022
de6f43f
run external commands directly (without shell); rename '*syncro*' to …
May 24, 2022
301174f
refactoring: remove AppConfigUpdater, shorten code, make it more effi…
May 24, 2022
233c188
fix formulas: try to search system mimetex, fix passing args, do not …
Apr 6, 2022
bf91c7b
do not use 'using namespace std;' - was MSVC error C2872 (see c++17 a…
Apr 10, 2022
23782a0
little simplification
Apr 11, 2022
026d83d
simplify random-seed-related code (not portable and looks overenginee…
May 24, 2022
cde7e16
#if 0 unused code, that broke windows build
Apr 10, 2022
dd853d8
fix MSVC warning: make sizeCoefficient double (was float)
Apr 10, 2022
8d5f4f1
fix MSVC small warnings
Apr 10, 2022
25ef94f
build deb/rpm with cpack
May 23, 2022
695e356
remove qmake files, rpm spec and mytetra.run; update readme
Apr 12, 2022
151efc3
return back building with Qt5
May 24, 2022
67b47ea
add windows install target
May 25, 2022
c615f96
add github actions for build win/deb packages
May 25, 2022
986a53b
small fixes mainly related to Qt6.4
Nov 26, 2022
ae933cc
update version of install-qt-version
Apr 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ubuntu_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ubuntu_release

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 6.4.0

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_QT6=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Package
run: cpack -G DEB
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_${{github.sha}}.deb
path: ${{github.workspace}}/build/mytetra*.deb
39 changes: 39 additions & 0 deletions .github/workflows/ubuntu_release_qt5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ubuntu_release_qt5

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_QT6=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Package
run: cpack -G DEB
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_qt5_${{github.sha}}.deb
path: ${{github.workspace}}/build/mytetra*.deb
42 changes: 42 additions & 0 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: windows_release

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 6.4.0

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_SYSTEM_MIMETEX=OFF -DUSE_QT6=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build

- name: Package
run: windeployqt --verbose 2 --no-compiler-runtime ${{github.workspace}}/build/mytetra_distr/mytetra.exe
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_${{github.sha}}
path: ${{github.workspace}}/build/mytetra_distr/
42 changes: 42 additions & 0 deletions .github/workflows/windows_release_qt5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: windows_release_qt5

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_SYSTEM_MIMETEX=OFF -DUSE_QT6=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build

- name: Package
run: windeployqt --verbose 2 --no-compiler-runtime ${{github.workspace}}/build/mytetra_distr/mytetra.exe
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_qt5_${{github.sha}}
path: ${{github.workspace}}/build/mytetra_distr/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ qrc_mytetra.cpp
/app/bin/*
!/app/bin/resource
!/app/bin/resource/*
!/app/bin/translations.qrc
!/app/bin/mytetra.qrc
!/app/bin/icons.qrc

Expand Down Expand Up @@ -59,3 +60,4 @@ qrc_*.cpp

/app/ui_*
/app/user*appdatalocal*
CMakeLists.txt.user
116 changes: 116 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
cmake_minimum_required(VERSION 3.22)
project("mytetra" LANGUAGES "C" "CXX")

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
include(GetGitRevisionDescription)
git_describe_working_tree(APP_VERSION)

message("compiler: ${CMAKE_CXX_COMPILER_ID}\nbuild type: ${CMAKE_BUILD_TYPE}\napp version:${APP_VERSION}")

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_C_FLAGS "/W3 /WX /EHsc /O2")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /permissive-") #`/permissive-` somewhy required for Qt5 build

set(WIN_INSTALL_DIR "${CMAKE_BINARY_DIR}/mytetra_distr/")

# add necessary MSVC libraries to windows package. windeployqt will add necessary Qt-related libraries.
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${WIN_INSTALL_DIR}")
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(GCC_WARNS "-Wall -Wextra -Werror")
set(CMAKE_C_FLAGS_DEBUG "${GCC_WARNS} -O0 -ggdb3")
set(CMAKE_C_FLAGS_RELEASE "${GCC_WARNS} -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")

include(CheckPIESupported)
check_pie_supported() # rpmlint wants PIE
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "building under MacOS not supported")
endif()

option(USE_QT6 "Use Qt6 instead of Qt5" ON)

if(USE_QT6)
find_package(Qt6 COMPONENTS Core Linguist Network PrintSupport Widgets Xml REQUIRED)
set(QT_LIBS Qt6::Core Qt6::Network Qt6::PrintSupport Qt6::Widgets Qt6::Xml)
else()
find_package(Qt5 COMPONENTS Core LinguistTools Network PrintSupport Widgets Xml REQUIRED)
set(QT_LIBS Qt5::Core Qt5::Network Qt5::PrintSupport Qt5::Widgets Qt5::Xml)
endif()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

option(USE_SYSTEM_MIMETEX "If off, build own version of mimetex. Major linux distros have mimetex package, so no need one more" ON)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(GNUInstallDirs)
set(CMAKE_INSTALL_PREFIX "/usr")
install(FILES "app/desktop/any/mytetra.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications/")
install(FILES "app/desktop/mytetra.png" DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps/")
install(FILES "app/desktop/mytetra.svg" DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/scalable/apps/")
endif()

add_subdirectory("app/src")
if (NOT USE_SYSTEM_MIMETEX)
add_subdirectory("thirdParty/mimetex")
endif()

find_package(Doxygen OPTIONAL_COMPONENTS dot)
if (DOXYGEN_FOUND)
# output inside "${CMAKE_CURRENT_BINARY_DIR}/html/"
doxygen_add_docs(doc ".." WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/app/doc")
endif()


set(CPACK_PACKAGE_NAME "mytetra")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Personal manager for information accumulation")
set(CPACK_PACKAGE_VERSION "${APP_VERSION}")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://webhamster.ru/site/page/index/articles/projectcode/105")
set(CPACK_STRIP_FILES TRUE)
set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
set(CPACK_RPM_PACKAGE_DESCRIPTION "This is effective personal manager for information accumulation.")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/icons")

string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" DEBIAN_APP_VERSION "${APP_VERSION}")
set(CPACK_DEBIAN_PACKAGE_VERSION "${DEBIAN_APP_VERSION}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sergey M. Stepanov <[email protected]>")
if(USE_QT6)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6,libqt6core6,libqt6gui6,libqt6network6,libqt6printsupport6,libqt6widgets6,libqt6xml6")
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6,libqt5core5a,libqt5gui5,libqt5network5,libqt5printsupport5,libqt5widgets5,libqt5xml5")
endif()
set(CPACK_GENERATOR "DEB" "RPM")
include(CPack)


# Use only Release build type when building packages.
# Generate packages with 'cpack -G DEB/RPM'.
# To build RPM need to install cmake gcc-c++ git rpmdevtools qt{5/6}-qtbase qt6-tools/{qt5-qttools qt5-qttools-devel qt5-linguist}.
# Recommend to check result with {rpmlint + desktop-file-utils}/lintian.
# To build DEB need to install cmake g++ linguist-qt6 qt6-base-dev qt6-l10n-tools qt6-tools-dev qt6-tools-dev-tools.
# For Qt5 version install qtbase5-dev qttools5-dev qttools5-dev-tools instead of qt6-related packages.
# If using virtual machine need to install libgl1-mesa-dev also (https://forum.qt.io/post/633525).


# to run static analysis:
# scan-build cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ <SRC_DIR>
# scan-build make

# TODO:
# more warnings check
# static analyzer
# option for build crypto
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ MyTetra - smart manager for information collecting
MyTetra is open source and cross platform personal manager for information accumulation.
It is powerful program for data memorization and structuring notes.

Build status
======================
![ubuntu build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/ubuntu_release.yml/badge.svg?branch=experimental)
![ubuntu Qt5 build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/ubuntu_release_qt5.yml/badge.svg?branch=experimental)

![windows build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/windows_release.yml/badge.svg?branch=experimental)
![windows Qt5 build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/windows_release_qt5.yml/badge.svg?branch=experimental)

Repository mytetra_dev
======================
Expand Down Expand Up @@ -45,7 +52,7 @@ RUS: Основной репозитарий исходников для раз
* название метода строится по принципу: этоМетодКласса;
* название переменных строится по принципу: этоПеременная;
* Открывающая "{" и закрывающая блок скобка "}" должны стоять на отдельных строчках.
* Каждый вновь создаваемый метод должен содержать комментарий, описывающий что делает метод. Так же желательно описать назначение параметров метода;
* Каждый вновь создаваемый метод должен содержать комментарий, описывающий что делает метод. Также желательно описать назначение параметров метода;
* В заголовочном файле класса, после секции #include необходимо в комментарии написать назначение класса.
* Каждый заголовочный файл должен иметь следующую конструкцию:

Expand Down Expand Up @@ -81,7 +88,8 @@ MyTetra является программой, написанной по при

В Linux сборка проводится командами:
```
qmake .
cd <build dir>
сmake <src dir>
make
```

Expand All @@ -92,21 +100,11 @@ make install

Установленный бинарник размещается по пути:
```
/usr/local/bin/mytetra
/usr/bin/mytetra
```

В Linux, Windows и MacOs сборку можно сделать через QtCreator.
Для этого в QtCreator надо открыть проект mytetra.pro, и выбрать:
Для этого в QtCreator надо открыть корневой CMakeLists.txt и выбрать:
```
Сборка - Собрать проект "mytetra"
```

Запуск
======

Для запуска MyTetra надо запустить собранный бинарник.
В разных операционных системах бинарник размещается по разным путям.
Для выяснения, по какому пути расположен собранный или установленный бинарник, надо просмотреть вывод сборки или вывод установки.

Для Linux и MacOs, при сборке генерируется бинарник с именем **mytetra**.
Для Windows при сборке генерируется бинарник с именем **mytetra.exe**.
17 changes: 4 additions & 13 deletions README_ENG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ No additional build libraries are required.

In Linux, the assembly is carried out by the commands:
```
qmake.
cd <build dir>
сmake <src dir>
make
```

Expand All @@ -74,21 +75,11 @@ make install

The installed binary is located along the path:
```
/ usr / local / bin / mytetra
/usr/bin/mytetra
```

On Linux, Windows and MacOs, building can be done through QtCreator.
To do this, open the mytetra.pro project in QtCreator, and select:
To do this, open root CMakeLists.txt in QtCreator, and select:
```
Build - Build project "mytetra"
```

Running
======

To run MyTetra, you need to run the compiled binary.
Different operating systems place the binary in different paths.
To find out which path the built or installed binary is located in, you need to view the build output or the installation output.

For Linux and MacOs, build generates a binary named **mytetra**.
For Windows, the build generates a binary named **mytetra.exe**.
Loading