Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to pass QSqlRelationalTableModel object to a class constructor (from main.cpp)

    Unsolved
    4
    0 Votes
    4 Posts
    264 Views
    Pl45m4P
    @Gandalf404 said in How to pass QSqlRelationalTableModel object to a class constructor (from main.cpp): I just trying do not create unnecessary objects of QSqlRelationalTableModel, so i thought better just pass it through widgets Like I've said, create it in your widget where you need it. That would make one instance only. Or for what reason you need it in main()?
  • How to change record's fields in beforeInsert()?

    Unsolved
    10
    0 Votes
    10 Posts
    569 Views
    JonBJ
    @Mark81 I have not checked, but isn't the new row and its record only inserted into the in-memory model at this point, it has not yet been inserted into the backend database? You can still edit/change it in code, before the user performs any edits, and it is not committed until you move off that new row?
  • How to set a color scheme for a QMainWindow?

    Solved
    6
    0 Votes
    6 Posts
    497 Views
    SGaistS
    I would expect to have somewhere a list of the platform where the value is in use. I haven't checked all the platform backends. Just the Linux ones where I haven't seen the value in use.
  • Selection in Qt

    Solved
    2
    0 Votes
    2 Posts
    161 Views
    JonBJ
    @Carlosyoot selectionBehavior : SelectionBehavior enum QAbstractItemView::SelectionBehavior selectionMode : SelectionMode enum QAbstractItemView::SelectionMode
  • Title: QLineEdit in Linux Qt App Not Triggering Chinese Input (IBus)

    Unsolved
    2
    0 Votes
    2 Posts
    163 Views
    JoeCFDJ
    check dependencies ldd path/libibusplatforminputcontextplugin.so export QT_DEBUG_PLUGINS=1 to check if this plugin is loaded or run strace your_app to check if the plugin is loaded correctly. rebuild Qt with flag: -ibus from the source
  • cmake --build

    Locked Unsolved
    3
    0 Votes
    3 Posts
    212 Views
    Christian EhrlicherC
    Closed as dupe of https://forum.qt.io/topic/161241/error-while-building-qt-6-8-2-from-source/
  • Error while Building Qt 6.8.2 from Source

    Unsolved
    14
    0 Votes
    14 Posts
    939 Views
    jsulmJ
    @dan1973 said in Error while Building Qt 6.8.2 from Source: i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6 This does not answer @Christian-Ehrlicher questions... First: do not build inside visual studio installation directory. Second: are you sure you have to build Qt by yourself instead of using Qt Online Installer to install Qt?
  • Does QDir impose a maximum path limit on Windows?

    Solved qdir createfile path limit
    4
    0 Votes
    4 Posts
    2k Views
    kshegunovK
    Shouldn't, but I don't know. As far as links go, these seem to point to a newer version of the code. Bear in mind the original post was 7 years ago ...
  • Unable to control camera aperture on Raspberry Pi

    Unsolved
    5
    0 Votes
    5 Posts
    404 Views
    SGaistS
    Since you are using Q5, it's the GStreemer plugin that you should check.
  • 0 Votes
    4 Posts
    266 Views
    Christian EhrlicherC
    And what has Qt to do with this? This is a normal windows behavior: https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
  • Github Copilot Sign In button Grey - QT Creator 15.0.1

    Unsolved
    4
    0 Votes
    4 Posts
    495 Views
    aha_1980A
    Hi @Panda-Pilot, as stated in the bugreport, using an older version 1.41.0 of Copilot.vim should also work. Regards
  • QFileDialog::getOpenFileName causing program to crash

    Unsolved
    26
    0 Votes
    26 Posts
    7k Views
    V
    @VirtualFloat Does the crash occur in a Qt .dll, or inside a foreign dll injected by some security software? The latter is, unfortunately, not uncommon.
  • macOS: sandboxing is breaking ability to build&run?

    Unsolved
    2
    0 Votes
    2 Posts
    139 Views
    D
    i tried signing the app each time but that didn't fix it
  • How to access raw value of foreign key?

    Unsolved
    2
    0 Votes
    2 Posts
    145 Views
    M
    @Mark81 said in How to access raw value of foreign key?: Even if the printed filter values are correct, the rowCount() is always 0. This was simple: m->setFilter(QString("%1='%2'").arg(r.displayColumn(), displayValue)); did the trick. Followed by: qDebug() << m->data(m->index(0, m->fieldIndex(r.indexColumn()))); seems to solve the issue. Is my approach correct or is there anything better?
  • Using macros cannot resolve recursive references either.

    Unsolved
    12
    0 Votes
    12 Posts
    621 Views
    S
    Headers alone don't do anything. Suppose you have a classb.cpp that just includes classb.h. This header first declares the macro CLASSB_H. Then you go on to include all_header.h from classb.h. This first includes classb.h followed by classa.h. However, when including classb.h from all_header.h (included from classb.h) CLASSB_H is already defined and the inclusion returns nothing. So far, ClassB has not been defined. Then you go on including classa.h which expects a full definition of ClassB. This problem only occurs when including classb.h (before any of the other two headers). It is not a problem when including classa.h or all_header.h (first). Using all_header.h as a pre-compiled header will include all_header.h before everything else in every translation unit. That's why this solution works. But IMHO this is not a proper solution because source code should always also compile without precompiled headers. Especially in this scenario a change in ClassA or ClassB will trigger a recompile of the precompiled header and thus a recompile of your whole project. This is not a tenable solution for large projects. Precompiled headers should be reserved for third-party libraries that (almost) never change. It is not meant for your own source code. (Precompiled headers are supposed to reduce compilation times and not increase them.) I am not sure what a good solution to this problem is. Most likely it works by removing the include guards for all_header.h. I believe these are (in this specific context) not actually needed.
  • Qt maintenance tool problem

    Unsolved
    2
    0 Votes
    2 Posts
    169 Views
    jsulmJ
    @GeoMa said in Qt maintenance tool problem: I tried changing url using -- mirror https://download.qt.io/official_releases with no success Did you try any other mirrors from the mirror list?
  • Vertical QScrollBar seems to have height 0

    Solved
    6
    0 Votes
    6 Posts
    361 Views
    S
    @Pl45m4 thank you. Interesting. Not sure how to specify width/height if it is supposed to be extending, so will try without padding. Is there any explanation why this is happening? Not like it matters for the practical usage, but just curious to read about it more.
  • Can't we build Qt with /Zc:wchar_t- flag anymore?

    Unsolved build 6.8
    2
    0 Votes
    2 Posts
    255 Views
    Christian EhrlicherC
    @naveen13 said in Can't we build Qt with /Zc:wchar_t- flag anymore?: Is there any workaround without altering the Qt source file No. You might provide a patch and see if it gets accepted though.
  • Combining cells in gridlayout

    Unsolved
    3
    1 Votes
    3 Posts
    3k Views
    A
    @mrjj, thank you!
  • Use case and difference between QPalette and Qt Style Sheet?

    Unsolved
    10
    1 Votes
    10 Posts
    4k Views
    RokeJulianLockhartR
    KColorScheme is a superset of QPalette @SGaist, it indeed is, per api.kde.org/frameworks/kcolorscheme/html/classKColorScheme.html: KColorScheme currently provides access to the system color palette that the user has selected (in the future, it is expected to do more). It greatly expands on QPalette by providing five distinct "sets" with several color choices each, covering background, foreground, and decoration colors. Thanks. Styling Plasma can be done through other means such as Plasma Theme which is a set of SVG files. Yeah, it's a bit of a mess: thelibre.news/the-future-of-kde-styling-and-design.