Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.3k Posts
  • Forcing screen updates

    Solved
    18
    0 Votes
    18 Posts
    4k Views
    JonBJ
    @DerReisende Goodness knows :) I'm wedded to VirtualBox coz I just about know how to use it. I did "ESXi", that's VMware isn't it, and found it a nightmare to manage! I will have a look tomorrow at graphics settings, normally I don't think about them, didn't occur to me as I'm only writing to a window title, but who knows. About the only UI that was 100.00% reliable was a VT220, ever since windowing systems there have always been problems....
  • 0 Votes
    40 Posts
    7k Views
    JoeCFDJ
    @8Observer8 Good to know. Thanks. Actually, I wanted to ask you if you tried it. m_pStartGameButton->winId(); // add this <<=========this is the tricky part.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    24 Views
    No one has replied
  • Trying to gamma adjust a QImage

    Unsolved
    7
    0 Votes
    7 Posts
    475 Views
    PerdrixP
    @JonB The input bitmap is my own format which contains (effectively) three vectors of type <T> in this case uint16_t, so incrementing pRed will move to the next uint16_t in the red channel. At least that's the theory! In practice it turns out there was a problem when converting a 16 bit QImage into the local representation that resulted in the local bitmap being corrupt! So the code I posted may even be correct!!! David
  • 0 Votes
    1 Posts
    88 Views
    No one has replied
  • QList sliced vs mid and what are sublists?

    Solved
    2
    0 Votes
    2 Posts
    632 Views
    Christian EhrlicherC
    There is no difference, sliced() was only added because "This keeps the API symmetric with what we have in our string classes.": https://codereview.qt-project.org/c/qt/qtbase/+/305959
  • Compile errors on macOS when using clang and c++17 in a Qt 5.15 project

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    DuBuD
    @JonB Thanks for the link! I learned that std::auto_ptr is removed in c++17. So I checked the upstream repo of my submodule and they really have a commit fixing that issue. Updating the submodule fixed my issue. Thanks again!
  • Stop disabled tab from greying out icon

    Solved
    3
    0 Votes
    3 Posts
    295 Views
    T
    @JonB Yes this works for me, thanks.
  • How can i send a mail with qt4.11

    Unsolved
    4
    0 Votes
    4 Posts
    271 Views
    A
    Hi, I remember that I had a project to send fake mail to others without any mail server, unfortunately, I have not codes, but you can use this conception by using some mail server's adventures. good luck.
  • How to detect if Wayland or X11 is used?

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    A
    @Abderrahmene_Rayene Ha! I knew it would be something as simple as that...
  • Compile Qt Creator with Visual Studio C++ 2022

    Unsolved
    2
    0 Votes
    2 Posts
    476 Views
    kkoehneK
    https://code.qt.io/cgit/qt-creator/qt-creator.git/ . Build details are in https://github.com/qt-creator/qt-creator#readme .
  • how to fix these build errors(msvc2019 64bit)

    Moved Solved
    10
    0 Votes
    10 Posts
    3k Views
    kkoehneK
    @victor_wen Great. Feel free to 'resolve' this topic then.
  • I use QAbstractItemModel add 10,000,000 row * 10 column datas,It consume 1G memory

    Unsolved
    10
    0 Votes
    10 Posts
    993 Views
    I
    @JonB much appreciate your directions,I'll give it a try.
  • Delay closing the application in destructor waiting for a signal

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    JonBJ
    @Mark81 While inside a Linux signal handler, such as from SIGINT/SIGTERM, you are very limited as to what you are allowed to do "safely". Basically you are in a context where you are supposed to do as little as possible (e.g. set a variable) and then exit the signal handler. You are not supposed to do anything at all "complicated". So, for example, using Qt I think it would be best to post a simple message/signal --- assuming that is safe --- and exit the signal handler, allowing the event loop to later pick that up and do the actual exiting, rather than doing the exit from within the signal handler directly. In your connect() above, for example, I would be making it a Qt::QueuedConnection. (For other reasons the code at https://doc.qt.io/qt-6/qcoreapplication.html#quit actually recommends/shows this anyway.)
  • Translate a QApplication after I create the .exe

    Unsolved
    5
    0 Votes
    5 Posts
    401 Views
    S
    Yes, it is possible. How to approach this depends on what you want to achieve. The translator can load any .qm file you give him. It does not matter if it is located in your resources (i.e. embedded into the .exe) or if it is an individual file on disk. If you want the possibility to add many more languages or give the user the ability to do their own translations, you can generate a dummy .ts file. Everyone can just change the language right at the top of this .ts file before opening it with Qt Linguist. So, you don't really need to generate multiple .ts files from source code, but can just copy an existing .ts file (most useful if there are no translations in it) and change the language. You could provide this .ts file without any translations to your users. Then, you can have two different methods how to apply additional translations. One suggestion was already to do this through the locale. However, you can also provide an option to load a specific translation file by filename. Then, it does not actually matter which language is set in the translation file. If users should be able to do their own translations, I'd prefer to select additional languages by filename. This is easier to explain.
  • file when create project

    Solved
    9
    0 Votes
    9 Posts
    461 Views
    L
    @SGaist Ok I opened CmakeList.txt and it's ok. Thank you very much
  • Hoiw to implement "QT_MESSAGE_PATTERN

    Unsolved
    3
    0 Votes
    3 Posts
    543 Views
    Paul ColbyP
    Hi @AnneRanch I like to colorize parts (text) of the QDebug output. Here's how I do it in one of my open-source projects: #if defined(Q_OS_UNIX) #include <unistd.h> #elif defined(Q_OS_WIN) #include <Windows.h> #endif inline bool haveConsole() { #if defined(Q_OS_UNIX) return isatty(STDERR_FILENO); #elif defined(Q_OS_WIN) return GetConsoleWindow(); #else return false; #endif } void configureLogging(const QCommandLineParser &parser) { // Start with the Qt default message pattern (see qtbase:::qlogging.cpp:defaultPattern) QString messagePattern = QStringLiteral("%{if-category}%{category}: %{endif}%{message}"); if (parser.isSet(QStringLiteral("debug"))) { #ifdef QT_MESSAGELOGCONTEXT // %{file}, %{line} and %{function} are only available when QT_MESSAGELOGCONTEXT is set. messagePattern.prepend(QStringLiteral("%{function} ")); #endif messagePattern.prepend(QStringLiteral("%{time process} %{threadid} %{type} ")); } const QString color = parser.value(QStringLiteral("color")); if ((color == QStringLiteral("yes")) || (color == QStringLiteral("auto") && haveConsole())) { messagePattern.prepend(QStringLiteral( "%{if-debug}\x1b[37m%{endif}" // White "%{if-info}\x1b[32m%{endif}" // Green "%{if-warning}\x1b[35m%{endif}" // Magenta "%{if-critical}\x1b[31m%{endif}" // Red "%{if-fatal}\x1b[31;1m%{endif}")); // Red and bold messagePattern.append(QStringLiteral("\x1b[0m")); // Reset. } qSetMessagePattern(messagePattern); } Cheers.
  • OK, I asked before ... but what are these ?

    Unsolved
    2
    0 Votes
    2 Posts
    210 Views
    Axel SpoerlA
    what are they, Build folders. and what makes them , The compiler. and why Because something was compiled. ?? Why two question marks? Does it mean, you’ll ask the question again in a while? Or was the question mark forgotten the first time? I am confused.
  • Perfectly overlapping Q labels

    Unsolved
    2
    0 Votes
    2 Posts
    331 Views
    SGaistS
    Hi, QStackedWidget comes to mind for that. Put your labels in it and the buttons underneath.
  • How to find MQTT examples

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    SGaistS
    @lukutis222 AFAIK, pre-built binaries for that module are available for commercial license holder. As for Qt Creator, most likely because Qt Creator is way younger than Qt itself and has likely not yet been used as much as other means to develop Qt. Note that having for example the qtbase completely loaded in an IDE is a pretty intensive task which might not even be doable due to the sheer size of the module. However, additional documentation on that matter would be something good.