Skip to content
  • 143k Topics
    718k Posts
    kkoehneK
    Is this some kind of hybrid where Hello %1 is compiled but during runtime a new QString is created anyway because of the argument? Exactly. u"Hello %1"_s will create a QString with "Hello %1" as content. At runtime, QString::arg() is then called, which will generate a new QString "Hello Tim". Is this even benefitial? In this snippet, no. You might as well just write u"Hello Tim"_s. You typically use arg() if the arguments are not determined at compile time.
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k Topics
    23k Posts
    A.v.OA
    The Issue Context I've been building a docker image for my C++ Qt project which allows me to build the same Qt app for Linux x86_64, aarch64 and Windows x86_64. The image contains Wine to perform the same unittests for Windows as for the Linux build. The image is available from Docker Hub for v6.8.1 and for v6.9.1. The image contains 3 times the Qt framework for the different platforms. Thread Problem on Closing the QApplication What I found is that only the Windows build has one ore more threads hanging or being blocked from terminating making the application not exit. The following simple application just will not exit when the application is build using the Linux MinGW cross compiler on Ubuntu 24.04 which seems to be version 13.0.0. #include <QApplication> #include <QDebug> #include <QPushButton> int main(int argc, char* argv[]) { int rv{0}; QApplication app(argc, argv); QWidget* wgt = new QPushButton(QString(qVersion()) + "/" + QT_VERSION_STR); wgt->setWindowTitle("Qt Test Application"); wgt->resize(300, 120); wgt->show(); rv = app.exec(); delete wgt; qDebug() << "Exiting with code:" << rv; return rv; } The problem threads are part of the by QApplication created pool of threads. Running the application on Windows or Linux using Wine has the same effect. When building the Qt framework from Windows using the MinGW version 13.2.0 does not cause the problem. QtCore Significant Changes v6.8 and v6.9 On GitHub I saw development when comparing v6.8.1...v6.9.1 on a thread "Quality Of Service Level" and in Windows only file src/corelib/thread/qthread_win.cpp. Using Native Windows Build Framework (not possible) When compiling the Qt frame work using MinGW (13.2.0) natively on Windows is not possible due to bug 116159 in MinGW GCC. It should be possible to use an older GCC compiler using a newer libstdc++-6.dll library having backwards compatibility. That bug wil be resolved it seems in GCC version 13.4. Bad Workaround So for now I call std::exit(0) before the QApplication instance goes out of scope, only when compiling the Windows target, which is not a desirable solution. Another one is, canceling all threads except the main one which is also bad. QtBug Report I created a bug report QTBUG-139361 but I doubt it will be fixed at all. Question Is there someone also building the Windows Qt framework v6.9.x from source on Linux using a cross-compiler? If so do you have the same problem as described here when running my small application?
  • Everything related to designing and design tools

    129 389
    129 Topics
    389 Posts
    osirisgothraO
    I have a pretty decent setup for development I notice that QT design studio eats resources like candy -- even if my PC can keep up with it, the fans all kick up into high gear as if I had just accepted 30 network rendering jobs. Its only in the studio though, application performance itself is fine, and in QtCreator/Designer things are fine, just that monster seems to eat and eat, I am not surprised at all to hear people with setups under and at mid-end find it completely unusable. Maybe it has something to do with latest trends showing that environments like Unity can prove new developers really will just upgrade and upgrade and not bat an eyelash, carbon emissions be darned we need more games over here! :3
  • Everything related to the QA Tools

    79 215
    79 Topics
    215 Posts
    M
    I have a desktop app which runs on linux. I have my own laptop which runs on windows. I downloaded squish for windows on my own computer. I downloaded vncserver(tigervnc) on desktop app. Hoping to reach to my desktop app via using VNC on squish IDE and record scenarios. On my computer I created test suite, selected VNC as GUI toolkit. I did my configuration as needed under "Server Settings > Manage AUTs > Attacable AUTs". After that created test case and hit record button but got this error lines. "Warning: AUT '__squish__vncaut' (with AUT path '') does not exist FATAL Starting application Application '__squish__vncaut' could not be started. Squish couldn't start the AUT because the program doesn't exist. Make sure the AUT is really built and was not removed. Also make sure that the path to the AUT is correct in the settings. END End of test Giving up after error" I'm sure my vnc server runs on my desktop app. In https://forum.qt.io/topic/155170 i get that we might have similar issue. Should i download squish for qt? Or should i just download squishserver on my desktop app and expect it to be resolved? If i should download squish server on my desktop where can I the server package without downloading whole installation package on the application?
  • Everything related to learning Qt.

    386 2k
    386 Topics
    2k Posts
    T
    The generated "*.ui.qml" files by QT Design Studio, create an "id" for each component but do not generate an "objectName". Finding components is typically done using the "objectName". Is it possible to ensure QT Design Studio generates an "objectName" for each component? If not, how is one supposed to be able to find/reference the components from python or c++?
  • 2k Topics
    13k Posts
    Chris KawaC
    Don't use timers for game tick. They are completely unsynchronized with the display refresh rate and you'll always get stutter. You can't make it smooth that way. Definitely don't use msleep or the like either. That's not what it's for. Change your approach - don't assume a constant for the time interval, that's not happening either. There's no software or hardware that supports that and no serious game engine does it like that. Instead do your game tick calculation and request display update at the end, e.g. QWindow::requestUpdate. In your paintEvent do your rendering and start another game tick. Qt is (by default) synchronized for 60Hz output. If you sync it properly using monitor v-sync the game runs as smooth as is physically possible and it only takes as much CPU as it needs and no more (Qt idles out when waiting for display's vertical refresh). That's the basic version. A more advanced version is where you run separate game and render threads and do a so called pipelining - update Nth frame game state on one thread while rendering N-1 frame on render thread. It requires a bit more setup and is necessary when you have so much calculation that you can't fit it together with rendering in a single 16ms window. For simple cases, where your calculations take less than that the first approach is fine, you don't need separate thread. In any case don't use QTimer for any of that. Don't try to ask for specific time, that's not gonna happen and if you base your animations on that assumed constant interval they will always be choppy. Even if you manage to tweak it on your machine it will break on another, where the timings are a little off compared to yours. Instead measure how much time has actually passed from last frame (use QElapsedTimer for that, like in your threading approach) and use that as a delta time value that you multiply all your movement, animations, velocities etc. by.
  • 4k Topics
    18k Posts
    K
    大佬们,为什么我运行qt creator(QT版本为5.9.3)的时候,无响应,看任务管理器,内存占用率到500mb一段时间进程就退出了,也没有任何窗口显示,有大佬遇到过这种问题吗?![image: 8c6ef968-5faf-4149-9a27-52ffbfac8f34.png] image url)
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k Topics
    10k Posts
    SGaistS
    Hi, Suggestion heard and acted on