qstringlistmodel

How can I display a QStringList in C++ to a QML ListView

[亡魂溺海] 提交于 2020-01-01 19:27:08
问题 So I'm new to Qt and I'm trying to improve my C++ skills, so I decided to start a project where I can search items in a QStringList using a textfield. I got the search function working and I was able to move the result of the search into another QStringList , where I can use it to display to the user in a function that is declared as a "public slot". The main Idea is that the list will auto update as soon as the user enters a character into the textfield, which it already does. So I managed

Error in model view implemention of GUI in pyqt

余生长醉 提交于 2019-12-07 23:12:26
问题 the following sample code is crashing with this error when I close the application: QBasicTimer::start: QBasicTimer can only be used with threads started with QThread here is my code : import sys from PyQt4 import QtGui ,QtCore app = QtGui.QApplication(sys.argv) data=[] data.append("one") model=QtGui.QStringListModel(data) combobox=QtGui.QComboBox() combobox.show() combobox.setModel(model) sys.exit(app.exec_()) I found out that's about using model but I don't know how to fix it. edited: os :

Error in model view implemention of GUI in pyqt

吃可爱长大的小学妹 提交于 2019-12-06 13:15:33
the following sample code is crashing with this error when I close the application: QBasicTimer::start: QBasicTimer can only be used with threads started with QThread here is my code : import sys from PyQt4 import QtGui ,QtCore app = QtGui.QApplication(sys.argv) data=[] data.append("one") model=QtGui.QStringListModel(data) combobox=QtGui.QComboBox() combobox.show() combobox.setModel(model) sys.exit(app.exec_()) I found out that's about using model but I don't know how to fix it. edited: os : win 7 64bit pyqt4 The program is not "crashing": it is merely printing an error message during the

How can I display a QStringList in C++ to a QML ListView

拟墨画扇 提交于 2019-12-04 19:58:01
So I'm new to Qt and I'm trying to improve my C++ skills, so I decided to start a project where I can search items in a QStringList using a textfield. I got the search function working and I was able to move the result of the search into another QStringList , where I can use it to display to the user in a function that is declared as a "public slot". The main Idea is that the list will auto update as soon as the user enters a character into the textfield, which it already does. So I managed to get the resulted list into the Slot function to be able to display a different list every time and