Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • 0 Votes
    2 Posts
    279 Views
    M
    @jdent said in Memory Leak in the variables in the UI section of a Qt Widget's application!: Doesn't this constitute a leakage? Read this to find out why not : https://doc.qt.io/qt-6/objecttrees.html
  • 1 Votes
    14 Posts
    4k Views
    S
    Copy "libstdc++6.dll" from where the mingw bin files are located into your folder where the executable is located. This worked for me and it should work for yall :)
  • Using a Qt Designer custom widget gives me link errors!

    Unsolved design plugin install
    2
    0 Votes
    2 Posts
    268 Views
    SGaistS
    Hi, Since you mention linking to a library, did you properly export the symbols of that library ?
  • What macro is to be used in order to export from a DLL?

    Unsolved plugin customwidget
    2
    0 Votes
    2 Posts
    370 Views
    Christian EhrlicherC
    See https://doc.qt.io/qt-6/sharedlibrary.html
  • Qt6 QBluetoothSocket readyRead() signal but nothing to read in the socket

    Unsolved
    6
    0 Votes
    6 Posts
    341 Views
    S
    @SGaist Thanks for the advice! A bug report has been added: https://bugreports.qt.io/browse/QTBUG-123390 Appreciate the help!
  • QListWidget look

    Unsolved
    2
    0 Votes
    2 Posts
    148 Views
    JonBJ
    @JoshG I don't know what "active" vs "selected" looks like, but are you aware you can alter the appearance from stylesheet via ::item:selected per https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qlistview? You can't "copy" from the active style though. You could do that instead in code in QStyledItemDelegate::paint() if you wanted that.
  • serialport communication through Qthread

    Solved
    25
    0 Votes
    25 Posts
    3k Views
    S
    @Christian-Ehrlicher ok thankyou for your reply.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • 0 Votes
    4 Posts
    238 Views
    H
    @SGaist Thanks . you're welcome I stumbled this webpage accidentally, where Mr. Chilarai Mushahary had done exactly what I was looking for.
  • Debug output in a C++ library

    Solved
    2
    0 Votes
    2 Posts
    220 Views
    S
    @SteMMo said in Debug output in a C++ library: Hi all, I'm developing a pure C++ static library. This library is linked to a Qt application. How can I generate debug messages in the library? I'm developing with VS environment in Windows and VSCode on iOS. I'm trying with cout <<"xyz" and printf() but they are not shown in Debug window.. Thanks! Regards Redirect the stdout somewhere else such as a pipe or even just a file and read from there in the your Qt app. But you could also create an abstration for IO that your library uses and then your Qt host applicadtion can just implement it. Easier.
  • QtRO, How to make repc (.rep) customtype accessible in qml?

    Unsolved
    3
    0 Votes
    3 Posts
    204 Views
    M
    @Redman said in QtRO, How to make repc (.rep) customtype accessible in qml?: Q_DECLARE_METATYPE I tried Q_DECLARE_METATYPE, qRegisterMetaType and qmlRegisterType with CustomType and QList<CustomType>. Does not help. When i do this in qml: Connections { target: CustomInterfaceReplica function onListChanged(list) { tabButtonSplit.text = list[0].myProperty } } text shows "undefined". when i call list[0].toString() it shows "QVariant(QList<mynamespace::CustomClass, )"
  • How to use QT creator for developing QT UI applications and using my C++ knowledge

    Unsolved
    4
    0 Votes
    4 Posts
    762 Views
    Pl45m4P
    @Venkat123 Like @Bonnie said above, you installed Qt Design Studio. This is solely for modelling (more or less complex) 2D/3D GUIs in QML. So not a QtWidget-application. If you install QtCreator, you will find the IDE for coding in C++
  • What's the best way to parse a huge XML Document?

    Unsolved
    13
    0 Votes
    13 Posts
    3k Views
    S
    Do you need exactly Qt solution? You could check this sample https://redata.dev/smartxml/docs/how-to-parse-xml-into-sql-or-json.html it's not QT, but allow parse big filex
  • QSystemTrayIcon on Windows11

    Solved
    1
    0 Votes
    1 Posts
    307 Views
    No one has replied
  • Ini Files

    Solved
    7
    0 Votes
    7 Posts
    421 Views
    S
    You can also provide default values for your settings. In that case you don't even have to include any ini files into qrc in the first place. Provide a path where ini files can be written instead.
  • Qt creator 9.0.1 Header file QtNetwork file not found.

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    jsulmJ
    @micha_eleric Please show your current CMakeLists.txt file. Also, you should do complete rebuild after changing CMakeLists.txt
  • qt creator not making a pro file

    Solved
    4
    0 Votes
    4 Posts
    311 Views
    Pl45m4P
    @micha_eleric The recommended build system for Qt 6 is CMake, but you can still use QMake (with *.pro file instead of CMakeLists.txt). You need to change your project to QMake Project. https://doc.qt.io/qt-6/qt6-buildsystem.html
  • QT 5.14.1 Debugger broken after MSVC 2017 update

    Unsolved
    2
    0 Votes
    2 Posts
    178 Views
    J
    @jabroni I should also add that I've omitted that warning that appears on launch, and instead once w.show() is called, the program stops in the disassembler code section.
  • Problem understanding Signals/Slots

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    E
    @Pl45m4 Problem solved. Thanks to everyone who contributed. I am going to post below the final version of the source code that contains all of the changes that occurred as a result of this topic-thread. Perhaps this example will be useful to another first time user of Qt Signals/Slots. main.cpp #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } MainWindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H MainWindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" #include "myclassa.h" #include "myclassb.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->myView, &MyClassB::mySignal, ui->myLabel, &MyClassA::setPoint); } MainWindow::~MainWindow() { delete ui; } myClassA.h #ifndef MYCLASSA_H #define MYCLASSA_H #include <QLabel> #include <QObject> #include <QPoint> #include <QWidget> class MyClassA : public QLabel { Q_OBJECT public: MyClassA(QWidget *parent = nullptr); ~MyClassA(); public slots: void setPoint (QPoint point); private: QPoint p; }; #endif // MYCLASSA_H MyClassA.cpp #include <QDebug> #include <QLabel> #include <QPoint> #include "myclassA.h" MyClassA::MyClassA(QWidget *parent) : QLabel(parent) { } MyClassA::~MyClassA() { } void MyClassA::setPoint (QPoint point) { qDebug("MyClassA::setPoint"); p = point; } MyClassB.h #ifndef MYCLASSB_H #define MYCLASSB_H #include <QChartView> #include <QMouseEvent> #include <QObject> #include <QPoint> #include <QWidget> class MyClassB : public QChartView { Q_OBJECT public: MyClassB(QWidget *parent = nullptr); ~MyClassB(); signals: void mySignal(QPoint p); protected: void mousePressEvent(QMouseEvent *event) override; }; #endif // MYCLASSB_H MyClassB.cpp #include <QChartView> #include <QMouseEvent> #include <QWidget> #include "myclassB.h" MyClassB::MyClassB(QWidget *parent) : QChartView(parent) { } MyClassB::~MyClassB() { } void MyClassB::mousePressEvent(QMouseEvent* event) { qDebug("MyClassB::mousePressEvent"); QPoint pos = event->pos(); emit mySignal(pos); QChartView::mousePressEvent(event); /* pass-on the event to the base class */ } MainWindow.ui <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>800</width> <height>600</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget"> <widget class="MyClassB" name="myView"> <property name="geometry"> <rect> <x>160</x> <y>90</y> <width>321</width> <height>281</height> </rect> </property> </widget> <widget class="MyClassA" name="myLabel"> <property name="geometry"> <rect> <x>570</x> <y>190</y> <width>121</width> <height>20</height> </rect> </property> <property name="text"> <string>TextLabel</string> </property> </widget> </widget> <widget class="QMenuBar" name="menubar"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>800</width> <height>26</height> </rect> </property> </widget> <widget class="QStatusBar" name="statusbar"/> </widget> <customwidgets> <customwidget> <class>MyClassB</class> <extends>QGraphicsView</extends> <header>myclassb.h</header> </customwidget> <customwidget> <class>MyClassA</class> <extends>QLabel</extends> <header location="global">myclassa.h</header> </customwidget> </customwidgets> <resources/> <connections/> </ui>
  • QSerialport readyRead() for measuring revolutions

    Solved
    21
    0 Votes
    21 Posts
    2k Views
    H
    @herrgross got it!!!! in the arduino code the interrupt must be set to RISING instead of HIGH, so it's only sending when the state of the interruptpin c h a n g e s to HIGH attachInterrupt(digitalPinToInterrupt(interruptPin), impuls, RISING); thank you all!!