Skip to content

Qt 6

This is where all Qt 6 related questions belong

877 Topics 4.3k Posts
  • Read before posting in this category!

    Pinned Locked
    3
    6 Votes
    3 Posts
    4k Views
    SGaistS
    And now (incomplete at the time of this post): https://wiki.qt.io/New_Features_in_Qt_6.2
  • Facing issue in installing QT

    Unsolved
    8
    0 Votes
    8 Posts
    158 Views
    N
    no, its failing at this step : CMake Error at <dir>/qt-everywhere-src-6.9.1/qtwebengine/cmake/QtGnGen.cmake:95 (message): -- GN FAILED ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code. pkgresult = exec_script(pkg_config_script, args, "json") ^---------- Current dir: <dir>/qt-everywhere-src-6.9.1/build/qtwebengine/src/core/Release/x86_64/
  • button on top QVideoWidget

    Solved
    3
    0 Votes
    3 Posts
    141 Views
    DeSGuND
    @JonB read post more once and did through qml thanks an answer
  • Qt5 is better than Qt6

    Unsolved
    19
    5 Votes
    19 Posts
    3k Views
    goldenhawkingG
    @DevWinDemon I also use msys2 ucrt64 qt6, may be you can make things better follow these approaches. Copy your exe file into a release directory. Make and run msys2qtdeployplus under the same env, such as mingw64 bash or ucrt64 bash, everything will be ok. the msys2qtdeployplus will do : (1) Call windeployqt5/6 for every exe and dlls in the release dir, and, extra dep dir as needed. (2) Repeatly call ldd/ntldd for each dlls in the release dir, copy extra dependcies from msys64/ucrt64 bin dirs to the release dir. (3) If there were no more extra dlls be copied, goto (4), else, repeat , goto (2) (4) Finished. Before this approach, please make sure that ldd /ntldd, windeployqt5 or 6 has been installed by pacman -S, in your env, such as ucrt64. Repeatly calling ldd/ntldd is very important, for example, Qt SQL psql plugin need libpq, but libpq also has its' own deps, libcrypto.dll and so on. [image: f22d9cd9-76c2-494c-9742-8f8b6efd1078.png] Call upx tool with "find -exec", for every dll and exe in release dir, using lzma and deep trim switchers, that can significantly reduce the files size. upx can be installed by pacman -S.
  • Qt Graphs. Building 2d plot using c++ only.

    Unsolved
    22
    0 Votes
    22 Posts
    3k Views
    goldenhawkingG
    In response to the above requirements, I have written a small testing program. 10 curves can be refreshed correctly, but colors cannot be set independently, and there are extra connecting lines between the curves. Can someone help me identify where I went wrong? thank! pro file QT += core gui widgets quickwidgets graphs quick CONFIG += c++17 SOURCES += \ main.cpp \ graphstest.cpp HEADERS += \ graphstest.h FORMS += \ graphstest.ui graphstest.h #ifndef GRAPHSTEST_H #define GRAPHSTEST_H #include <QDateTimeAxis> #include <QDialog> #include <QLineSeries> #include <QValueAxis> #include <QVector> QT_BEGIN_NAMESPACE namespace Ui { class graphsTest; } QT_END_NAMESPACE class graphsTest : public QDialog { Q_OBJECT public: graphsTest(QWidget *parent = nullptr); ~graphsTest(); protected: void timerEvent(QTimerEvent *evt) override; private slots: void on_pushButton_ok_clicked(); private: Ui::graphsTest *ui; QDateTimeAxis *m_ax; QValueAxis *m_ay; int m_timerEvent; QVector<QLineSeries *> m_lineSeries; }; #endif // GRAPHSTEST_H graphstest.cpp #include "graphstest.h" #include <QDateTime> #include <QDebug> #include <QQuickItem> #include "ui_graphstest.h" graphsTest::graphsTest(QWidget *parent) : QDialog(parent) , ui(new Ui::graphsTest) , m_ax(new QDateTimeAxis(this)) , m_ay(new QValueAxis(this)) , m_timerEvent(0) { ui->setupUi(this); QDateTime dtmNow = QDateTime::currentDateTime(); m_ax->setMin(dtmNow.addDays(-1)); m_ax->setMax(dtmNow); m_ay->setRange(-100, 100); QList<QObject *> seriesList; ui->graphsView->setResizeMode(QQuickWidget::SizeRootObjectToView); ui->graphsView->setInitialProperties({{"seriesList", QVariant::fromValue(seriesList)}, {"axisX", QVariant::fromValue(m_ax)}, {"axisY", QVariant::fromValue(m_ay)}}); ui->graphsView->loadFromModule("QtGraphs", "GraphsView"); m_timerEvent = startTimer(500); } graphsTest::~graphsTest() { delete ui; } void graphsTest::timerEvent(QTimerEvent *evt) { if (evt->timerId() == m_timerEvent) { QList<QPointF> data; QDateTime dtmNow = QDateTime::currentDateTime(); const int N = m_lineSeries.size(); for (int n = 0; n < N; ++n) { for (int i = 0; i < 30; ++i) { data << QPointF(dtmNow.addSecs(-3600 * 24.0 / 30 * (29 - i)).toMSecsSinceEpoch(), (rand() % 500 - 250) / 100.0 + n * 16 - 80); } m_lineSeries[n]->replace(data); } m_ax->setMin(dtmNow.addDays(-1)); m_ax->setMax(dtmNow); } } void graphsTest::on_pushButton_ok_clicked() { if (m_lineSeries.size() >= 10) return; //Prepare new data QLineSeries *newLine = new QLineSeries(this); newLine->setColor(QColor(rand() % 128, rand() % 128, rand() % 128)); //Add to Graph QVariant seriesListVariant = ui->graphsView->rootObject()->property("seriesList"); if (seriesListVariant.canConvert<QQmlListProperty<QObject>>()) { QQmlListProperty<QObject> prop = seriesListVariant.value<QQmlListProperty<QObject>>(); prop.append(&prop, newLine); m_lineSeries.append(newLine); } } graphstest.ui <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>graphsTest</class> <widget class="QDialog" name="graphsTest"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>579</width> <height>332</height> </rect> </property> <property name="windowTitle"> <string>graphsTest</string> </property> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QQuickWidget" name="graphsView"> <property name="resizeMode"> <enum>QQuickWidget::ResizeMode::SizeRootObjectToView</enum> </property> </widget> </item> <item> <layout class="QVBoxLayout" name="verticalLayout"> <property name="sizeConstraint"> <enum>QLayout::SizeConstraint::SetMaximumSize</enum> </property> <item> <widget class="QPushButton" name="pushButton_ok"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string>Add Serials</string> </property> </widget> </item> <item> <spacer name="verticalSpacer"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="orientation"> <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> <customwidgets> <customwidget> <class>QQuickWidget</class> <extends>QWidget</extends> <header location="global">QtQuickWidgets/QQuickWidget</header> </customwidget> </customwidgets> <resources/> <connections/> </ui> main.cpp #include "graphstest.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); graphsTest w; w.show(); return a.exec(); } Qt 6.9.1 Mingw64 in windows 11: [image: b7ce4b6c-16e4-4775-8b16-dec3fe4c06ab.png] Further more, how to add a rubber-band selection tool and connect QML signals to the C++ slots, is a bit hard for me . I'll try it later.
  • Raspberry CM 5 Boot2Qt 6.9.1 - no text and incorrect colors

    Unsolved
    2
    0 Votes
    2 Posts
    63 Views
    jsulmJ
    @Volodymyr-Mudryk Boot2Qt is commercial software, so you can ask QtCompany directly for support
  • QTableView setSpan + moveSection causes selection mismatch

    Solved
    7
    0 Votes
    7 Posts
    145 Views
    J
    @Christian-Ehrlicher Added a link and a quote in the commentary to the report
  • Apple Liquid Glass on Qt

    Unsolved
    5
    0 Votes
    5 Posts
    440 Views
    JKSHJ
    @raulgd It helps to identify the purpose and composition of each channel. This forum is a community forum for Qt users to help each other to use the existing Qt API. Questions are mainly answered by community volunteers in their spare time. The Development mailing list (https://lists.qt-project.org/listinfo/development) is where stakeholders discuss the details of implementing new features in the Qt framework itself (such as Apple Liquid Glass styling). The Support Center (https://account.qt.io/s/support-center) is where commercial license holders can talk to support engineers whose job is to provide technical support for Qt Company customers. getting replies from someone from Qt @jsulm is a community member who is unaffiliated with the Qt Company. Anyway, as for your original question, please see https://forum.qt.io/topic/162394/qt-and-apple-glass-ui-in-macos-26/9 (Tor Arne is an engineer from the Qt Company)
  • 50 signal/slots

    Solved
    6
    0 Votes
    6 Posts
    260 Views
    JonBJ
    @servant-0 said in 50 signal/slots: I setup the 50 signals to emit their object name as a QString and call findChild on it to update the text on a label in the slot All as @J.Hilk has written about findChild(). Also it depends hugely on whether your target widget is "close" in the hierarchy to the widget you call findChild() on. If that is "high up" it has a lot of searching to do if there are a lot of descendent widgets. It sounds like you have a backend data layer which emits a signal when it changes and passes the value of what will be used as a widget's objectName() to indicate which widget to update? If so that is not ideal for decoupling data from UI. You might like to look at QDataWidgetMapper for a means of tying widgets to data values (works in both directions, though you may only need data->widget direction). For that you would store your data values in anything derived from a QAbstractItemModel and any time that data changes internally a signal is sent and the corresponding widget is updated (without lookup).
  • Missing DLLs in QT6....I think

    Unsolved
    5
    0 Votes
    5 Posts
    257 Views
    Christian EhrlicherC
    These dlls are installed in the same directory as the release dlls - <QTDIR>\version<compiler_type>\bin
  • Stack widget setCurrentWidget does not change the widget

    Unsolved
    3
    0 Votes
    3 Posts
    215 Views
    J
    Hello, before using ->setCurrentWidget(), you can check if that widget is already contained in that stack widget or not. you can m_centralStackedWidget->indexOf(m_windowSplitter) to find out if the widget is present in the stackwidget or not, it will return "-1" if the widget is not present in stackwidget
  • How to use QProcess with QtConcurrent?

    Unsolved
    15
    0 Votes
    15 Posts
    1k Views
    JonBJ
    @Teg-Miles It's not so much that QProcess "wasn't created for threading", it's that there is no need (and only added complexity) to use threads to run the the processes since another process is asynchronous anyway. It won't even use any calling threads you might create anyway, as soon as a sub-process runs it is in its own thread/process anyway, not the one which ran it. No, ps will not be faster than, say, reading from /proc yourself as that is what it will be doing anyway --- it's not magic, it has to be written in C/C++ itself anyway. OTOH there is an overhead inherent in creating and running another process, plus whatever IPC or I/O you do to get its data back. That will be true on Windows too. I assume Get-Process is a PowerShell command a bit like ps? So again that is just one way you could call it. There will also be Windows own system calls to get information about other processes, and calling those yourself from C/C++ will get better performance. But finding out how to do this in Linux/Windows/MacOS may be something you don't want to do and you find running some command on each OS and reading its output is what you prefer for a simple, non-commercial program.
  • Qt 6.8.3 or higher Font displays incorrectly on systems with Japanese language.

    Unsolved
    4
    0 Votes
    4 Posts
    407 Views
    SGaistS
    You can use qDebug to print your application's font information.
  • Qt Applications Font doesn't look right.

    Unsolved
    5
    0 Votes
    5 Posts
    670 Views
    T
    @Cruzmatt22 I do have WinAero Tweaker installed but System Font is set to default. Also the command line parameter did work. I was hoping there was some sort global fix.
  • 1 Votes
    12 Posts
    51k Views
    Christian EhrlicherC
    @DevWinDemon said in The code execution cannot proceed because Qt6Core.dll was not found. Reinstalling the program may fix this problem.: I work 2 years like this on qt 5.15.16 Nobody hinders you to make it work the same with Qt6 - simply put it in the PATH env var as you did for Qt5. Please stop insulting people for things neither we nor Qt can do against - that's how a library search path on windows works (and also on linux there is a similar thing). So learn on how library search is working on your platform. But maybe your russia os has a better solution for this...
  • Install Qt6StateMachine with aqt install-qt

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    S
    Thanks @Paul-Colby This was helpful.
  • Qt6 + GStreamer

    Unsolved
    6
    0 Votes
    6 Posts
    936 Views
    SGaistS
    Are you setting the CMAKE_PREFIX_PATH variable to point to the Qt version you want to use ?
  • 0 Votes
    10 Posts
    2k Views
    _
    @SGaist sure will do that ...
  • How to create exe file on qt6

    Unsolved
    18
    1 Votes
    18 Posts
    3k Views
    X
    I tried, I ran in release mode and used windeployqt and had to copy additional lib files but it couldn't run and there was no notification, but if I run the program in debug mode, after the exe file is created, I can successfully run that file without having to run the windeployqt command or copy any additional lib files
  • This topic is deleted!

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