tableview

QML TableView rowDelegate styleData.row not defined

蓝咒 提交于 2020-12-31 17:39:40
问题 I am trying to create a custom row delegate for a TableView . according to the Documentation, the rowDelegate should have access to a property called styleData.row . However, when I'm try to access this property, it is undefined. I used the debugger to check whats inside the styleData , and the row is missing: My code is very simple: TableView { width: 500//DEBUG height: 300//DEBUG model: ListModel { ListElement { lectureName: "Baum1" } ListElement { lectureName: "Baum2" } ListElement {

QML TableView rowDelegate styleData.row not defined

纵饮孤独 提交于 2020-12-31 17:35:45
问题 I am trying to create a custom row delegate for a TableView . according to the Documentation, the rowDelegate should have access to a property called styleData.row . However, when I'm try to access this property, it is undefined. I used the debugger to check whats inside the styleData , and the row is missing: My code is very simple: TableView { width: 500//DEBUG height: 300//DEBUG model: ListModel { ListElement { lectureName: "Baum1" } ListElement { lectureName: "Baum2" } ListElement {

QML TableView rowDelegate styleData.row not defined

99封情书 提交于 2020-12-31 17:33:47
问题 I am trying to create a custom row delegate for a TableView . according to the Documentation, the rowDelegate should have access to a property called styleData.row . However, when I'm try to access this property, it is undefined. I used the debugger to check whats inside the styleData , and the row is missing: My code is very simple: TableView { width: 500//DEBUG height: 300//DEBUG model: ListModel { ListElement { lectureName: "Baum1" } ListElement { lectureName: "Baum2" } ListElement {

QML TableView rowDelegate styleData.row not defined

半世苍凉 提交于 2020-12-31 17:20:17
问题 I am trying to create a custom row delegate for a TableView . according to the Documentation, the rowDelegate should have access to a property called styleData.row . However, when I'm try to access this property, it is undefined. I used the debugger to check whats inside the styleData , and the row is missing: My code is very simple: TableView { width: 500//DEBUG height: 300//DEBUG model: ListModel { ListElement { lectureName: "Baum1" } ListElement { lectureName: "Baum2" } ListElement {

QML TableView get data from specific cell (selected row + specific column)

时间秒杀一切 提交于 2020-12-04 01:01:04
问题 I have QML TableView with QSqlQueryModel . I need to select any row and get data from every column of table to separate TextField . Here is abonentstable.h: #pragma once #include <QObject> #include <QSqlQueryModel> class AbonentsSqlModel : public QSqlQueryModel { Q_OBJECT public: explicit AbonentsSqlModel(QObject *parent = 0); void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase()); QVariant data(const QModelIndex &index, int role) const; QHash<int, QByteArray> roleNames(

QML TableView get data from specific cell (selected row + specific column)

孤街浪徒 提交于 2020-12-04 00:59:56
问题 I have QML TableView with QSqlQueryModel . I need to select any row and get data from every column of table to separate TextField . Here is abonentstable.h: #pragma once #include <QObject> #include <QSqlQueryModel> class AbonentsSqlModel : public QSqlQueryModel { Q_OBJECT public: explicit AbonentsSqlModel(QObject *parent = 0); void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase()); QVariant data(const QModelIndex &index, int role) const; QHash<int, QByteArray> roleNames(

UIView and TableView resizable

独自空忆成欢 提交于 2020-07-23 06:36:24
问题 image 1 image 2 As you see, i have storyboard like in pic 1, but in simulator it looks like in pic 2. How can i make it, thats this tableView inside View will be fullsized if contains some data. If not - it will be hidden. At this moment, if its contains some data, UIview doesnt change the height and uitableview is almost not visible. This lines didnt help: tableView.estimatedRowHeight = 44.0 tableView.rowHeight = UITableView.automaticDimension ------------------part 2--------here is code of