Open nuqleo opened 1 year ago
Switch from QRegExp to QRegularExpression example https://github.com/LubosD/twinkle/pull/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.
When switching between v1.17.1 and the porting_qt6 branch there is an issue with german umlauts.
Normally i work only with the porting_qt6 branch and all works fine. If i switch to version 1.17.1 (installed as package in archlinux) all works fine also. But switching back to the porting_qt6 branch the DEM data can't be found anymore. Reason is a mismatch in en/decoding the name of the folder(note the term "Höhendaten"):
I have to remove the entry of the folder and add it again to get the DEM data back.
Comparing a string literal (which is of type const char*) directly with a QString may fail in Qt6.
Original issue found in src\qmapshack\map\CMapRMAP.cpp
: rmap can't be loaded anymore.
Expression "CompeGPSRasterImage" != QString(charbuf)
works in Qt5 but not in Qt6
From ChatGPT comment on this issue:
In Qt 5, the expression "CompeGPSRasterImage" != QString(charbuf) works because Qt 5 allows implicit conversions between certain types, such as between const char and QString. However, in Qt 6, stricter type safety has been enforced, and implicit conversions between const char and QString are no longer as lenient. This means that comparing a string literal (which is of type const char*) directly with a QString may lead to compilation errors in Qt 6.
To resolve this issue, you need to explicitly convert the const char* (or string literal) to a QString before performing the comparison.
Fixes recommended by ChatGPT didn't work for me.
My beginners work-around in CMapRMAP.cpp
:
QString str = "CompeGPSRasterImage";
QString substring = QString(charbuf).left(19);
QString substring1 = str.left(19);
if (substring != substring1) {
// if (str.toUtf8() != charbuf) { <=========== fails
// if (QString("CompeGPSRasterImage") != QString(charbuf)) { <============ fails
QMessageBox::warning(CMainWindow::getBestWidgetForParent(), tr("Error..."), tr("This is not a TwoNav RMAP file."),
QMessageBox::Abort, QMessageBox::Abort);
return;
}
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):
Request to
"https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&\
LAYER=HR.ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&\
TILEMATRIXSET=PM_6_19&TILEMATRIX=12&TILEROW=1407&\
TILECOL=2075&FORMAT=image/jpeg" failed:
"Im Ablauf des SSL-Protokolls ist ein Fehler aufgetreten.:
Das angegebene Zertifikat kann in diesem Fall nicht verwendet werden"
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 libcrypto*.dll
and libssl*.dll
(in my case: an update of gisinternals) was the solution.
When connecting a garmin device the folders aren't shown in qmapshack anymore for me. There is a warning of Broken filename passed to function
build_QMapShack/bin/qmapshack --debug
[...]
2024-11-04 21:13:15.575 [debug] Sanity test passed.
2024-11-04 21:13:16.189 [debug] model: "GARMIN Card" vendor: "Garmin" idLabel: "KARTE 60GB"
2024-11-04 21:13:16.707 [warning] Broken filename passed to function
2024-11-04 21:13:17.221 [debug] model: "GARMIN Flash" vendor: "Garmin" idLabel: "GARMIN"
2024-11-04 21:13:17.438 [warning] Broken filename passed to function
With version 1.17.1 the corresponding output is:
[...]
2024-11-04 21:24:07.290 [debug] Sanity test passed.
2024-11-04 21:24:07.985 [debug] model: "GARMIN Card" vendor: "Garmin" idLabel: "KARTE 60GB"
2024-11-04 21:24:10.324 [debug] Probe device at "/run/media/kaputtnik/KARTE 60GB" "/org/freedesktop/UDisks2/block_devices/sdg1" "KARTE 60GB"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/GPX"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/JPEG"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/GeocachePhotos"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/Activities"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/GPX"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB/Garmin/Locations"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB"
2024-11-04 21:24:10.528 [debug] "/run/media/kaputtnik/KARTE 60GB"
2024-11-04 21:24:10.839 [debug] reading files from device: "/run/media/kaputtnik/KARTE 60GB/Garmin/GPX"
[...]
2024-11-04 21:13:16.707 [warning] Broken filename passed to function
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. But with deeper debugging:
void IDeviceWatcher::probeForDevice(const QString& mountPoint, const QString& path, const QString& label) {
qDebug() << "mountPoint=" << mountPoint;
I get for: QMS 1.17.1 branch "dev" | Fedora 40 | Wayland | Gnome 46 | Qt 5.15.5
2024-11-05 10:23:58.699 [debug] model: "GARMIN Card" vendor: "Garmin" idLabel: "GARMIN"
==> 2024-11-05 10:24:38.509 [debug] mountPoint= "/run/media/karl/GARMIN"
and for: QMS 1.17.1 branch "porting_qt6" | Fedora 41 | Wayland | Gnome 47 | Qt 6.8.0
2024-11-05 10:41:57.061 [debug] model: "GARMIN Flash" vendor: "Garmin" idLabel: "GARMIN"
==> 2024-11-05 10:42:23.422 [debug] mountPoint= "/run/media/karl/GARMIN\u0000"
I guess QDBusMessage
will reply mountpoint path with a trailing zero char.
A quick hack solve it for me:
QString CDeviceWatcherLinux::readMountPoint(const QString& path) {
[...]
if (!points.isEmpty()) {
QString point = points.first();
// delete possible trailing zero char
if (point.indexOf('\000', point.length() - 1) == (point.length() - 1)) {
point = point.left(point.length() - 1);
}
return point;
}
return "";
}
@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 0
as the last byte. E.g. this is the output if my device is mounted at sdg1
.
$:> qdbus --system --literal org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/sdg1 org.freedesktop.UDisks2.Filesystem.MountPoints
[Variant: [Argument: aay {{47, 114, 117, 110, 47, 109, 101, 100, 105, 97, 47, 107, 97, 112, 117, 116, 116, 110, 105, 107, 47, 75, 65, 82, 84, 69, 32, 54, 48, 71, 66, 0}}]]
Didn't get around all documentation but it seems QString in version 5.x stripped the leading zero and in version 6.x a \0
terminated string is produced.
For me changing this line https://github.com/Maproom/qmapshack/blob/a418cbd4fdd5716fb35fc0ce161039eba59b2e36/src/qmapshack/device/CDeviceWatcherLinux.cpp#L178
to
points.append(point.chopped(1));
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 aay
Argument: aay
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 QBytearray
to a QString
and thus my solution from above could maybe better written as:
for (const QByteArray& point : std::as_const(list)) {
points.append(QString::fromLatin1(point, -1)); // converting
}
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: https://github.com/Maproom/qmapshack/pull/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.
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)?
I've tried to grep over the code:
$:> grep -rn -E 'QString(.*) !='
src/qmapshack/device/CDeviceGarmin.cpp:125: if (dirArchive.exists() && (dirArchive.entryList(QStringList("*.gpx")).count() != 0)) {
$:> grep -rn -E '!= QString(.*)'
src/qmaptool/overlay/refmap/CProjWizard.cpp:116: if (di.pszOGCDatumName != QString()) {
src/qmaptool/overlay/refmap/CProjWizard.cpp:165: if (di.pszOGCDatumName != QString()) {
src/qmapshack/map/CMapRMAP.cpp:43: if ("CompeGPSRasterImage" != QString(charbuf)) {
src/qmapshack/grid/CProjWizard.cpp:114: if (di.pszOGCDatumName != QString()) {
src/qmapshack/grid/CProjWizard.cpp:163: if (di.pszOGCDatumName != QString()) {
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 CMakeLists.txt.user:7:
The output grepping over the QMS-694
branch
$:> grep -rn 'QByteArray'
CMakeLists.txt.user:7: <value type="QByteArray">{e69f8491-77c5-4d14-aeaa-fe640e86d8b2}</value>
CMakeLists.txt.user:22: <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
CMakeLists.txt.user:28: <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
CMakeLists.txt.user:32: <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
grep: .git/objects/pack/pack-f65b87322ae4a774be7acfbe05ad52a26c06999f.pack: Übereinstimmungen in Binärdatei
src/qmaptool/overlay/COverlayRefMap.cpp:76: QByteArray buffer;
src/qmaptool/overlay/COverlayRefMap.cpp:97: QByteArray buffer;
src/qmaptool/canvas/CCanvas.cpp:30: loadIndicator1 = new QMovie("://animation/loader.gif", QByteArray(), this);
src/qmaptool/units/IUnit.h:73: static QByteArray pos2timezone(const QPointF& pos);
src/qmaptool/units/IUnit.h:84: static void getTimeZoneSetup(tz_mode_e& mode, QByteArray& zone, bool& format) {
src/qmaptool/units/IUnit.h:90: static void setTimeZoneSetup(tz_mode_e mode, const QByteArray& zone, bool format) {
src/qmaptool/units/IUnit.h:115: static QByteArray timeZone;
src/qmaptool/units/IUnit.cpp:34:QByteArray IUnit::timeZone = "UTC";
src/qmaptool/units/IUnit.cpp:585:QByteArray IUnit::pos2timezone(const QPointF& pos) {
src/qmaptool/units/CTimeZoneSetup.cpp:26: QByteArray zone;
src/qmaptool/units/CTimeZoneSetup.cpp:68: QByteArray zone = comboTimeZone->currentText().toLatin1();
src/qmaptool/setup/CAppSetupWin.h:39: QByteArray path;
src/qmt_rgb2pct/CApp.cpp:29: QByteArray array = str.toUtf8();
src/qmt_rgb2pct/CApp.cpp:35: QByteArray array = str.toUtf8();
src/qmt_rgb2pct/CApp.cpp:134: QByteArray buf = sctFilename.toUtf8();
src/qmt_rgb2pct/CApp.cpp:192: QByteArray buffer1(xsize, 0);
src/qmt_rgb2pct/CApp.cpp:193: QByteArray buffer2(xsize, 0);
src/qmapshack/helpers/CTimeDialog.cpp:31: const QByteArray& zone = cfg.value("timezone", QTimeZone::systemTimeZone().id()).toByteArray();
src/qmapshack/helpers/CTimeDialog.cpp:34: const QList<QByteArray>& ids = QTimeZone::availableTimeZoneIds();
src/qmapshack/helpers/CTimeDialog.cpp:35: foreach (const QByteArray& id, ids) {
src/qmapshack/CMainWindow.cpp:126: QByteArray tz;
src/qmapshack/CMainWindow.cpp:575: QByteArray tz;
src/qmapshack/CMainWindow.cpp:1486:bool CMainWindow::nativeEvent(const QByteArray& eventType, void* message, qintptr* result) {
src/qmapshack/canvas/CCanvas.cpp:114: loadIndicator1 = new QMovie("://animation/loader.gif", QByteArray(), this);
src/qmapshack/canvas/CCanvas.cpp:120: loadIndicator2 = new QMovie("://animation/loader2.gif", QByteArray(), this);
src/qmapshack/canvas/CCanvas.cpp:126: loadIndicator3 = new QMovie("://animation/loader3.gif", QByteArray(), this);
src/qmapshack/map/CMapGEMF.cpp:70: QByteArray name(NAMEBUFLEN, 0);
src/qmapshack/map/CMapGEMF.cpp:253: QByteArray imageData(size, 0);
src/qmapshack/map/CMapIMG.cpp:415: QByteArray array = file.readAll();
src/qmapshack/map/CMapIMG.cpp:431: QByteArray array;
src/qmapshack/map/CMapIMG.cpp:443:void CMapIMG::readFile(CFileExt& file, quint32 offset, quint32 size, QByteArray& data) {
src/qmapshack/map/CMapIMG.cpp:448: data = QByteArray::fromRawData(file.data(offset, size), size);
src/qmapshack/map/CMapIMG.cpp:499: QByteArray imghdr;
src/qmapshack/map/CMapIMG.cpp:510: mapdesc = QByteArray((const char*)pImgHdr->desc1, 20);
src/qmapshack/map/CMapIMG.cpp:517: QByteArray FATblock;
src/qmapshack/map/CMapIMG.cpp:657: QByteArray trehdr;
src/qmapshack/map/CMapIMG.cpp:708: QByteArray maplevel;
src/qmapshack/map/CMapIMG.cpp:750: QByteArray subdiv_n;
src/qmapshack/map/CMapIMG.cpp:761: QByteArray rgnhdr;
src/qmapshack/map/CMapIMG.cpp:885: QByteArray subdiv2;
src/qmapshack/map/CMapIMG.cpp:973: QByteArray lblhdr;
src/qmapshack/map/CMapIMG.cpp:980: QByteArray nethdr;
src/qmapshack/map/CMapIMG.cpp:1244: QByteArray rgndata;
src/qmapshack/map/CMapIMG.cpp:1308:void CMapIMG::loadSubDiv(CFileExt& file, const subdiv_desc_t& subdiv, IGarminStrTbl* strtbl, const QByteArray& rgndata,
src/qmapshack/map/garmin/CGarminTyp.cpp:36:bool CGarminTyp::decode(const QByteArray& array, QMap<quint32, polygon_property>& polygons,
src/qmapshack/map/garmin/CGarminTyp.cpp:448: QByteArray str;
src/qmapshack/map/garmin/CGarminTyp.cpp:799: QByteArray str;
src/qmapshack/map/garmin/CGarminTyp.cpp:1113: QByteArray str;
src/qmapshack/map/garmin/IGarminStrTbl.h:25:class QByteArray;
src/qmapshack/map/garmin/IGarminStrTbl.h:53: void readFile(CFileExt& file, quint32 offset, quint32 size, QByteArray& data);
src/qmapshack/map/garmin/CGarminStrTblUtf8.cpp:41: QByteArray data;
src/qmapshack/map/garmin/CGarminStrTbl6.cpp:119: QByteArray data;
src/qmapshack/map/garmin/CGarminTyp.h:167: bool decode(const QByteArray& array, QMap<quint32, polygon_property>& polygons,
src/qmapshack/map/garmin/CGarminStrTbl8.cpp:42: QByteArray data;
src/qmapshack/map/garmin/IGarminStrTbl.cpp:62:void IGarminStrTbl::readFile(CFileExt& file, quint32 offset, quint32 size, QByteArray& data) {
src/qmapshack/map/garmin/IGarminStrTbl.cpp:68: data = QByteArray::fromRawData(file.data(offset, size), size);
src/qmapshack/map/garmin/IGarminStrTbl.cpp:99: QByteArray buffer;
src/qmapshack/map/garmin/IGarminStrTbl.cpp:108: QByteArray data;
src/qmapshack/map/CMapIMG.h:162: void readFile(CFileExt& file, quint32 offset, quint32 size, QByteArray& data);
src/qmapshack/map/CMapIMG.h:165: void loadSubDiv(CFileExt& file, const subdiv_desc_t& subdiv, IGarminStrTbl* strtbl, const QByteArray& rgndata,
src/qmapshack/map/CMapRMAP.cpp:40: QByteArray charbuf(20, 0);
src/qmapshack/map/CMapJNX.cpp:28:static void readCString(QDataStream& stream, QByteArray& ba) {
src/qmapshack/map/CMapJNX.cpp:156: QByteArray ba;
src/qmapshack/map/CMapJNX.cpp:170: QByteArray ba;
src/qmapshack/map/CMapJNX.cpp:317: QByteArray data(1024 * 1024 * 4, 0);
src/qmapshack/map/CMapJNX.cpp:320: // Maybe the QByteArray declaration should be fixed ;-)
src/qmapshack/units/IUnit.h:107: static QByteArray pos2timezone(const QPointF& pos);
src/qmapshack/units/IUnit.h:120: static void getTimeZoneSetup(tz_mode_e& mode, QByteArray& zone, bool& format) {
src/qmapshack/units/IUnit.h:126: static void setTimeZoneSetup(tz_mode_e mode, const QByteArray& zone, bool format) {
src/qmapshack/units/IUnit.h:153: static QByteArray timeZone;
src/qmapshack/units/IUnit.cpp:35:QByteArray IUnit::timeZone = "UTC";
src/qmapshack/units/IUnit.cpp:754:QByteArray IUnit::pos2timezone(const QPointF& pos) {
src/qmapshack/units/CTimeZoneSetup.cpp:26: QByteArray zone;
src/qmapshack/units/CTimeZoneSetup.cpp:68: QByteArray zone = comboTimeZone->currentText().toLatin1();
src/qmapshack/setup/CAppSetupWin.h:36: QByteArray path;
src/qmapshack/gis/db/IDBFolderSql.cpp:119: QByteArray msg;
src/qmapshack/gis/db/CDBProject.cpp:50: QByteArray data = query.value(2).toByteArray();
src/qmapshack/gis/db/CDBProject.cpp:270: QByteArray data;
src/qmapshack/gis/db/CDBProject.cpp:367: QByteArray data;
src/qmapshack/gis/db/CDBProject.cpp:575: QByteArray data;
src/qmapshack/gis/db/CDBProject.cpp:682: QByteArray data = query.value(2).toByteArray();
src/qmapshack/gis/qms/serialization.cpp:492: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:530: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:623: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:674: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:699: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:753: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:786: QByteArray buffer;
src/qmapshack/gis/qms/serialization.cpp:836: QByteArray buffer;
src/qmapshack/gis/CGisListDB.cpp:883: QByteArray datagram;
src/qmapshack/gis/trk/filter/CFilterNewDate.cpp:29: QByteArray zone;
src/qmapshack/gis/search/CGeoSearch.h:59: void parseNominatim(const QByteArray& data);
src/qmapshack/gis/search/CGeoSearch.h:60: void parseGeonamesSearch(const QByteArray& data);
src/qmapshack/gis/search/CGeoSearch.h:61: void parseGeonamesAddress(const QByteArray& data);
src/qmapshack/gis/search/CGeoSearch.h:62: void parseGoogle(const QByteArray& data);
src/qmapshack/gis/search/CGeoSearch.cpp:205: QByteArray data = reply->readAll();
src/qmapshack/gis/search/CGeoSearch.cpp:325:void CGeoSearch::parseGoogle(const QByteArray& data) {
src/qmapshack/gis/search/CGeoSearch.cpp:370:void CGeoSearch::parseGeonamesSearch(const QByteArray& data) {
src/qmapshack/gis/search/CGeoSearch.cpp:438:void CGeoSearch::parseGeonamesAddress(const QByteArray& data) {
src/qmapshack/gis/search/CGeoSearch.cpp:562:void CGeoSearch::parseNominatim(const QByteArray& data) {
src/qmapshack/gis/prj/IGisProject.cpp:173: QByteArray buffer;
src/qmapshack/gis/prj/IGisProject.cpp:819: QByteArray buffer;
src/qmapshack/gis/IGisItem.cpp:201: QByteArray buffer;
src/qmapshack/gis/IGisItem.cpp:226: QByteArray data(query.value(0).toByteArray());
src/qmapshack/gis/fit/decoder/CFitByteDataTransformer.h:37: static QByteArray getBytes(quint8* rawData, quint8 length);
src/qmapshack/gis/fit/decoder/CFitByteDataTransformer.cpp:145:QByteArray CFitByteDataTransformer::getBytes(quint8* rawData, quint8 length) {
src/qmapshack/gis/fit/decoder/CFitByteDataTransformer.cpp:146: return QByteArray((const char*)rawData, length);
src/qmapshack/gis/qlb/CQlbProject.h:36: void loadWpts(QByteArray& array);
src/qmapshack/gis/qlb/CQlbProject.h:37: void loadTrks(QByteArray& array);
src/qmapshack/gis/qlb/CQlbProject.h:38: void loadRtes(QByteArray& array);
src/qmapshack/gis/qlb/CQlbProject.h:39: void loadOvls(QByteArray& array);
src/qmapshack/gis/qlb/CQlbProject.cpp:75:void CQlbProject::loadWpts(QByteArray& array) {
src/qmapshack/gis/qlb/CQlbProject.cpp:86:void CQlbProject::loadTrks(QByteArray& array) {
src/qmapshack/gis/qlb/CQlbProject.cpp:97:void CQlbProject::loadRtes(QByteArray& array) {
src/qmapshack/gis/qlb/CQlbProject.cpp:108:void CQlbProject::loadOvls(QByteArray& array) {
src/qmapshack/gis/rte/router/CRouterBRouter.cpp:333: const QByteArray& res = reply->readAll();
src/qmapshack/gis/rte/router/CRouterBRouter.cpp:458: const QByteArray& res = reply->readAll();
src/qmapshack/gis/rte/router/CRouterMapQuest.cpp:30:const QByteArray CRouterMapQuest::keyMapQuest = "Fmjtd%7Cluu2n16t2h%2Crw%3Do5-haya0";
src/qmapshack/gis/rte/router/CRouterMapQuest.cpp:289: QByteArray res = reply->readAll();
src/qmapshack/gis/rte/router/brouter/CRouterBRouterSetup.cpp:671: const QByteArray& content = file.readAll();
src/qmapshack/gis/rte/router/brouter/CRouterBRouterSetup.cpp:703: const QByteArray& content = reply->readAll();
src/qmapshack/gis/rte/router/brouter/CRouterBRouterDownloadPage.cpp:73: request.setRawHeader(QByteArray("Accept"), QByteArray("application/vnd.github+json"));
src/qmapshack/gis/rte/router/brouter/CRouterBRouterDownloadPage.cpp:74: request.setRawHeader(QByteArray("X-GitHub-Api-Version"), QByteArray("2022-11-28"));
src/qmapshack/gis/rte/router/brouter/CRouterBRouterDownloadPage.cpp:123: QByteArray content = reply->readAll();
src/qmapshack/gis/rte/router/CRouterMapQuest.h:48: static const QByteArray keyMapQuest;
src/qmapshack/gis/IGisItem.h:55: QByteArray data;
src/qmapshack/gis/CGisListWks.cpp:741: QByteArray data;
src/qmapshack/gis/CGisListWks.cpp:790: QByteArray data = query.value(5).toByteArray();
src/qmapshack/CMainWindow.h:129: bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result);
src/qmapshack/CMainWindow.h:223: QByteArray dockStates;
src/qmapshack/qlgt/CQlgtFolder.cpp:46: QByteArray data = query.value(1).toByteArray();
src/qmapshack/qlgt/CQmsDb.cpp:152: QByteArray data;
src/qmapshack/qlgt/CQmsDb.cpp:222: QByteArray data;
src/qmapshack/qlgt/CQlgtDiary.cpp:25: QByteArray data;
src/qmapshack/qlgt/CQlgtDb.cpp:272: QByteArray bytes;
src/qmapshack/qlgt/CQlgtDb.cpp:305: QByteArray array = query.value(1).toByteArray();
src/qmapshack/qlgt/CQlgtDb.cpp:359: QByteArray array = query.value(1).toByteArray();
src/qmapshack/qlgt/CQlgtDb.cpp:601: QByteArray data = query.value(1).toByteArray();
src/qmapshack/qlgt/IQlgtOverlay.cpp:25: QByteArray data;
src/qmapshack/qlgt/CQlb.h:21:#include <QByteArray>
src/qmapshack/qlgt/CQlb.h:36: qint32 eWpt, QByteArray wpts
src/qmapshack/qlgt/CQlb.h:64: QByteArray& waypoints() { return wpts; }
src/qmapshack/qlgt/CQlb.h:66: QByteArray& tracks() { return trks; }
src/qmapshack/qlgt/CQlb.h:68: QByteArray& diary() { return drys; }
src/qmapshack/qlgt/CQlb.h:70: QByteArray& overlays() { return ovls; }
src/qmapshack/qlgt/CQlb.h:72: QByteArray& routes() { return rtes; }
src/qmapshack/qlgt/CQlb.h:74: QByteArray& mapsels() { return sels; }
src/qmapshack/qlgt/CQlb.h:84: QByteArray wpts;
src/qmapshack/qlgt/CQlb.h:86: QByteArray trks;
src/qmapshack/qlgt/CQlb.h:88: QByteArray rtes;
src/qmapshack/qlgt/CQlb.h:90: QByteArray drys;
src/qmapshack/qlgt/CQlb.h:92: QByteArray ovls;
src/qmapshack/qlgt/CQlb.h:94: QByteArray sels;
src/qmapshack/qlgt/CQlgtTrack.cpp:42: QByteArray data;
src/qmapshack/qlgt/CQlgtRoute.cpp:25: QByteArray data;
src/qmapshack/qlgt/CQlgtWpt.cpp:27: QByteArray data;
src/qmapshack/CMakeLists.txt.user:7: <value type="QByteArray">{e69f8491-77c5-4d14-aeaa-fe640e86d8b2}</value>
src/qmapshack/CMakeLists.txt.user:22: <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
src/qmapshack/CMakeLists.txt.user:28: <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
src/qmapshack/CMakeLists.txt.user:32: <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
src/qmapshack/device/CDeviceWatcherLinux.cpp:184: // This translates to an array of QByteArray. Don't know why there
src/qmapshack/device/CDeviceWatcherLinux.cpp:191: QByteArray data;
src/qmapshack/realtime/gpstether/CRtGpsTetherInfo.cpp:254: const QByteArray& data = line.toLatin1();
src/qmapshack/realtime/gpstether/CRtGpsTetherRecord.cpp:24: QByteArray data;
src/qmapshack/realtime/IRtRecord.h:78: virtual bool writeEntry(const QByteArray& data);
src/qmapshack/realtime/IRtRecord.h:91: virtual bool readEntry(QByteArray& data);
src/qmapshack/realtime/IRtRecord.cpp:52: QByteArray data;
src/qmapshack/realtime/IRtRecord.cpp:69:bool IRtRecord::writeEntry(const QByteArray& data) {
src/qmapshack/realtime/IRtRecord.cpp:93:bool IRtRecord::readEntry(QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.h:64: using fAisHandler = std::function<void(const QByteArray&)>;
src/qmapshack/realtime/ais/CRtAisInfo.h:65: fAisHandler aisDefault = [&](const QByteArray& t) { qDebug() << QString::number(t[0]) << "unknown"; };
src/qmapshack/realtime/ais/CRtAisInfo.h:118: quint32 get6bitInt(const QByteArray& data, int start, int count);
src/qmapshack/realtime/ais/CRtAisInfo.h:119: qint64 get6bitSignedInt(const QByteArray& data, int start, int count);
src/qmapshack/realtime/ais/CRtAisInfo.h:120: void getString(const QByteArray& data, QString& string, int start, int count);
src/qmapshack/realtime/ais/CRtAisInfo.h:261: void aisClassAcommon(const QByteArray& data);
src/qmapshack/realtime/ais/CRtAisInfo.h:262: void aisStaticAndVoyage(const QByteArray& data);
src/qmapshack/realtime/ais/CRtAisInfo.h:263: void aisClassBcommon(const QByteArray& data);
src/qmapshack/realtime/ais/CRtAisInfo.h:264: void aisAidToNavigation(const QByteArray& data);
src/qmapshack/realtime/ais/CRtAisInfo.h:265: void aisStatic(const QByteArray& data);
src/qmapshack/realtime/ais/CRtAisInfo.h:275: QByteArray assembler;
src/qmapshack/realtime/ais/CRtAisRecord.cpp:24: QByteArray data;
src/qmapshack/realtime/ais/CRtAisInfo.cpp:56: aisDict[positionReportClassA] = [&](const QByteArray& t) { aisClassAcommon(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:57: aisDict[positionReportClassAassignedScheduled] = [&](const QByteArray& t) { aisClassAcommon(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:58: aisDict[positionReportClassAresponseToInterrogation] = [&](const QByteArray& t) { aisClassAcommon(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:59: aisDict[staticAndVoyageRelatedData] = [&](const QByteArray& t) { aisStaticAndVoyage(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:60: aisDict[standardClassBpositionReport] = [&](const QByteArray& t) { aisClassBcommon(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:61: aisDict[extendedClassBequipmentPositionReport] = [&](const QByteArray& t) { aisClassBcommon(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:62: aisDict[aidToNavigationReport] = [&](const QByteArray& t) { aisAidToNavigation(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:63: aisDict[staticDataReport] = [&](const QByteArray& t) { aisStatic(t); };
src/qmapshack/realtime/ais/CRtAisInfo.cpp:196: const QByteArray& data = line.toLatin1();
src/qmapshack/realtime/ais/CRtAisInfo.cpp:209: const QByteArray& payload = tokens[5].toLatin1();
src/qmapshack/realtime/ais/CRtAisInfo.cpp:215: QByteArray data(payload.size(), 0);
src/qmapshack/realtime/ais/CRtAisInfo.cpp:251:void CRtAisInfo::aisClassAcommon(const QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:280:void CRtAisInfo::aisStaticAndVoyage(const QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:324:void CRtAisInfo::aisClassBcommon(const QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:370:void CRtAisInfo::aisAidToNavigation(const QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:405:void CRtAisInfo::aisStatic(const QByteArray& data) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:453:quint32 CRtAisInfo::get6bitInt(const QByteArray& data, int start, int count) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:484:qint64 CRtAisInfo::get6bitSignedInt(const QByteArray& data, int start, int count) {
src/qmapshack/realtime/ais/CRtAisInfo.cpp:496:void CRtAisInfo::getString(const QByteArray& data, QString& string, int start, int count) {
src/qmapshack/realtime/opensky/CRtOpenSky.cpp:262: QByteArray data = reply->readAll();
src/qmapshack/realtime/opensky/CRtOpenSkyRecord.cpp:24: QByteArray data;
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
I can't scroll the list of waypoint icons with the porting_qt6 branch.
Couldn't find any issue on Windows 10. Can change waypoint icon without problem.
Another small issue:
The editbox to change name of the view has a "&" sign somewhere in the name. This happens also for existing map views. The name of the mapviews tab is clean though.
Again: everything ok with Windows10.
Started with a fresh environment by renaming the folder containing qmapshack.conf
and workspace.db
. Also removed the language, still the same for me. Looking into qmapshack.conf
there are several entries like:
Views\View%201\backColor=#ffffbf
[...]
Views\View%201\scales=0
The map view name shown in QMS was View 1
, so i wonder where the %20
is coming from.
@wthaem how are those entries in your qmapshack.conf
?
I tried to reproduce both issues.
Waypoint Icon: The list of icons is scaled the way that it fits into the screen. No need to scroll. Do you have a special screen size? Maybe related to https://github.com/Maproom/qmapshack/issues/691
No &
in the view name. If I recall right the & is used in Qt to mark the shortcut key when part of the name. But I do not see why this should happen. See ctor of CCanvas. Also see https://doc.qt.io/qt-6/qtabwidget.html#addTab
The %20
is an escape sequence for the space in the name. HTTP URLs use the same mechanism.
In my case Views\Ansicht%201\backColor=#ffffbf
as it should be. For explanation see last comment by kiozen.
Thanks for the explanation and testing.
Waypoint Icon: The list of icons is scaled the way that it fits into the screen. No need to scroll. Do you have a special screen size?
The list never fitted onto my screen, also with QMS 1.17.1. My screen size is 1920 x 1080 pixel:
$:> xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
1920x1080 60.00*+ 50.00 59.94
[...]
Screenshot of full screen height, i can't scroll to a waypoint icon below "Gas Station":
Name of view, i can live with that ;)
Strange the list always looked like this on all of my machines
Strange the list always looked like this on all of my machines
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 menu->sizeHint()
in
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 sizeHint()
somehow and didn't worked for me.
At least: If i add menu->setMaximumHeight(1080);
it's possible for me to scroll the single column list again. But this is not a solution at all.
Thanks for the explanation and testing.
Waypoint Icon: The list of icons is scaled the way that it fits into the screen. No need to scroll. Do you have a special screen size?
The list never fitted onto my screen, also with QMS 1.17.1. My screen size is 1920 x 1080 pixel:
$:> xrandr Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384 DisplayPort-0 disconnected (normal left inverted right x axis y axis) HDMI-A-0 disconnected (normal left inverted right x axis y axis) DVI-D-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm 1920x1080 60.00*+ 50.00 59.94 [...]
Screenshot of full screen height, i can't scroll to a waypoint icon below "Gas Station":
Name of view, i can live with that ;)
I confirm. same bug on linux/wayland
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
[1] https://github.com/vincentxavier --=_4feb80ae507cd338001208c6883fb2d4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8
Le 28.11.2024 23:05, kaputtnik a écrit :<= /p>
kwin, with plasma 6
--=_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.
qt devs say a QMenu shouldn't contain so much entries and one should consider to rethink this
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.
Did anyone test against a Qt version directly installed from the Qt binary servers? Packages shipped with distributions are sometimes weird.
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 menu->addAction()
in this loop
https://github.com/Maproom/qmapshack/blob/c54224272d0235c56a5ec08504ce692694c202f2/src/qmapshack/helpers/CWptIconManager.cpp#L306-L315
the sizeHint
grows in height per 27 px . But the behavior is different with kwin and openbox:
sizeHint
will not change anymore. The result at the end of the loop is sizeHint() = QSize(696, 1075)
sizeHint() = QSize(252, 3154)
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 QMenu* menu = new QMenu(title, parent);
):
QSize(-1, -1)
, which is an invalid size and no preferred size is usedQSize(3, 3)
I have tried to subclass QMenu to override sizeHint() to return initially QSize(-1, -1)
but due to my little knowledge of c++ i made probably a failure and this didn't worked.
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 addAction()
may affect the recalculation of sizeHint.
Lost in QT :smile:
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:
2024-11-29 18:10:24.153 [debug] sizeHint initial: QSize(3, 3)
2024-11-29 18:10:24.153 [debug] size initial: QSize(100, 30)
2024-11-29 18:10:24.153 [debug] sizePolicy QSizePolicy(horizontalPolicy = QSizePolicy::Preferred, verticalPolicy = QSizePolicy::Preferred)
2024-11-29 18:10:24.153 [debug] geometry initial: QRect(0,0 100x30)
2024-11-29 18:10:24.153 [debug] layout initial: QObject(0x0)
2024-11-29 18:10:24.157 [debug] sizeHint end: QSize(252, 3154)
2024-11-29 18:10:24.157 [debug] size end: QSize(100, 30)
2024-11-29 18:10:24.157 [debug] sizePolicy end: QSizePolicy(horizontalPolicy = QSizePolicy::Preferred, verticalPolicy = QSizePolicy::Preferred)
2024-11-29 18:10:24.157 [debug] geometry end: QRect(0,0 100x30)
2024-11-29 18:10:24.157 [debug] layout end: QObject(0x0)
This branch contains also some lines (commented now) which at least gives the possibility to scroll the single column again.
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.