Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Selecting QTreeView Switches Focus on Default QButton

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    Axel SpoerlA
    @gsephelec Sorry for taking so long. The setVisible()override of QDialogchecks, if there is a QPushButtonat the next position in the focus chain. If it finds one, it sets it as a default button. That matches almost all use cases. But it can get in the way of a QDialogButtonBoxinside a QDialog. In your case, the cancel button is next in the focus chain. Therefore it wins the prize and becomes default. There is a simple workaround: Define void setVisible(bool visible) override;in the (new) protectedsection of assetDialog.hand implement it as follows: void assetAssetSelector::setVisible(bool visible) { QDialog::setVisible(visible); okButton->setDefault(true); } It's a bit hacky, but it does the job. You can file a bugreport if you want - you have a perfect reproducer. I can't promise if we will actually fix it. I somehow feel, that a fix in Qt would break a lot of other stuff.
  • Qt6 : Qt shall use a UTF-8 locale ("UTF-8") instead

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    C
    I have this message when compiling: I suspect you have this message from your program, or a Qt-based IDE, when it is run. What should I do ? To the Qt program: nothing. The Qt program will use UTF-8 which is a compatible superset of US-ASCII, i.e a valid ASCII string is a valid UTF-8 string. The message is telling that the operating system locale is set to US-ASCII. If you want to set that to UTF-8 then that is something outside of the Qt program.
  • cin does not read input properly

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    D
    @tiegert This is a life saver. Who would have thought we need to check that little "Run in terminal" checkbox after clicking the Projects icon on the left. This should have been the default. Otherwise where do we see the output from our "hello world" app? If we see that in the Application Output, naturally we would attempt to key in our data there. If Application Output for output only then make the window read-only. Still suffering from the first experience....can't even run the app outside of Qt Creator as lots of missing dlls...I guess I have been spoiled by Microsoft....
  • Change QAppliation into QGuiApplication without problems?

    Unsolved
    4
    0 Votes
    4 Posts
    343 Views
    B
    rofl Ah, thanks. I thought it was the other way around; QGuiApplication inheriting form QApplication.
  • This topic is deleted!

    Unsolved
    5
    0 Votes
    5 Posts
    31 Views
  • objectName() is empty in constructor for a promoted widget

    Solved
    8
    0 Votes
    8 Posts
    766 Views
    Chris KawaC
    @mpergand I don't always hate the project, the compiler, the debugger, my coworkers or my future self, but when I do I too carpet bomb entire code base with nested obfuscating preprocessor substitutions ;)
  • How to build program from terminal

    Unsolved
    3
    0 Votes
    3 Posts
    434 Views
    SGaistS
    Hi, The command is literally: /usr/bin/make -j8 You could short it to make -j8. Note that this is called from within the build folder.
  • Ask Qt about the reading direction of the current language

    Solved
    2
    0 Votes
    2 Posts
    203 Views
    JonBJ
    @buhtz QGuiApplication::layoutDirection() ? Qt::LayoutDirection QLocale::textDirection() const ?
  • How to trouble shoot qt application on commad line using GDB

    Unsolved
    2
    0 Votes
    2 Posts
    191 Views
    JonBJ
    @Rajashekara-V Yes, what else do you expect? It is not "stopped" at a.exec(), rather it is running inside whatever that calls. And will continue to do so until you exit the Qt program. In the same way as it would if it were not a Qt program. You have two choices if you want to then "break into" the gdb debugger: Put breakpoint(s) wherever. When they are hit execution should stop, you return to the gdb command prompt, and do whatever you like. continue, I think, is the command to issue when you want it to carry on running from where it got to. (Note: if you expect to step into a.exec() --- not a good idea --- you would need (a) Qt itself compiled for debug and (b) gdb to see Qt's source files.) Press the keyboard interrupt character at the gdb command prompt in the terminal, e.g. Ctrl+C. That should break into gdb. You might have to set something in gdb to allow it, and to allow it to continue without raising the interrupt signal when you are done, but again should be same as for non-Qt program. Be aware you will break somewhere deep inside the Qt event loop.
  • SSH Connection with Remote Linux devices

    Unsolved
    28
    0 Votes
    28 Posts
    11k Views
    V
    @JonB what
  • Themes

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    S
    From my understanding this is because on Windows the native functions are used for drawing. They don't always respect all palette choices in every single last place. This is what the documentation has to say about this (https://doc.qt.io/qt-6/qapplication.html#setPalette): Note: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for the Windows Vista and macOS styles.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    11 Views
  • overwrite data inQTableView with QSqlQueryModel as source

    Solved
    3
    0 Votes
    3 Posts
    270 Views
    Seb TurS
    @SGaist Well the table is the report :) I have found the way to do it , I'm not sure if it is the correct one, I have sublassed a QSqlQueryMOdel I created a QMap<QModelIndex , QVariant > editedValues that is appended by a overriden setData (which also take care of DB value update) than an overriden data() checks if the index is among editedValues and if it is it returns the value or else it gets regular value from QSqlQuery::data() .
  • GPS info not available in QMediaMetaData with Qt6

    Unsolved
    2
    0 Votes
    2 Posts
    231 Views
    SGaistS
    Hi, The QtMultimedia module has been completely rewritten for Qt 6. There are lots of things that have changed from a design point of view. I currently don't know if this support was removed or not yet re-implemented. I would recommend checking the bug tracker to see if there's something related to it.
  • Inherited project with libzip.

    Unsolved
    8
    0 Votes
    8 Posts
    991 Views
    JonBJ
    @QtUser17456 said in Inherited project with libzip.: C:/Program Files (x86)/GnuWin32/lib/zlib.lib Only a though/possibility. Program Files (x86) is usually for 32-bit stuff under Windows 64-bit, but the rest of your compilation is/might be for 64-bit? Is this a 32-/64-bit mismatch?
  • QFile. Only close() do flush()

    Solved
    3
    0 Votes
    3 Posts
    544 Views
    M
    @DungeonLords As @JonB said, you need to reposition to the beginning of the file. You can use: file.seek(0); or file.reset();
  • How to use QWigdetAction

    Unsolved
    4
    0 Votes
    4 Posts
    448 Views
    SGaistS
    @Depositc29 please make it complete that way it ensures that we are all working with the same code.
  • Bug in z-Order of MDI Interface

    Solved
    2
    0 Votes
    2 Posts
    218 Views
    Andy314A
    @Andy314 Ups, I found the soltuion: pMdiArea->setActivationOrder(QMdiArea::ActivationHistoryOrder);
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    15 Views
  • QML and memory leaks

    Solved qml memory leak asan
    3
    0 Votes
    3 Posts
    2k Views
    T
    Hi @kiozen, I am using Qt creator on windows. Please let me know how to run a application with ASAN on qt