Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Crash on Exit // QtCreator Examples // Qt 3D

    Unsolved
    1
    0 Votes
    1 Posts
    88 Views
    No one has replied
  • Concatenating QString "\n" missess " new line

    Moved Unsolved
    5
    0 Votes
    5 Posts
    913 Views
    Christian EhrlicherC
    You must not use qDebug() when you want to output something to the console not indented for debug output...
  • Signature not normalized warning

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    SGaistS
    @Kaluss said in Signature not normalized warning: My signal takes QString and slot takes const QString&. Out of curiosity, why not use a ˋconst QString &` as well for your signal ? There no reason to force a copy when it's not needed.
  • QMYSQL driver not loaded. available drivers: QSQLITE , QMYSQL , QMYSQL3

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    JonBJ
    @ocgltd said in QMYSQL driver not loaded. available drivers: QSQLITE , QMYSQL , QMYSQL3: @ocgltd Wow..I solved it. The syntax for creating the QSqlDatabase is incorrect. Once fixed it has not trouble connecting. What a horrible error message for this! Wasted 7 hours. Nothing at all in what you showed, being compilation/linker messages, is related to this.
  • read the battery status on an HP notebook under WIN11.

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    JonBJ
    @kendo My HP laptop has a parameter in the BIOS, which I have never changed, so that it only ever charges to 80%. Dunno what that is about.
  • I keep getting an error saying "Database file not found in the resource system".

    Unsolved
    5
    0 Votes
    5 Posts
    242 Views
    C
    Any database in he Qt resources will be inherently read-only (it is part of the executable itself). Whether you can open such a database in situ will depend on exactly what database engine and how you are doing that. If you needed a writable database, even if it is disposable, you can copy the resource file to an operating system temporary location and open if from there.
  • How to get window stays on top in plasma wayland??

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    S
    Using Qt5 and possibly KWindowSystem may solve the problem. In the KDE Plasma desktop environment, the window manager KWin is responsible for handling and managing windows. When you right-click on a window title bar and select "Keep Above Others", KWin receives a command to make that window stay on top. This is an internal implementation in KWin, and is independent of Qt and QWidget. KWin sets that window to be always on top and adjusts the window stacking order accordingly. KWin provides interfaces to interact with other KDE applications and libraries, such as the aforementioned KWindowSystem. Through these interfaces, you can programmatically interact with KWin, such as setting a window to stay on top. However, on Wayland, KWin does not provide a D-Bus interface for this functionality. This is why on Wayland, we need to use KWindowSystem, as it abstracts the interaction with the window manager and provides a unified API for both X11 and Wayland. On Wayland, KWindowSystem uses other ways to communicate with KWin instead of D-Bus. Therefore, to summarize, in the KDE Plasma desktop environment, KWin is responsible for the "Keep Above Others" functionality. In programming, we can use KWindowSystem (as a higher-level abstraction) to set a window to stay on top. This ensures compatibility between different window managers and display servers.
  • Qt creator Tools->options->kits->qtversions saying no qmlscene installed while it is

    Unsolved
    2
    0 Votes
    2 Posts
    879 Views
    D
    Hello, I'm aware this topis is quite old, but maybe it could still help somebody. I had the same problem and solution described here: https://stackoverflow.com/questions/34918115/getting-no-qmlscene-installed-warning-in-qt-creator-on-ubuntu has worked for me. After installation of "qtdeclarative5-dev" package the error message "No qmlscene installed" disappeared. V.
  • Abend in VS2022 when building against Qt 6.5

    Unsolved
    3
    0 Votes
    3 Posts
    271 Views
    PerdrixP
    @ChrisW67 It's a warning that people may have problems... I have reported it to MS
  • Queue send frames in synchronous serial comm

    Solved
    6
    0 Votes
    6 Posts
    525 Views
    JonBJ
    @Damian7546 I too do not understand what you are still asking. If you want to put a QByteArray and a uint8 into the queue, as a single item, why don't you use the struct approach both @SGaist & @jsulm have suggested? What is the problem with that? You can create the struct in MyFunction::transaction(const QByteArray &data,quint8 reqType) if you wish to retain a function which accepts them as separate parameters. If, for some reason, you are asking whether you can have two different typed items in a QQueue, one a QByteArray and another a uint8, then you cannot, what type would the QQueue<...> be?
  • QTreeView: Too many columns. What to do?

    Unsolved
    7
    0 Votes
    7 Posts
    429 Views
    jeremy_kJ
    I lean toward QTreeView::setColumnHidden() rather than QSortFilterProxyModel::filterAcceptsColumn(), but either will work. Using a filter proxy will require a call to QSortFilterProxyModel::invalidate() or QSortFilterProxyModel::invalidateFilter() each time columns should be shown or hidden. Showing and hiding in the view rather than via a model might be more efficient. As for how to trigger it,
  • Image loses color/brightness after converting to webp

    Unsolved
    2
    0 Votes
    2 Posts
    243 Views
    C
    @MyNameIsQt I would be guessing that the QImage internal data is stored in ARGB layout (A = 0xff probably), and you are asking the foreign library to treat that as RGBA. You lose the blue and get a strong red. Take a look at QImage::format().
  • Threads and qml (error on signal)

    Solved
    5
    0 Votes
    5 Posts
    878 Views
    mzimmersM
    @jeremy_k yeah, I did just that. Still got the error, but it was due to another object being creating in the worker c'tor, then accessed by the worker. I deferred the object creation, and now it's fixed. Thanks to all who looked.
  • need help to design an extensible widget

    Unsolved
    6
    0 Votes
    6 Posts
    331 Views
    M
    @lano1106 A little more elaborated version: class SplitterHandle : public QSplitterHandle { void mouseReleaseEvent(QMouseEvent *event) override { if(!rect().contains(event->localPos().toPoint())) return; int width2=splitter()->widget(1)->maximumWidth(); // 2nd panel max width int splitWidth=splitter()->width(); if(splitter()->widget(1)->width()==0) splitter()->setSizes({splitWidth-width2,width2}); else splitter()->setSizes({splitWidth,0}); } void paintEvent(QPaintEvent *) override { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); QFont font=this->font(); font.setBold(true); painter.setFont(font); if(splitter()->widget(1)->width()==0) { painter.drawText(rect(),Qt::AlignCenter,"<"); } else painter.drawText(rect(),Qt::AlignCenter,">"); } void mouseMoveEvent(QMouseEvent *) override { // block mouse move } void enterEvent(QEvent *) override { setCursor(Qt::ArrowCursor); } public: SplitterHandle(QSplitter* parent=nullptr) : QSplitterHandle(Qt::Horizontal, parent) {} }; [image: splitter1.png] [image: splitter2.png]
  • How to set the duration of a QVariantAnimation constant to different values?

    Solved
    5
    0 Votes
    5 Posts
    331 Views
    K
    Thankyou! you're correct i was testing it wrong, thats why i was getting a different animation time, sorry my bad!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • QListWidget drag&drop item disappear

    Unsolved
    17
    0 Votes
    17 Posts
    3k Views
    Axel SpoerlA
    @Christian-Ehrlicher I've alrady cherry-picked it there, but integration fails with unrelated errors. Need to investigate...after the weekend.
  • Camera inconsistent startup in QtMultimedia

    Unsolved
    7
    0 Votes
    7 Posts
    413 Views
    M
    @mzimmers If it does I definitely don't have it, but I use the camera every day with google meet, obs, etc.
  • 0 Votes
    1 Posts
    174 Views
    No one has replied
  • qt.qpa.wayland: xkbcommon not available on this build, not performing key mapping

    Unsolved yocto imx8
    9
    1 Votes
    9 Posts
    3k Views
    D
    Sorry to reopen the ticket. But I think we can add an answer for whoever ends up here in the future. I have the same issue, also had libxkbcommon into the image under /usr/lib/ and kept having the same error. The problem was basically on Yocto build I missed configuring the qtbase PACKAGECONFIG variable to enable the xkbcommon option. To do that, you add a new layer, create a qtbase_%.bbappend file and add: PACKAGECONFIG:append:<machinename> = " xkbcommon" NOTE: If you don't add the <machinename> you will have failures because other packages won't have the -native extension. NOTE2: make sure to do that in a clean build (or clean all qt packages), other ptest will fail complaining that a configuration was changed and it doesn't know why.