Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.0k Topics 454.4k Posts
QtWS25 Last Chance
  • Simulating a joystick

    Solved
    2
    0 Votes
    2 Posts
    154 Views
    serkan_trS
    I made a joystick as I wanted. You can check the code on this page.
  • Reading data from serial port

    Solved
    6
    0 Votes
    6 Posts
    278 Views
    serkan_trS
    I made the necessary modifications. In this part, I monitor the port at specific intervals and close the port if there is a change in the list of connected cards. This ensures that the port automatically connects and closes when the card is removed. My code is as follows, and you can access it on this GitHub page.
  • Proper way to remove connections from a QGraphicsScene

    Unsolved
    11
    0 Votes
    11 Posts
    316 Views
    JonBJ
    @james-b-s Then I think you have a problem! I believe to disconnect a lambda explicitly (if you cannot introduce a slot object) you need to store the result of the connect() and pass that to disconnect(). But presumably you cannot do that either if the code you show is untouchable third-party? P.S. If you're interested in a discussion on this slot-lambda-functor-without-slot-object destruction problem read through https://interest.qt-project.narkive.com/AiSB9wkP/who-disconnects-lambda-expression-slots from when it was raised 12 years ago :)
  • Implement a Custom Protocol on Mac

    Unsolved mac os qtwidgets
    14
    0 Votes
    14 Posts
    2k Views
    S
    The Implementation to handle a custom Protocol in the Application does no more work in Qt 6.8.2 as described above (only the C++ programming part, the other stuff - Info.plist etc. remains unchanged) The correct way to implement such a handler is to use void QDesktopServices::setUrlHandler() See https://doc.qt.io/qt-6/qdesktopservices.html#setUrlHandler This paragraph also describes how to set Info.plist etc... This most likely also would have worked in 6.5.3 - why did I never find it? For Windows all of this works quite differently. Registering works through well known registry entries: [HKEY_CLASSES_ROOT\myprotocol] "URL Protocol"="" [HKEY_CLASSES_ROOT\myprotocol\shell] [HKEY_CLASSES_ROOT\myprotocol\shell\open] [HKEY_CLASSES_ROOT\myprotocol\shell\open\command] @="\"path to application.exe" \"%1\" This will just start a new instance of the application with the custom protocols URL as first parameter %1. Its the applications responsibility to handle that correctly (i.e. call a existing instance via a QLocalSocket etc.
  • 0 Votes
    6 Posts
    245 Views
    SGaistS
    You're welcome ! Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so other forum users may know a solution has been found :-)
  • qformlayout cleanup/repaint after takerow()

    Solved qformlayout takerow qt 5.14
    5
    0 Votes
    5 Posts
    71 Views
    SGaistS
    Oh ! My bad ! I meant that takeRow would allow the OP to not have to recreate the row content every time.
  • Great job updating the Qt docs with a sidebar

    Unsolved
    6
    7 Votes
    6 Posts
    202 Views
    A
    In my case, I would like the Qt version documentation popup to always be visible, or even better, to be set only once, because every time I need to look for something, I have to change the Qt version.
  • QMenu does not properly adjust to size of contents

    Solved
    3
    0 Votes
    3 Posts
    118 Views
    S
    @Christian-Ehrlicher perfect, thank you!
  • 0 Votes
    24 Posts
    2k Views
    W
    Created a new project, build it and all was fine (the same code). And as stated above the reason was mixing of debug/non-debug libraries. Now the whole issue as it looks occurred when that Project->Options->Advanced->Use Debug Libraries was set to No (in all VS versions I have never set this value to anything.. I assume it came with VS22). Which caused that Compiler->Code Generation->Runtime libraries switched to non-debug version in the background. [image: b98e4f15-af10-4ffc-89f6-cf820a5e846b.png] So the solution is to switch the 'Use Debug Libraries' to true and all will be ok.
  • [Unit Test Coverage] How can the industry improve QT code coverage

    Unsolved
    2
    0 Votes
    2 Posts
    39 Views
    jsulmJ
    @xurongqin Not clear to me: do you want to test Qt code or the code of your application?
  • How to resize the Layout dynamically using some slider during runtime

    Unsolved
    7
    0 Votes
    7 Posts
    152 Views
    jsulmJ
    @Bonnie No, there is a QScrollArea and the OP wants to resize a widget, so that other widgets are moved without resizing the window but using the scroll area instead.
  • QT 5.15 QSSLCertificate::importpkcs12 returns false, how do I debug the reason?

    Unsolved
    14
    0 Votes
    14 Posts
    357 Views
    C
    QSslSocket::sllLibraryBuildVersionString() "Returns the version string of the SSL library in use at compile time. " That is, the version of the OpenSSL libraries that the Qt binaries you are using were built to match. This does not mean those libraries are present in your runtime environment: they are detected and used if present. So, your runtime environment needs to have OpenSSL 1.1.1 libraries. You may be able to access a compatible version through the Qt Online Installer. Ensuring it is in the run time environment (application binary directory or PATH on Windows, LD_LIBRARY_PATH on Linux etc.) is largely up to you.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QScreenCapture and X11 virtual framebuffer

    Unsolved
    2
    0 Votes
    2 Posts
    80 Views
    SGaistS
    Hi, Interesting one ! As is, I don't think so, at least from an "external application" recording point of view. I think it should work if the application is started on the virtual frame buffer.
  • Problem with Ui::Dialog not recognized

    Unsolved
    8
    0 Votes
    8 Posts
    219 Views
    JonBJ
    @auvonspam said in Problem with Ui::Dialog not recognized: The instructions say the 1st one should load the data. And it does. But why not the 2nd one, too? You are aware that in the first instance you push a button to tell it to load the data from file and push to shared memory while in the second instance you push a different button telling it to read from the shared memory? As for which of the two dialogs you click first or second that should not matter. Just you need to load from file to memory before you try to read from memory.
  • "No such file or directory" error qrc

    Solved
    8
    0 Votes
    8 Posts
    227 Views
    jsulmJ
    @AstroFinch said in "No such file or directory" error qrc: needed to be listed as an executable It is not listed as an executable (your executable is named "test"). It is listed as a source item to build your executable (just like main.cpp).
  • QGraphicsView + QChart with explicit plotArea: Cannot set background brush

    Unsolved
    3
    0 Votes
    3 Posts
    81 Views
    U
    If I don't set an explicit plotArea, setting the QChart background will work as intended, so I don't think it's colliding with QGraphicsView's background per se. Btw in my application I'm also setting the QGraphicsView background explicitly, but the problem occurs either way.
  • Segmentation Faultwith QAbstractSocketPrivate and QTimer

    Unsolved
    3
    1 Votes
    3 Posts
    80 Views
    N
    Unfortunately we aren't able to figure out where the problem is coming from exactly, so I cannot provide you with a minimal example; and I am also unable to give you the source-code since it is internal to our organization. Your answer, however, has been useful and I think I have an idea of what the problem may be. Thank you.
  • 0 Votes
    18 Posts
    447 Views
    Z
    @Kevin-Hoang Hi,i tried to call QApplication::processEvents() in the screenAdd event,i found that it has no help. It still does not work. Thanks for your suggestion.
  • QByteArray losing first element Qt 6.8

    Unsolved
    5
    0 Votes
    5 Posts
    197 Views
    SGaistS
    Hi, Beside the good question of @Christian-Ehrlicher about your use case, if you want to use meta objects, then do it all the way for both signals and slots. That will make your life easier.