Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.2k Topics 455.5k Posts
  • 3 Votes
    29 Posts
    32k 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.
  • QT5.6.3 Example not running on IMX93

    Unsolved 43 minutes ago
    0 Votes
    3 Posts
    5 Views
    @v.praveen I guess 5.6.3 might be too old for wayland. Any reason why such an old version is applied?
  • QT 5.15.5 not working on i.MX93 platform

    Unsolved about an hour ago
    0 Votes
    2 Posts
    5 Views
    @Akash_shinde said in QT 5.15.5 not working on i.MX93 platform: segmentation fault or core dump Did you analyze them?
  • Delete directory unsing QFile::moveToTrash()

    Unsolved about 7 hours ago
    0 Votes
    2 Posts
    30 Views
    @Zbigniew-Sch Since I would expect it should be OK to move to trash with subdirectories I would make sure no process, including your own, has any of the subdirectories as their current working directory as that would probably prevent it being trashed/moved under Windows.
  • Problems with stacked Progress Dialogs

    Unsolved 2 days ago
    0 Votes
    11 Posts
    190 Views
    @Pl45m4 said in Problems with stacked Progress Dialogs: Is the code above just an example or your real code? I guess this question is asked because your source makes most of us squeam in horror. Others have already pointed out that you should use regular main() for Qt programs. It doesn't help that you are creating your own argc and argv variables to be passed to the QApplication constructor. It is really bad practice to use global variables. Everything above your main function should go into a MainWindow class derived from QMainWindow. You should also avoid using pointers whereever possible. In your particular case there is no reason for Application and mainWindow to be pointers (but mainWindow should also be a local variable). Theoretically, you are leaking memory. (Practically, it doesn't matter because the OS will clean up after you.) @JanLaloux said in Problems with stacked Progress Dialogs: I don't agree. If there is only the global progress window (no step progress shown), the progress dialog remains responsive and it can be cancelled at any time, no other thread is needed. You have of course to check regularly if the cancel button was pressed, and the QProgressDialog::canceled signal is connected to a slot for this. My experience is totally different. I have never seen a smooth animation of the progress bar when doing it this way. And you also have to hit the cancel button at the right time to be able to cancel progress. This is the reason why you'll find many discussions in this forum using QApplication::processEvents to make the progress dialog somehow work properly. But, everybody will tell you not to use QApplication::processEvents. Your actual computation will take way longer if you do this. The only proper way to do this is actually to use a separate thread. I have simplified this for myself and put it into a library: https://github.com/SimonSchroeder/QtThreadHelper. Just use workerThread([](){ /* do stuff */ }); to run any function in another thread (this is derived from QThread::create followed by start()). If you want to wait for the work to finish, use workerThreadJoin() instead. There's another helper guiThread() which I typically use to update the progress bar. You'll find an example in the readme of my lib.
  • Hide Grid Widget

    Unsolved about 8 hours ago
    0 Votes
    2 Posts
    32 Views
    @shreya_agrawal said in Hide Grid Widget: How can I do it? Remove gridWidget from the layout or change its size to 0
  • 0 Votes
    7 Posts
    131 Views
    @ChrisW67 In my case, a.h and b.h are under same folder, but it still not working. I use qt vs tools and Visual Studio 2022, Qt version is 5.9.4.
  • QSoundEffect device selection

    Unsolved 6 days ago
    0 Votes
    2 Posts
    71 Views
    Hi, Is this the Qt version that comes with your distribution ? If not, can you try that one ? Did you also check with a more recent version ? 6.9 was released no too long ago.
  • error IMKCFRunLoopWakeUpReliable

    Unsolved 3 days ago
    0 Votes
    4 Posts
    95 Views
    Did you try to restart your machine once between two runs to check if it still comes up ?
  • Throwing from QFuture::onFailed()

    Unsolved 6 days ago
    0 Votes
    8 Posts
    263 Views
    @Don-Burner said in Throwing from QFuture::onFailed(): I use std::set_terminate, so unhandled exceptions call my terminate handler. EDIT: I thought std::terminate() always called std::abort(). Turns out, it calls the current terminate handler. In short, calling std::terminate() within QFuture::onFailed() works, at least for my purposes. Thanks!
  • MacOS system tray issue

    Unsolved 1 Jun 2024, 10:10
    0 Votes
    7 Posts
    720 Views
    Just in case, the systray example from Qt's documentation works as expected on macOS so it I think it would be good to compare the two code bases to see what is being done differently. The MacOSSysTray implementation takes quite a lot of detours to achieve the same outcome as the systray example. So I would suggest to simplify things there.
  • 0 Votes
    3 Posts
    63 Views
    @jeremy_k I appreciate it. I successfully implemented that feature.
  • Remove default file association

    Unsolved 5 days ago
    0 Votes
    6 Posts
    217 Views
    @Christian-Ehrlicher said in Remove default file association: You can't do this with Qt as it's to OS-specific. You are certainly right about the first part. However, I would claim that this is something (at least up to a certain point) that could actually fall into the realm of Qt. All operating systems have some sort of file type association. Windows and macOS should be pretty straight forward. I am not entirely sure about Linux if this is related to the window manager. There is certainly a certain standard with xdgutils. But, I believe this is mostly for the command line and not used by every window manager. A lot of people would already be covered by supporting Gnome and KDE (maybe another 1 or 2 window managers). What I'm saying is that it is not too crazy to expect this to be part of Qt. QSettings properly stores configuration according to common platform rules (even uses the registry on Windows).
  • 0 Votes
    4 Posts
    269 Views
    @sirspot Hi and welcome to devnet, Please provide a complete minimal compilable example that shows this behavior.
  • Application bundle path

    Unsolved 3 days ago
    0 Votes
    9 Posts
    210 Views
    Sorry, I've misunderstood your goal. So QCoreApplication::applicationDirPath is the simple way to do it.
  • CacheOverflowException

    Unsolved 2 days ago
    0 Votes
    3 Posts
    57 Views
    Super, thanks!
  • Qt 6.9.0 macOS failed to find "WebEngineWidgets"

    Solved 3 days ago
    0 Votes
    4 Posts
    103 Views
    Nice ! Don't forget to mark the thread as solved :-)
  • Can not catch XCB_VISIBILITY_NOTIFY event in Qt6

    Unsolved 6 days ago
    0 Votes
    3 Posts
    129 Views
    ok, thanks, your solutions work and I'm able to get the xcb connection. And I'm able to use xcb_change_window_attributes() (with above code using XCB_CW_EVENT_MASK) to turn on/off receiving native events for a Window (for example XCB_FOCUS_IN), but except the XCB_VISIBILITY_NOTIFY event. I just can not receive this event. is it related to something changed in Qt6?
  • Why small boxes appearing in the QTableView?

    Solved 2 days ago
    0 Votes
    3 Posts
    79 Views
    @Christian-Ehrlicher Thank you, Christian, it worked.
  • layout stretch error?

    Solved 8 days ago
    0 Votes
    5 Posts
    247 Views
    @Pl45m4 I want the leftmost and middle layouts to keep the minimum size, and the rightmost to fill all the remaining space. Now I changed it to (1, 4, 10), the display effect is fine, but I think the effect of (0,0,1) is weird.