Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.3k Posts
  • Include Qt6 libs in CMake project on macOS

    Unsolved
    2
    0 Votes
    2 Posts
    302 Views
    jsulmJ
    @developer23 said in Include Qt6 libs in CMake project on macOS: In CMake I include Headers and nested folders and then compiler emit This sounds wrong. You should only tell CMake which Qt modules you need, like: find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) Also, there is no need to have module names in includes: #include <QChar>
  • Bug in qt apps with colemak layout.

    Unsolved
    3
    0 Votes
    3 Posts
    430 Views
    N
    @jsulm Yes, as mentioned in the link.
  • QSqlTableModel setFilter => Unable to execute statement

    Solved qsqltablemodel qsqldatabase
    8
    0 Votes
    8 Posts
    777 Views
    Pl45m4P
    @JonB said in QSqlTableModel setFilter => Unable to execute statement: ? Escaping the column names and doing everything more thoughtfully would have prevented the crash... so "range" instead of range etc... I think not only any select statements were influenced but the whole table itself. That's why the DHCP service didn't start up anymore ;)
  • Qt6 linux: no audio output via QAudioSink

    Solved audio device qt6
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    Then you're lucky it worked :-) Good thing you can fix your QIODevice class !
  • [QChart] The Spline chart has an overshoot in displaying the change in value

    Solved
    2
    0 Votes
    2 Posts
    192 Views
    G
    I changed the title, because the problem is related to QSplineSeries, QLineSeries does not have overshoots for value changes. From what I understand QSplineSeries tries to smooth out value changes, and the overshoots are a side effect of the filter applied to do so. With QLineSeries [image: 7636fc63-00ea-499b-a93d-1f0e79e804d9.png]
  • QJsonValue::toArray() wraps correct json array inside another array

    Solved c++ json
    4
    0 Votes
    4 Posts
    585 Views
    JonBJ
    @Poggar As the above two posts have said. Fastest way to convert Vector to QJsonArray? gives code and confirms there is no faster way than some sort of iteration over the C++ array adding elements to the JSON array, you can use std::copy() to save you writing a for loop yourself if you wish.
  • A problem with QWidget update

    Unsolved
    8
    0 Votes
    8 Posts
    708 Views
    A
    @ChrisW67 Since this is just a simplified example, I just want to explain to that bro how one QObject works in two threads. The reason for the two threads is that I would post-process the image after receiving it from the camera's SDK and then pass it to the main thread to paint with paintEvent
  • QLabel underline for accelerator doesn't update when Alt is pressed

    Unsolved
    3
    0 Votes
    3 Posts
    280 Views
    T
    Environment Qt: v6.8.1 (mingw_64) Windows 11 Minimal Example Problem When the program is running, toggle "Underline keyboard short cuts and keys" in "Control Panel\Ease of Access\Ease of Access Center\Make the keyboard easier to use". The label doesn't update the underline, until the program is exited and restarted. QMenu can update this without restarting the program. Probably QLabel doesn't have a slot to update display when this system setting changes. [image: a6bfdc0a-d7a8-41a3-bddc-f7d2557fa88b.png] Code My code is recognized as spam and prohibited from posting here. I'll attach download link. https://drive.google.com/file/d/18V_E4UvpG2e9h9MDhHR_YLOanw9t_leJ/view?usp=sharing The key part is MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { lineEdit1 = new QLineEdit; lineEdit2 = new QLineEdit; // bug: QLabel underline for accelerator doesn't update when Alt is pressed in Windows label1 = new QLabel(tr("Field &A:")); label1->setBuddy(lineEdit1); label2 = new QLabel(tr("Field &B:")); label2->setBuddy(lineEdit2); QWidget *centralWidget = new QWidget; setCentralWidget(centralWidget); QGridLayout *mainLayout = new QGridLayout(centralWidget); mainLayout->addWidget(label1, 0, 0); mainLayout->addWidget(lineEdit1, 0, 1); mainLayout->addWidget(label2, 1, 0); mainLayout->addWidget(lineEdit2, 1, 1); menuBar()->addMenu(tr("&Menu")); }
  • what is the strange mark in left side of tabbar in qtabwidget when many tabs opened

    Solved
    6
    0 Votes
    6 Posts
    392 Views
    SGaistS
    Good, in that case, please mark the thread as solved using the topic tools button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)
  • QMenu infrastructure - is deriving an own Menu not an option?

    Unsolved
    15
    1 Votes
    15 Posts
    1k Views
    SGaistS
    @St0fF you should check the openings on the Qt Group website.
  • Qt6 and Windows 2016

    Unsolved
    2
    0 Votes
    2 Posts
    375 Views
    Axel SpoerlA
    Confirm. See here. https://doc.qt.io/qt-6/supported-platforms.html
  • Question about Qhttpserver and QtFuture

    Solved
    4
    0 Votes
    4 Posts
    468 Views
    SGaistS
    This article shows a way to do it.
  • How to use ODB with QT

    Unsolved
    5
    0 Votes
    5 Posts
    541 Views
    A
    Ok, the program I inherited uses the QSqlDatabase::addDatabase to connect. However when interacting with the database, code like the following is used: QList<QString> Ps; QString selectQuery = QString( "SELECT DISTINCT column.name " "FROM table " "WHERE col = :value" ); QSqlQuery query; query.prepare(selectQuery); query.bindValue(":value", value); if (query.exec()) { while (query.next()) { QString P; P = query.value("Properties.name").toString(); Ps.append(P); } } My understanding is that ODB and other ORMs would allow me to instead write something more like: using table_query = ODBquery<table>; for (QString& P: db.query<P> (table_query::value ="value);
  • Complete novice, where do I begin with a HMI project

    Unsolved
    2
    0 Votes
    2 Posts
    291 Views
    Pl45m4P
    Hi and welcome to the forum, @Groundbounce said in Complete novice, where do I begin with a HMI project: I'm looking at using Qt and in the process will learn C++, I currently use C on micro controllers. make yourself familiar with OOP/C++ first. C and C++ is similar but there might be some traps to fall for. This would be HMI that displays auto style gauges as the visual output. [...] From what I can tell I need to use a Qt quick project. Yes, for these kind of things QtQuick / QMLanguage is more suitable than a QtWidgets Application. Edit: [Then your lack of C++ experience doesn't matter too much, since QML is a whole different language (inspired by JavaScript and JSON-style format)] I am not sure if I should be setting up the graphics in designer or creator. In general both ways are possible, but QtDesigner (the standalone as well as the QtCreator integrated one) can't do QtQuick. For more advanced QtQuick Designs there is Qt Design Studio (here), which also features templates for gauge-like elements, animations and more.
  • Errors [unknown type name 'import'], etc.

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    F
    Thank you all for your precise and relevant answers. Best regards.
  • Update rect in delegate when changing content's size

    Solved
    9
    1 Votes
    9 Posts
    710 Views
    JonBJ
    @Mark81 Yes, I think whatever displayText() returns as text (default without your specific number of decimal places) is "measured" by Qt for sizeHint(), and is simpler for your case than paint(). The latter would be required if you wanted to affect other aspects of the output than only the text, e.g. you were drawing a box round it. But if the text is all you want to alter I would use displayText().
  • Error 'isRelocatable': undeclared identifier.

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    jsulmJ
    @wasimIM I don't have a solution. Maybe try with more recent MS compiler if there is a newer version?
  • QThread used to call function pointer

    Solved
    6
    0 Votes
    6 Posts
    521 Views
    P
    Hi @jsulm, I updated the main function to initialize the EventLoop it is working as expected. Thank you very much for your help, Pierre-Emmanuel de Robien
  • Pyside6 app add windows kiosk mode

    Unsolved
    2
    0 Votes
    2 Posts
    174 Views
    jsulmJ
    @Quvonchbek-Bobojonov What is your question?
  • Add macros to translation resource

    Unsolved
    1
    0 Votes
    1 Posts
    112 Views
    No one has replied