QT6 function overloading – QList redefinition of QVector

I have an compilation error "error: redefinition of ‘from_json’" with that code: #include <QVector> #include <QList> #include <QDebug> template<typename OwnType> void from_json(QVector<OwnType> &p) { qDebug() << "QVector"; } template<typename OwnType> void from_json(QList<OwnType> &p) { qDebug() << "QList"; } But i getting that compilation error only in QT6. In QT5 that compilling and working successfully. Whats… Read More QT6 function overloading – QList redefinition of QVector

My QT connect works from parent to child, but not vice versa

I am making a QT application. I have a MainWindow1 class and a FirstTab class. The MainWindow1 class is a QMainWindow and inside I created this signal -> mainwindow1.h signals: void loadDateSig(QString strDate); And in FirstTab I created this slot-> FirstTab.h public slots: void loadDate(QString date); Q_Object is defined in both MainWindow1 and in FirstTab.… Read More My QT connect works from parent to child, but not vice versa

Call db.close() on Button_Click (QT/C++)

how can i close a database connction from Button_onClick funktion? Artikelverwaltung::Artikelverwaltung(QWidget *parent) : QDialog(parent), ui(new Ui::Artikelverwaltung) { … QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); … } void Artikelverwaltung::on_pushButton_clicked() { db.close(); // <—- This is not working of cause. how can i do this? } Best regards >Solution : It is not working because db is a local… Read More Call db.close() on Button_Click (QT/C++)

QML ListView Model setProperty Work only 1 time

I have a ListView filled with checkboxes, I want to change the checkbox status from a button click this is my code. import QtQuick import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") ListView { id: mylist width: parent.width height: 300 anchors { top: parent.top left: parent.left right: parent.right bottom:… Read More QML ListView Model setProperty Work only 1 time