-
Notifications
You must be signed in to change notification settings - Fork 65
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
Porting to Qt6 #648
Comments
Switch from QRegExp to QRegularExpression example LubosD/twinkle#301 |
No port to Qt6 planned, yet. But go ahead and open a PR once you have a working version that is ready to review. see https://github.com/Maproom/qmapshack/wiki/DeveloperCommitCode |
Qt5WebEngine is now really on its last legs and a real burden to maintain for quite some time. Distributions are actively going to start rooting out revdeps soon. Without Qt5WebEngine this package could survive much longer in distributions' respositories, but still the need to port to Qt6 is there. |
Just wanted to mention that the current porting_qt6 branch compiles and runs fine here under archlinux. I just needed to install quazip-qt6. |
Comparing a string literal (which is of type const char*) directly with a QString may fail in Qt6. Original issue found in Expression From ChatGPT comment on this issue:
Fixes recommended by ChatGPT didn't work for me. My beginners work-around in
Experts will understand and simplify this. It is likely that this issue can be found elsewhere in the QMS/QMT sources. Therefore, a bug fix (a PR) for the above-mentioned file was not yet prepared. Is there an easy general approach (compiler switch?) for identifying this issue in the sources (in my case there wasn't any compiler error, instead a rmap file couldn't be loaded)? |
SSL error in Qt6 version, but not in Qt5 version Qt6 version error when calling a WMTS tile (sorry for German message):
Loading this tile (and others) with QMS Qt5 version or with Firefox succeeds without any error. Any hints how to debug this error? Others WMTS/TMS maps using https can be rendered without error. |
Don't you have to install some SSL stuff next to QT in Windows? Maybe you missed it or some outdated version is used. I would interpret the message as some corrupted or outdated certificate failing. |
Thanks for the hint: An update of the |
When connecting a garmin device the folders aren't shown in qmapshack anymore for me. There is a warning of
With version 1.17.1 the corresponding output is:
|
Same for me with GARMIN Edge 1000. I thought first it's related to my build in a VM and USB are not really bypassed to the VM.
I get for:
and for:
I guess A quick hack solve it for me:
@kiozen : Should I provide this fix for "porting_qt6"? If yes, how to proceed against branch "porting_qt6"? |
My guess is that QString in QT6 uses always UTF16 encoded strings. Linux by default produces UTF8 encoded strings afaik. The proper solution might be is to use QString::fromStdString for such strings. But i am not sure about that, these encodings are a bit tricky, e.g i do not know if this may fail on windows machines. Just stripping out some chars is definitely not a good solution, imho. |
Ok, you are right. DBus will return
Didn't get around all documentation but it seems QString in version 5.x stripped the leading zero and in version 6.x a For me changing this line
to
will do the trick. Probably there are better solutions for this issue. |
My issue "Comparing a string literal (which is of type const char*) directly with a QString may fail in Qt6." mentioned earlier in this thread and @frankystone's string issue seem to have the same source. |
@wthaem I think the main problem of comparing char* with QString in your case is that the encoding of the read data of the file in not known. For the DBus thing it's well known. According to the output of qdbus its
which means this is an array of array of unsigned 8-bit values. The y stands for ASCII. Source: D-Bus specification With this information one can convert the
See fromLatin1() @kkarsten62 does this also work for you? |
Thanks for testing the porting branch. This is really crucial as this bug demonstrates. Keep up the good work! And sorry for my late reply. Private constrains do not allow me to spend much time on QMapshack. This includes the open issues like translation etc. Anyways I could get hold of an hour to provide a PR: #696 Please test on Linux and Windows. The QBus API of Qt is really the worst I ever saw. Including the mess of the ever growing classes to work with strings. Actively removing the trailing 0 seems to be the only way to fix it. The whole encodeing/decoding wasn't well designed in Qt5 and IMHO it's got worse in Qt6. |
All those API updates are a pain. The older you get, the more pain they make… Did maintain a Django/Python driven website for many, many years with some updates of Django and switching from python2.7 to python3.x. My motivation to maintain it further is going to reach 0… It's just no fun anymore. |
I've tried to grep over the code:
But i don't know if this covers all possibilities. |
I would search for all QByteArray usage and check. But I lack the time. I hope I can find a couple of minutes to fix RMAP support next week. And then I will merge the PR. |
That's a lot of stuff… The number beside the filename is the line number, eg 7 is the line number in
|
I can't scroll the list of waypoint icons with the porting_qt6 branch. To reproduce:
Scrolling down produces an "up arrow" at the top of the list, but the list doesn't scroll down. So it is not possible to choose an icon which is below the display. Window manager kwin on X11 |
Couldn't find any issue on Windows 10. Can change waypoint icon without problem. |
Again: everything ok with Windows10. |
Started with a fresh environment by renaming the folder containing
The map view name shown in QMS was @wthaem how are those entries in your |
I tried to reproduce both issues.
The |
In my case |
On so it looks on Windows. |
Looks like on my machine qt thinks my screen is much bigger … will ask in the arch linux forum if they have any ideas why this might happen. |
Can someone with a multi column waypoint list please check qmapshack/src/qmapshack/helpers/CWptIconManager.cpp Lines 267 to 268 in 23d6fe3
Here it says (256, 3154) which i believe is the cause of my problem with the waypoint list. I have tried to set different QSizePolicys but all of them depend on At least: If i add |
I spend some days to get any information about this issue but couldn't find any, except that qt devs say a QMenu shouldn't contain so much entries and one should consider to rethink this. But this isn't an explanation for this issue nor a solution, imho. @vincentxavier which window manager do you use? As far i can tell using openbox as a window manger the way-point-icon-list is multicolumn, whereas using i3 and kwin the list is single column and can not be scrolled with QT 6. Looking at the screenshot from @kiozen he uses some Gnome window manager and @wthaem uses windows. Edit: At least i am not alone :-) |
Le 28.11.2024 23:05, kaputtnik a écrit :
@vincentxavier [1] which window manager do you use?
kwin, with plasma 6
…--
Société Libre, Logiciel Libre
Links:
------
[1] https://github.com/vincentxavier
--=_4feb80ae507cd338001208c6883fb2d4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p id=3D"reply-intro">Le 28.11.2024 23:05, kaputtnik a écrit :<=
/p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<div id=3D"replybody1">
<p dir=3D"auto"><a class=3D"v1user-mention v1notranslate" href=3D"https://g=
ithub.com/vincentxavier" target=3D"_blank" rel=3D"noopener ***@***.***=
centxavier</a> which window manager do you use?</p>
</div>
</blockquote>
<p>kwin, with plasma 6</p>
<div id=3D"signature">-- <br />
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
Société Libre, Logiciel Libre</div>
</div>
</body></html>
--=_4feb80ae507cd338001208c6883fb2d4--
--=_600475e53b12e3e55c99cf453a73aa17
Content-Transfer-Encoding: base64
Content-Type: image/gif;
name=blocked.gif
Content-Disposition: attachment;
filename=blocked.gif;
size=118
R0lGODlhZAAyAIAAAPrOzgAAACH5BAAAAAAALAAAAABkADIAAAJNhI+py+0Po5y02ouz3rz7D4bi
SJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMKpfMpvMJjUqn1Kr1is1qt9yu9wsOi8fksvls
KwAAOw==
--=_600475e53b12e3e55c99cf453a73aa17--
|
Just for the records: I use Mint Linux with Gnome. And Tuxedo OS with KDE on my systems. The menu is displayed as multi-column perfectly fitting the screen on all systems.
Oh dear. That is a lot of confidence in their own product. Did anyone test against a Qt version directly installed from the Qt binary servers? Packages shipped with distributions are sometimes weird. Just had my share of that with GDAL packages yesterday. |
archlinux packages are as close to upstream as they can, if they change anything then adjusting the system file paths in configs. source And i have tested the behavior with the openbox window manager on the same machine, just in another virtual console (STRG+ALT+Fx). So it uses the same qt-version. All i can tell is that that with each call to qmapshack/src/qmapshack/helpers/CWptIconManager.cpp Lines 306 to 315 in c542242
the
According to the documentation the values of sizeHint holds the recommended size for the widget. Since here the sizeHint has a height of 3154 it will exceed the screen height when displayed. Another difference from openbox and kwin is that the initial values of sizeHint are different (taken directly after initialization of the menu
I have tried to subclass QMenu to override sizeHint() to return initially I have also added a new user on my machine so default values are set and some misconfiguration can be excluded. But the result is the same. All these calculations made by qt are a bit hidden, at least i couldn't find any information how sizeHint is initially calculated and how Lost in QT 😄 |
If someone wants to test, i've made a branch which produces debug output: https://github.com/frankystone/qmapshack/tree/debug_qmenu Example output on my machine:
This branch contains also some lines (commented now) which at least gives the possibility to scroll the single column again. |
It seems i found the culprit: It's the style (Design) of the desktop. If i switch the global design of my desktop to "Oxygen" ... tadaaaa... the menu is multi column. If i switch back to "Breeze" it's single column again. Now my desktop is messed up, but hey this was worth it. @vincentxavier you can test another style by starting qmapshack like Will dig much more into this... |
A quick and dirty workaround:
|
with style-option set to windows, seems fine.
Le 30.11.2024 11:43, kaputtnik a écrit :
It seems i found the culprit: It's the style (Design) of the desktop.
If i switch the global design of my desktop to "Oxygen" ... tadaaaa...
the menu is multi column. If i switch back to "Breeze" it's single
column again. Now my desktop is messed up, but hey this was worth it.
After digging into this much more it's sufficient to change the
"application style" to "Oxygen". This setting can be found in _System
settings -> Color and Designs -> Application style_ (might be called
different in detail, i just have translated from german).
@vincentxavier [1] you can test another style by starting qmapshack
like path/to/qmapshack -style windows. See QStyle [2]
Will dig much more into this...
--
Reply to this email directly, view it on GitHub [3], or unsubscribe
[4].
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Société Libre, Logiciel Libre
Links:
------
[1] https://github.com/vincentxavier
[2] https://doc.qt.io/qt-6/qstyle.html
[3]
#648 (comment)
[4]
https://github.com/notifications/unsubscribe-auth/AABZ7QSG3OKMS7ACQB5P7232DGJERAVCNFSM6AAAAABNXBPMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBYHEYTQNZTG4
--=_7b70707490c7a588b92357524db90aaa
Content-Type: multipart/related;
boundary="=_cd03989458bb83adbf1453d595e68aa2"
--=_cd03989458bb83adbf1453d595e68aa2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p>with style-option set to windows, seems fine.</p>
<p id=3D"reply-intro">Le 30.11.2024 11:43, kaputtnik a écrit :<=
/p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<div id=3D"replybody1">
<p><br /></p>
<p dir=3D"auto">It seems i found the culprit: It's the style (Design) of th=
e desktop. If i switch the global design of my desktop to "Oxygen" ... tada=
aaa... the menu is multi column. If i switch back to "Breeze" it's single c=
olumn again. Now my desktop is messed up, but hey this was worth it.<br />A=
fter digging into this much more it's sufficient to change the "application=
style" to "Oxygen". This setting can be found in <em>System settings ->=
Color and Designs -> Application style</em> (might be called different =
in detail, i just have translated from german).</p>
<p dir=3D"auto"><a class=3D"v1user-mention v1notranslate" href=3D"https://g=
ithub.com/vincentxavier" target=3D"_blank" rel=3D"noopener ***@***.***=
centxavier</a> you can test another style by starting qmapshack like <code =
class=3D"v1notranslate">path/to/qmapshack -style windows</code>. See <a hre=
f=3D"https://doc.qt.io/qt-6/qstyle.html" target=3D"_blank" rel=3D"noopener =
noreferrer">QStyle</a></p>
<p dir=3D"auto">Will dig much more into this...</p>
<p style=3D"font-size: small; -webkit-text-size-adjust: none; color: #666;"=
—<br />Reply to this email directly, <a href=3D"https://github.com/M=
aproom/qmapshack/issues/648#issuecomment-2508918737" target=3D"_blank" rel=
=3D"noopener noreferrer">view it on GitHub</a>, or <a href=3D"https://githu=
b.com/notifications/unsubscribe-auth/AABZ7QSG3OKMS7ACQB5P7232DGJERAVCNFSM6A=
AAAABNXBPMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBYHEYTQNZTG4" targe=
t=3D"_blank" rel=3D"noopener noreferrer">unsubscribe</a>.<br />You are rece=
iving this because you were mentioned.<img src=3D"cid:1733082926674cbf2e5a3=
***@***.***" width=3D"1" height=3D"1" /><span style=3D"colo=
r: transparent; font-size: 0; display: none; visibility: hidden; overflow: =
hidden; opacity: 0; width: 0px; height: 0px; max-width: 0; max-height: 0; m=
so-hide: all;">Message ID: <span><Maproom/qmapshack/issues/648/250891873=
7</span><span>@</span><span>github</span><span>.</span><span>com></span>=
</span></p>
</div>
</blockquote>
<p><br /></p>
<div id=3D"signature">-- <br />
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
Société Libre, Logiciel Libre</div>
</div>
</body></html>
…--=_cd03989458bb83adbf1453d595e68aa2
Content-Transfer-Encoding: base64
Content-ID: ***@***.***>
Content-Type: image/gif;
name=blocked.gif
Content-Disposition: inline;
filename=blocked.gif;
size=118
R0lGODlhZAAyAIAAAPrOzgAAACH5BAAAAAAALAAAAABkADIAAAJNhI+py+0Po5y02ouz3rz7D4bi
SJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMKpfMpvMJjUqn1Kr1is1qt9yu9wsOi8fksvls
KwAAOw==
--=_cd03989458bb83adbf1453d595e68aa2--
--=_7b70707490c7a588b92357524db90aaa--
|
The parent ticket
QMS-#
What do you plan to do
Hi,
I'm tring to compile qmapshack 1.17.0 with qt 6.6.0.
I created simple patch
but compilation failed in qmapshack
in qmaptool
and in qmt_rgb2pct
Is there plans to port QMapShack to Qt6?
The result will be
Successful compilation with Qt6.
The text was updated successfully, but these errors were encountered: