Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.0k Topics 453.9k Posts
  • 3 Votes
    29 Posts
    29k Views

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • 0 Votes
    15 Posts
    260 Views

    @GrecKo said in When to use signals and slots, versus direct function calls, from parent to child?:

    Just to be pedantic: that's not actually the case. If a signal has the same return type as the slot it is connected to, the return value of the slot will be correctly forwarded back to the signal (unless the connection is queued ofc.)

    I've never seen this before in working code. Proof please ;-)
    I'm with @JonB, when I learned about signals it was told (somewhere, I think even in the Qt Documentation) that signals are always declared with void.
    (technically void functions that are being caught by MOC when parsing the code to make the connection and "call" the slot/connected function when the signal "function" is called/emitted)

    @SuhasKrishanamurthy
    why does your answer look like it was written by ChatGPT?! ;-)
    I'm pretty sure OP could have done that himself if he wanted to ;-)

  • QTabwidget animation problem

    Unsolved about 7 hours ago
    0 Votes
    4 Posts
    44 Views

    @AlperenCvs

    And where is the relevant code snippet?

  • 0 Votes
    7 Posts
    172 Views

    This works fine for me

    MYSQL_OPT_SSL_CA=D:/mysqlca/ca-cert.pem;MYSQL_OPT_SSL_MODE=SSL_MODE_VERIFY_CA

    But you have to make sure the correct libmysql.dll is loaded - I accidentally had an old from MySQL Connector C 6.1 in my PATH which was picked up... took me 2 hours to fiddle out what went wrong.

    Tested with Qt6.10 but there were no changes wrt this since 6.6 iirc.

  • 0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    19 Posts
    1k Views

    @Kaostheory said in QFileDialog not responding to done() method as QDialog does:

    I know the post is quite old, but I'm also facing the issue on windows, using PyQt5.
    Did you find a way to prempt the closure of the native windows filedialog ?

    The way I made it work for me was to use non native dialog...nothing else worked back in days. Since those days, I am using pySide6 now (no more pySide2 here) and I didn't retest original behavior - now thinking I should have!

    The same goes for you with PyQt5 and test with PyQt6 might be an option to try.

    If I get around to test this again with pySide6, I will update this thread. Good luck!

  • 0 Votes
    17 Posts
    319 Views

    You have to build debug and release libs (msvc is picky here)

    -DCMAKE_BUILD_TYPE=Release

    -DCMAKE_BUILD_TYPE=Debug

    Debug was already built.

  • 0 Votes
    7 Posts
    111 Views

    @Jo-Jo hi,

    Just in case, Qt Creator's source code is open source so you can also learn from it directly :-)

  • 0 Votes
    16 Posts
    241 Views

    @Christian-Ehrlicher @jsulm @zvoopz i found out why it does not work ! i dont understand why ! but it worked

    i went to Enviroment Variables then at System variables there was a variable for QT i deteleted it and boom it works without restart without anything just like that

    THANKS GUYS for trying to help me <3

  • 0 Votes
    8 Posts
    110 Views

    I found out that flash drive detection is almost independent of setRootPath. If you set any correct path in setRootPath, then when you insert a flash drive, QTreeView will display it.

    On the other hand, the behavior of setRootPath still remains unclear. If, for example, I set setRootPath like this:

    model->setRootPath("C:\Users\Username\Desktop\folder");

    Even though C:\Users\Username\Desktop\folder was set as the path to be monitored, QFileSystemModel monitors changes in other directories as well. For example, if you create a file in C:, QTreeView will display this file despite the fact that we are monitoring C:\Users\Username\Desktop\folder and not C:\

    What is the reason for this behavior, maybe someone knows?

  • 0 Votes
    23 Posts
    400 Views

    @Christian-Ehrlicher @JonB agree with you guys about lastModified, thanks!

  • 0 Votes
    23 Posts
    2k Views

    I found one of my debug dll was compiled by using runtime library MultiThreadedDLL.
    After change C/C++ -> runtime library as MultiThreadedDebugDLL in visual studio, the problem is gone.

    Use the tool Dependencies, I can see the bad dll is using:

    image.png

    And the good dll is using:
    f46e8deb-f487-4570-841d-ab9fbd8523d0-image.png

  • 0 Votes
    7 Posts
    111 Views

    Plus, your hardware might be too old for Qt 6.5 as well. For example, its multimedia module may require higher versions of gstreamer or FFmpeg which will not work with your hardware possibly. The drivers of newer versions of gstreamer or FFmpeg may not be compatible with the video card in your computer.

  • 0 Votes
    14 Posts
    279 Views

    @Pl45m4 said in Using qt for a commercial application on windows (LGPL):

    Probably, but I meant, if there is no Qt Company anymore... all its licenses are void?!

    IANAL of course!

    To my understanding, software licensing is based on copyright law. The law controls if and when a copyright expires and the protected work becomes a free-for-all. For example in the United States it is life + 70 years, so for a painting the painter's estate / inheritors would keep holding the copyright for additional 70 years after death of the original author.

    I'm not sure how that exactly works when the copyright holder is a corporate entity, but I suppose that if the Qt Company goes bankrupt the copyright for the parts of the Qt source code that it held will be sold off to someone by the liquidator as part of the company's intellectual property. At any rate the LGPL license is non-revocable, so anyone who got it can keep using it under the same terms even if there is a new owner.

  • 0 Votes
    3 Posts
    50 Views

    Thanks for your response! However, the situation is a bit more complex than just swapping ControlModifier and MetaModifier on macOS.

    Modifier keys on macOS can be remapped in the Keyboard Modifier Settings. This means ControlModifier does not always correspond to the Command key, and MetaModifier does not always correspond to the Control key. If a user changes these settings, Qt's default mapping no longer reflects the actual physical key being pressed. Command + Left Click is interpreted as a Right Click on macOS by default. This behavior is designed for trackpads and Magic Mouse, but it creates inconsistencies when handling shortcuts. If a user assigns a shortcut using Command, it might get detected as Control, leading to confusion. Users may perceive this as a bug because when setting up a shortcut, they might press Command, but the program registers it as Control (or vice versa, depending on their settings). If they modify their keyboard settings, all existing shortcuts could become misaligned.

    I am looking for a way to access native modifier keys directly, so that when setting up shortcuts, the program accurately detects the actual key pressed, regardless of macOS system settings. Is there a way to achieve this in Qt?

  • 0 Votes
    3 Posts
    2k Views

    Quite late but styling can do it alone, no need of stacking two sliders.
    You have to allow the handle to expand outside of the groove, using the margin property (as indicated in QSlider styling sample):

    QSlider::groove:horizontal { background: #C9CDD0; height: 15px; border-radius: 4px; } QSlider::handle:horizontal { background-color: #51A0D5; width: 50px; height: 50px; /* Handle is placed by default on the contents rect of the groove. Expand outside of the groove. Required offset is -ceil((handle height - groove height) / 2.) = -ceil((50 - 15) / 2.) = -18 */ margin: -18px 0px; border-radius: 25px; }
  • 0 Votes
    3 Posts
    50 Views

    It's unfortunate that QtSvg doesn't support currentColor yet. Do you happen to have a link to the bug report? I'd like to track its progress.
    For now, modifying the SVG file on disk could be an option, but I was hoping for a more dynamic solution.

    Thanks!

  • using QML Pages as items in main.qml

    Unsolved 17 days ago
    0 Votes
    5 Posts
    103 Views

    @MaximBozek If there is no qrc file, create one and add qrc file to your project. Add all qml files into the qrc file.

    you may need a few, for example, one for images, one for qml files and one for xml files, etc.

  • 0 Votes
    3 Posts
    58 Views

    @Swyftl said in Getting multiple errors just by starting a project for Qt.:

    "C:/Qt/6.8.2/mingw_64/bin/qmake" -tp vc

    Why do you want to create a visual studio solution when you are using mingw? This does not match.

  • 0 Votes
    11 Posts
    4k Views

    @raja_sumant said in Qt Online Installer appears to limit download speed (very slow):

    5 years and the issue is still not resolved

    Btw: It is not "still not resolved"... it happens again from time to time.
    Just because you found a topic from 5 years ago where this was mentioned, it doesn't mean that this issue persists since then.