Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Application does not exit after mpv_set_wakeup_callback

    Solved
    3
    0 Votes
    3 Posts
    344 Views
    A
    Yes. The problem was with Qt internals conflicting with mpv library's way of multi threading. I have solved the problem by using a QT alternative to mpv_set_wakeup_callback. My solution is available at: https://github.com/aario/qtible/blob/main/mediaplayer/mpveventloop.cpp void MPVEventLoop::eventLoop() { qInfo() << "Started event loop"; while (1) { if (mustShutdown) break; mpv_event *event = mpv_wait_event(mpv, 0.01); switch (event->event_id) { case MPV_EVENT_NONE: break; case MPV_EVENT_FILE_LOADED: emit fileLoaded(); break; case MPV_EVENT_END_FILE: emit endFile(); break; case MPV_EVENT_PROPERTY_CHANGE: { mpv_event_property *property = (mpv_event_property *)event->data; if (strcmp(property->name, "time-pos") == 0) { if (property->format == MPV_FORMAT_DOUBLE) { emit timePosChanged(*(double *)property->data); } } break; } default: qDebug() << "Ignoring MPV event: " << event->event_id; } } } And then: mpvEventLoop = new MPVEventLoop(mpv); mpvEventLoop->moveToThread(&mpvEventLoopThread); connect(&mpvEventLoopThread, &QThread::finished, mpvEventLoop, &QObject::deleteLater); connect(this, &MediaPlayer::startMPVEventLoop, mpvEventLoop, &MPVEventLoop::eventLoop); connect(mpvEventLoop, &MPVEventLoop::fileLoaded, this, &MediaPlayer::onMpvFileLoaded); connect(mpvEventLoop, &MPVEventLoop::endFile, this, &MediaPlayer::onMpvEndFile); connect(mpvEventLoop, &MPVEventLoop::timePosChanged, this, &MediaPlayer::onMpvTimePosChanged); mpvEventLoopThread.start(); emit startMPVEventLoop();
  • Connect sqlserver 2019 to qt

    Unsolved
    2
    0 Votes
    2 Posts
    208 Views
    JonBJ
    @quangdong01 Hello and welcome. From the error message, is your MS SQL Server even running? Nobody can say anything if you do not even tell us what your ODBC connection string is.... (And I assume you mean this message comes from running your application, not from anything in Qt Creator itself, which is just an IDE.)
  • How do I setup Qt 6.2 on Linux Mint to use GLEW / GLFW

    Solved
    4
    0 Votes
    4 Posts
    544 Views
    C
    @MrShawn It's all working fine now, thanks for your help. I do search online before posting questions but sometimes the little nugget that makes the penny drop is difficult to find.
  • Need a filemanager written in C++/QML for windows plateform

    Unsolved
    2
    0 Votes
    2 Posts
    207 Views
    jsulmJ
    @pingal KDE is written using Qt and it features a file manager (Dolphin, https://apps.kde.org/dolphin/).
  • Disable toplevel item of QTreeWidget

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    M
    @JonB Yes, I believe what we are saying is: disabling a QTreeWidgetItem means disabling its descendants, which seems pretty reasonable. It is therefore not possible to have descendants which are themselves enabled. Yes this seems pretty reasonable and expected as a behavior. That's why I suggested all you can use would be selectability (Qt::ItemIsSelectable) as that is allowed to vary such that a parent may be unselectable itself while a descendant is still selectable. I was already playing with this flag (and overriding mouse and keyboards events) for various reasons so my original problem was solely a visual one, so to simulate the graying i used QTreeWidgetItem->setForeground() with a gray color. So far it does what i need (the checkbox of my QTreeWidgetItem isn't grayed out but this detail is so minor that i'm not bothering with that). So i'm calling it quit now.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Cannot create children for a parent that is in a different thread

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    P
    I've now used QThread instead of std::thread and used signal/slots to transfer data from my Listening_thread to main thread. problem solved. Thanks for the helpful replies.
  • qt xml Serialize funtion

    Unsolved
    2
    0 Votes
    2 Posts
    161 Views
    I
    https://github.com/smurfomen/QSerializer The source code can be obtained here.
  • Change QLineEdit placeholder text color

    Solved
    13
    0 Votes
    13 Posts
    14k Views
    H
    @xmichelo-0 this placeholder text color method did not have effect at UI first open, only puts some words on the lineEdit field and then delete it, it just work. test on QT 6.2 with MacOS.
  • Unable to compile when using QCustomPlot

    Unsolved qcustomplot desktop qgenericmatrix msvc2019 qt creator
    2
    0 Votes
    2 Posts
    1k Views
    jsulmJ
    @JPolo said in Unable to compile when using QCustomPlot: I use Qt Creator 4.15.0 based on Qt 5.15.2 MSVC2019 That is not necesserilly Qt version you're using (this is the Qt version used to build QtCreator). What Qt version did you install? What is the first error message? Did you do what the tutorial suggests: "To use the shared library in your application, set the define QCUSTOMPLOT_USE_LIBRARY before including the QCustomPlot header."?
  • modbus udp

    Unsolved
    3
    0 Votes
    3 Posts
    438 Views
    P
    Thanks @raven-worx
  • Column 1 out of range although datas aren't missing and data are showing properly

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    Thank YouT
    @JonB Although it is kinda late but l am currently using QT 5.15.2. But also getting same result. I used the drivers from https://github.com/thecodemonkey86/qt_mysql_driver/releases I don't know any other drivers for this
  • "forcing" the recomputation of a property

    Unsolved
    2
    0 Votes
    2 Posts
    185 Views
    JKSHJ
    @EddieC Have a look at the new property system in Qt 6: https://www.qt.io/blog/all-about-property-bindings-in-qt-6.2
  • This application failed to start because no Qt platform ...

    Solved
    16
    0 Votes
    16 Posts
    9k Views
    JKSHJ
    @Chris-King said in This application failed to start because no Qt platform ...: I am running into this message attempting to run Houdini. Please provide the full, exact message. There are subtly different versions of the message; some include additional details which can help pinpoint the exact issue. Are all these vendors not properly installing their apps? Most vendors probably installed their apps correctly. However, it only takes 1 badly-behaved app to cause DLL Hell and ruin things for everyone else on that PC. You'll need to track down that badly-behaved app and do something about it. Are users expected to modify their installations of these apps using windeployqt? No, users are not expected to do anything. Software developers are expected to provide well-behaved installers.
  • QWizard vs a QDialog with stack control?

    Solved
    4
    0 Votes
    4 Posts
    428 Views
    D
    Nevermind I had the second group in the "New" dialog for Qt Designer collapsed so I didn't see the wizard option. Now I do. Should be easy from here.
  • Why does Valgrind show me over a 1000 errors related to Qt header files?

    Unsolved
    7
    0 Votes
    7 Posts
    687 Views
    C
    @JonB Thanks, I will try that. But at the moment I can't even run the app, because I tried upgrading to 5.15.2.
  • Getting maximized dialogs normal size?

    Solved
    2
    0 Votes
    2 Posts
    205 Views
    D
    Of course I figured this out just a few minutes after posting, sorry for wasting your time. Anyone who's interested there is a function in the dialog/widget class called normalGeometry() which holds the unmaximized size of the window.
  • Memoy leak using QtCharts

    Unsolved
    30
    0 Votes
    30 Posts
    7k Views
    mrjjM
    @thiagohd Hi I dont think I bug report was ever created or it was further looked at.
  • UI is not updating in build (MSVS 2019, QT6)

    Unsolved
    6
    0 Votes
    6 Posts
    486 Views
    JonBJ
    @Meeuxi This was not the question. I have not used Visual Studio, but I assume when you change a .ui file the project has to rebuild? I am asking whether that happens for the .ui file you say is not reflecting changes in the latest executable?
  • Issues with loadFromData function in QImage

    Solved qimage qpixmap taglib image issue
    14
    0 Votes
    14 Posts
    3k Views
    Christian EhrlicherC
    @Nick-Redwill This is what windeployqt is for...