Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.1k Posts
  • "undefined reference" in moc_mainwindow after deleting GUI element

    9
    1 Votes
    9 Posts
    5k Views
    D
    @Tyrell-Wellick09 It just helped me, so thanks for answering something years later
  • Running UIC on .ui files on Visual Studio

    Unsolved
    5
    0 Votes
    5 Posts
    269 Views
    T
    I had to manually add the form files. It is supposed to recognize the .ui extension. The project didn't.
  • Not compilated Qt from sources

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    N
    Hello JKSH and All! Since I have discussed the same question in two topics, I will repeat the answer too. Thank you, SGaist and JKSH! for helped in another topic - "Why no make QtCreator.exe file". git clone git://code.qt.io/qt/qt5.git qt6 git switch 6.9.2 init-repository.bat And everything went like clockwork without a single "failed:" both when compiling Qt and when compiling QtCreator. If anyone needs instructions when compiling Qt, then I have sketched out a small cheat sheet. I used it myself. I collected bits and pieces wherever I could. Detailed instructions are almost impossible to find. https://gitflic.ru/project/navadvipa-chandra-das/slovar-shrily-prabhupady-na-copperspice Thanks! With respect, Navadvipa Chandra das.
  • issue with nested qtabwidget with qvector<qtableview*> on the inner table

    Solved
    12
    0 Votes
    12 Posts
    575 Views
    SGaistS
    Great ! Since you have it working now please mark the thread as solved using the "Topic Tools" button or the three dotted button beside the answer you deem correct so that other forum members may know a solution has been found :-)
  • Why no make QtCreator.exe file

    Solved
    9
    0 Votes
    9 Posts
    470 Views
    N
    Hello, JKSH and All! Thank you, SGaist and JKSH! It helped. git clone git://code.qt.io/qt/qt5.git qt6 git switch 6.9.2 init-repository.bat And everything went like clockwork without a single "failed:" both when compiling Qt and when compiling QtCreator. If anyone needs instructions when compiling Qt, then I have sketched out a small cheat sheet. I used it myself. I collected bits and pieces wherever I could. Detailed instructions are almost impossible to find. https://gitflic.ru/project/navadvipa-chandra-das/slovar-shrily-prabhupady-na-copperspice Thanks! With tregards, Navadvipa Chandra das.
  • Unable to save PySide6 documentation

    Unsolved
    12
    0 Votes
    12 Posts
    4k Views
    C
    If anyone comes across this that has actually built the offline documentation for PySide6 on Windows 11 and makes use of it via assistant I'd love to know how the hell you got it done because I'm absolutely stumped.
  • Need advice on simple item/view design

    Unsolved
    8
    0 Votes
    8 Posts
    351 Views
    R
    ChatGPT gave me this: Which 8-bit text encoding has the letter 'ã' (small 'a' with tilde) assigned to the code point 0xC6? You're referring to DOS Code Page 850 (also known as CP 850, “DOS Latin‑1”). In this encoding, the small 'a' with tilde (ã) is indeed assigned to the byte value 0xC6 ([utf8-chartable.de][1], [Android Git Repositories][2], [Debian Sources][3]). To summarize: In ISO‑8859‑1 (Latin‑1) and Unicode‑based encodings like UTF‑8, ã is not at 0xC6—it appears at 0xE3 ([technojeeves.com][4], [utf8-chartable.de][5]). But in CP 850, the mapping is different: 0xC6 maps to Unicode U+00E3, which is ã ([Android Git Repositories][2], [Debian Sources][3], [utf8-chartable.de][1], [Scribd][6]). Therefore, the 8‑bit encoding you're asking about is Code Page 850 (CP 850). It looks like the file I was examining might be legal cp850, but neither ICU nor uchardet was able to recognize it as such.
  • QTWayland hardware and server buffer integration

    Unsolved
    2
    0 Votes
    2 Posts
    294 Views
    D
    Hello! Available client buffer integrations are: wayland-egl (this is the default) brcm xcomposite-egl xcomposite-glx
  • Add resource file (*.qrc) to static library. How?

    Solved
    4
    0 Votes
    4 Posts
    292 Views
    B
    Issue close for me. Got published example of how to use QML in libraries.
  • read binary data from QDataStream with feedback

    Unsolved
    6
    0 Votes
    6 Posts
    248 Views
    JonBJ
    @DungeonLords Yes, because you reading from regular file. You would need it if you were reading from a streaming device instead. Using Read Transactions When a data stream operates on an asynchronous device, the chunks of data can arrive at arbitrary points in time. The QDataStream class implements a transaction mechanism that provides the ability to read the data atomically with a series of stream operators
  • Segmentation Faultwith QAbstractSocketPrivate and QTimer

    Solved
    4
    1 Votes
    4 Posts
    382 Views
    N
    Okay, we solved the issue. Apparently it had to do with the ordering of connect statements or (we're not sure which solved it) the creation of new objects on the heap within the QObject's constructor.[1] [1] https://wiki.qt.io/QThreads_general_usage
  • Passing references in signals and slots

    Solved
    6
    0 Votes
    6 Posts
    377 Views
    S
    @Pippin said in Passing references in signals and slots: If the object itself isn't const, but I pass it as a const reference through signals and slots, I guess that still works? As long as the signals and slots are declared with const& Yes, it is sufficient if it is declared const& in the signals and slots.
  • DLL Use

    Unsolved
    2
    0 Votes
    2 Posts
    138 Views
    Pl45m4P
    @Carl_Yj What is SetPortConfig? what program are you talking about? Please provide more information
  • ICU library mismatch in multiple Qt versions

    Solved
    4
    0 Votes
    4 Posts
    240 Views
    R
    @Axel-Spoerl Thanks for your feedback! I took your advice given in the bug report about installing multiple versions of ICU in parallel (much easier than building Qt from source). It was quite tricky getting it to work because of the "renaming" feature that ICU uses. Requires some special "if...else" logic in the qmake project file, but it looks OK now. I had installed the qt5-dev libraries from the Ubuntu 24.04.3 repositories which are at Qt version 5.15.13. Also, I installed the ICU dev packages from the Ubuntu repos which are compatible with their Qt 5 libraries. I have Qt 6 libraries installed under a folder /home/Qt/...which Qt Creator made, and these are not in the $PATH. So the trick was to find out which versions of ICU are needed by each QtCore .so library. Qt 6.5.3 up to and including Qt 6.6 use ICU 56, and versions 6.7 and above use ICU 73. So I built ICU from source, being sure to download the appropriate ICU release packages, and installed those to appropriate subfolders under my /opt/ directory: /opt/local/icu56/... /opt/local/icu73/... In addition to that, the INCLUDEPATH variable needs to be set in the qmake project file so that the headers in /opt/... are found BEFORE the headers in usr/include/unicode. This is what that part of my .pro qmake project file looks like now: if(equals(QT_MAJOR_VERSION,6)) { if(lessThan(QT_MINOR_VERSION,7)) { ICU_VERSION_SUFFIX = 56 } else { ICU_VERSION_SUFFIX = 73 } ICU_INCLUDES="/opt/local/icu$${ICU_VERSION_SUFFIX}/include" ICU_LIBS_DIR="/opt/local/icu$${ICU_VERSION_SUFFIX}/lib" ##################################################### # This "#define ICU_VER=..." macro enables the header # "icu_includes.hpp" to find the correct ICU headers: ##################################################### ICU_VERSION = ICU_VER=$${ICU_VERSION_SUFFIX} DEFINES += "$${ICU_VERSION}" } else { # Qt 5 will use the system ICU libraries, which are ICU version 74.2: ICU_INCLUDES="/usr/include" ICU_LIBS_DIR="/usr/lib/x86_64-linux-gnu" } LIBS += -L\""$${ICU_LIBS_DIR}"\" -licudata -licui18n -licuio -licutest -licutu -licuuc INCLUDEPATH += \ $${ICU_INCLUDES} \ include \ # etc. Then I have one header icu_includes.hpp which looks like this: #ifndef ICU_INCLUDES_HPP #define ICU_INCLUDES_HPP #ifndef ICU_VER /* ICU_VER is not defined for Qt 5, only for different flavors of Qt 6: */ #include <unicode/utypes.h> #include <unicode/uclean.h> #include <unicode/ucsdet.h> #elif ICU_VER==73 #include "/opt/local/icu73/include/unicode/utypes.h" #include "/opt/local/icu73/include/unicode/uclean.h" #include "/opt/local/icu73/include/unicode/ucsdet.h" #elif ICU_VER==56 #include "/opt/local/icu56/include/unicode/utypes.h" #include "/opt/local/icu56/include/unicode/uclean.h" #include "/opt/local/icu56/include/unicode/ucsdet.h" #endif #endif // ICU_INCLUDES_HPP All other code which calls ICU functions directly (only one .cpp file, actually) includes this header. Since project include paths take preference over system paths, the "renaming" of functions like u_init() still works correctly. That means that u_init(), for example, resolves to u_init_56(), or u_init_73(), or even u_init_74()depending on the Qt version. Now it has occurred to me that I could auto-generate the header using a file icu_includes.hpp.in and using variable substitutions from the project file (my next "TO DO"...) So, one interesting fact is that my project, when built with Qt 5, uses a higher ICU library version than when built with Qt 6! (but only because that is what the Ubuntu 24.04 system installs). I'm sure this scenario can be improved upon, so your suggestions are most welcome! :)
  • 0 Votes
    3 Posts
    175 Views
    I
    Relevant bug report ticket: https://bugreports.qt.io/browse/QTBUG-128489 What it implies is that no view in NSOpenPanel actually handles key equivalents directly; ⌘A and other shortcuts do anything only because the expectation is that application menu bars will have a "Select All" menu item with that key equivalent, that sends the selectAll: action to whatever the first responder is. Somewhat of a WTF, but hey this is macOS... I tried removing that menu item from a pure native AppKit app I have lying around, and indeed can reproduce Cmd+A not working in open and save panels... There is internal way in Qt managed menu bars to have such an item exist, but the menu role for it isn't exposed for some reason. It only works by looking for a menu QAction that has the literal text "Select All". The code shows that the text can be translated, although through an unusual context: https://github.com/qt/qtbase/blob/5e8b3ee0ae8cabf3c1a84d4568ff5f9f2bb09544/src/plugins/platforms/cocoa/qcocoamenuitem.mm#L279 That will probably explain why it breaks with a Sweedish locale. What a doozy.
  • How to set a GraphicPipline with multiple QRhiShaderResourceBindings sets?

    Unsolved qrhi shader vulkan
    1
    0 Votes
    1 Posts
    75 Views
    No one has replied
  • 0 Votes
    16 Posts
    2k Views
    K
    @SGaist Sorry about that 🙂. To be honest, I was busy with another project, so I wasn’t fully focused, and since this wasn’t my main target, I overlooked the instructions. 🙏 Now it’s clear to me, and I managed to build successfully. Thanks again for pointing me in the right direction!
  • Macros in QRhi shaders?

    Solved
    2
    0 Votes
    2 Posts
    138 Views
    H
    As usual, after asking the question, I found the answer myself. The key is to passPERTARGETCOMPILE to qt6_add_shaders.
  • Delayed Window State Read after Hide Gives Wrong Results Even in X11

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    J
    Marking as solved. The solution was to cache the state before hide and restore when shown. I mean the setter docs (https://doc.qt.io/qt-6/qwidget.html#setWindowState) said any sets to window state will apply after show... not sure what is going on here.
  • Why Does Minimization Immediately after Show and Activation Cause Non-Minimization?

    Solved
    8
    1 Votes
    8 Posts
    2k Views
    J
    @Kent-Dorfman Alright, reasonable! Guess I'll just need to be careful with my logic to not have any such things operate in my PySide6 app instead of ranting about it here. Marking as solved since there's no reliable way to hook into finish activation.