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

More QT6 compatibility changes #2662

Merged
merged 7 commits into from
Apr 24, 2021
Merged

More QT6 compatibility changes #2662

merged 7 commits into from
Apr 24, 2021

Conversation

karliss
Copy link
Member

@karliss karliss commented Apr 8, 2021

Your checklist for this pull request

Detailed description

For now should build in minimal config -DCUTTER_QT6=ON -DCUTTER_ENABLE_PYTHON=OFF -DCUTTER_ENABLE_PYTHON_BINDINGS=OFF -DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=OFF

It's necessary to manually disable CUTTER_ENABLE_KSYNTAXHIGHLIGHTING because otherwise it might find the QT5 version of it and then complain that it's incompatible with rest of QT libs which are QT6.

Test plan (required)

  • Ubuntu 16.04 job with oldest supported Qt5 version still builds ✔️
  • test one of the filters QT5-:heavy_check_mark: QT6-:heavy_check_mark:
  • test that filter reset using invalidateRowsFilter works as intended QT5-:heavy_check_mark: QT6-:heavy_check_mark:
  • test color picker
  • when built with Qt6 Cutter opens and basic functionality works ✔️
  • test refactored shortcuts QT5-:heavy_check_mark: QT6-:heavy_check_mark:
  • mouse drag in graph view QT5-:heavy_check_mark: QT6-:heavy_check_mark:
  • navbar drag QT5-:heavy_check_mark: QT6-:heavy_check_mark:

Closing issues

Related #2464

@karliss karliss added the Qt Issues and pull-requests regarding or caused-by the underlying Qt toolkit. label Apr 8, 2021
Qt6 moved some of the functionality to separate modules.
@karliss karliss force-pushed the qt6-regex branch 2 times, most recently from 2231d59 to d20ae67 Compare April 13, 2021 18:59
@karliss karliss marked this pull request as ready for review April 13, 2021 19:18
karliss added 5 commits April 13, 2021 22:45
* Crash caused by list varibles getting initialized after the models
using them. Previously Qt didn't try to access them so early. Move them
to the models as there is no need to share them betwen view and models.
* Fix empty color list by using begin/endResetModel instead of
dataChanged to signal changes in data.
* use typedef for floating point value used in color related API
* changes in screen grabbing API used by color picker
* Some of the API replaced int with QKeyCombination, use typedef in
cutter code
* Use of + operator depracted, replace with recommended "|" operator
* QMouseEvent globalPos and localPos renamed to globalPosition and
position, replace with helper function or use of integer position which
wasn't renamed.
@karliss
Copy link
Member Author

karliss commented Apr 14, 2021

Just noticed one more crash.

Qt doesn't have native language name for some of them. Trying to
capitalize it caused crash.

Use `QLocale(QString)` constructor instead of manually looping and
comparing. The old code incorrectly matched "tr" as "trv".

Don't try to capitalize language name:
* In many cases Qt already returns it capitalized
* capitalization doesn't make sense for some scripts
* in general case splitting first "character" is a hard problem
* in some languages even with latin based scripts name of language isn't
a proper noun which needs to be capitalized
@XVilka
Copy link
Member

XVilka commented Apr 15, 2021

I wonder if it's possible to ship Qt6-based build for Windows also?
And probably migrate from VS2017 to VS2019?
That PySide + MSVC2019 bug was fixed apparently:

@karliss karliss mentioned this pull request Apr 15, 2021
8 tasks
@karliss
Copy link
Member Author

karliss commented Apr 15, 2021

Yes we will eventually ship QT6 based Cutter for all platforms, but it's too early for that. Is there a specific reason you are interested in VS2019?

@XVilka
Copy link
Member

XVilka commented Apr 15, 2021

@karliss yes, they recently made ASAN available:

It might be helpful to provide ASAN-enabled builds for better pre-release testing on Windows

@karliss karliss added this to the 2.0.2 milestone Apr 15, 2021
@karliss karliss mentioned this pull request Apr 19, 2021
3 tasks
@ITAYC0HEN
Copy link
Member

It's necessary to manually disable CUTTER_ENABLE_KSYNTAXHIGHLIGHTING

Does this mean that the next Cutter won't come with KSYNTAXHIGHLIGHTING?

@XVilka
Copy link
Member

XVilka commented Apr 20, 2021

KSyntaxHighlight gained Qt6 support only recently, probably it will take time to propagate in distributions: https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/184

@karliss
Copy link
Member Author

karliss commented Apr 20, 2021

Does this mean that the next Cutter won't come with KSYNTAXHIGHLIGHTING?

No one is switching to QT6 yet. It isn't ready yet. This PR is in 2.0.2 because some of the changes that are in Qt6 are also included in KDE Qt 5.15 patches.

Even once the QT6 support will be finished it doesn't mean removing compatibility with with QT5. We will switch the official release builds once we feel comfortable with it and distro maintainers will be able to switch at their pace based on readiness of other packages.

By the way current official release builds do not include KSyntaxHighlight either only some of distro specific builds do.

@karliss karliss requested review from thestr4ng3r and XVilka April 24, 2021 07:45
Copy link
Member

@thestr4ng3r thestr4ng3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran through the test plan with unpatched Qt 5.15.2 locally, and changes look good.

@karliss karliss merged commit 8da572d into rizinorg:master Apr 24, 2021
@karliss karliss deleted the qt6-regex branch April 24, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Qt Issues and pull-requests regarding or caused-by the underlying Qt toolkit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants