WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZTableColumn.h
Go to the documentation of this file.
1 /*
2  * Zuble - A run-time system for QML/Javascript applications
3  * Copyright (C) 2016 Bob Dinitto
4  *
5  * Filename:
6  * Created on: 2/29/2016
7  * Author: Bob Dinitto
8  *
9  * Zuble is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 #ifndef ZTABLECOLUMN_H
26 #define ZTABLECOLUMN_H
27 
28 #include <QObject>
29 #include <QString>
30 
31 namespace Zbl
32 {
33 
38 class ZTableColumn : public QObject
39 {
40  Q_OBJECT
41 public:
42  explicit ZTableColumn(QObject *parent = 0);
43 
50  Q_PROPERTY(QString role READ getRole WRITE putRole)
51 
52 
56  Q_PROPERTY(QString label READ getLabel WRITE putLabel)
57 
62  Q_PROPERTY(int width READ getWidth WRITE putWidth)
63 
68  Q_PROPERTY(int type READ getType WRITE putType)
69 
74  Q_PROPERTY(bool visible READ getVisible WRITE putVisible)
75 
76 
77 
78  // property access methods
79 
80  QString getRole();
81  void putRole(const QString& role);
82  QString getLabel();
83  void putLabel(const QString& label);
84  int getWidth();
85  void putWidth(int width);
86  int getType();
87  void putType(int width);
88  bool getVisible();
89  void putVisible(bool visible);
90 
91 
95  static void registerType();
96 
97 signals:
98 
99 public slots:
100 
101 protected:
102 
103  QString m_role;
104  QString m_label;
105  int m_width;
106  int m_type;
107  bool m_visible;
108 };
109 
110 } // Zbl
111 
112 #endif // ZTABLECOLUMN_H
void putRole(const QString &role)
void putVisible(bool visible)
void putWidth(int width)
Definition: ZAndGate.cpp:6
static void registerType()
Registers ZTableColumn as a QML type.
ZTableColumn(QObject *parent=0)
Defines a column in a ZTableView.
Definition: ZTableColumn.h:38
void putLabel(const QString &label)
void putType(int width)
QString label
Text to display in the column header.
Definition: ZTableColumn.h:56
QString role
Role name of the data to display in this column.
Definition: ZTableColumn.h:50