xmlRpcItemDelegate.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, C. Dornhege, University of Freiburg
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * * Neither the name of the University of Freiburg nor the names
14  * of its contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef XML_RPC_ITEM_DELEGATE_H
30 #define XML_RPC_ITEM_DELEGATE_H
31 
32 #include <QStyledItemDelegate>
33 
34 class XmlRpcItemDelegate : public QStyledItemDelegate
35 {
36  Q_OBJECT
37 
38  public:
39  XmlRpcItemDelegate(QObject* parent = NULL);
40  virtual ~XmlRpcItemDelegate();
41 
42  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem & option, const QModelIndex & index) const;
43 
44  void setEditorData(QWidget* editor, const QModelIndex & index) const;
45  void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex & index) const;
46 
47  void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem & option,
48  const QModelIndex & index) const;
49 
50  QString displayText(const QVariant & value, const QLocale & locale) const;
51 
52  unsigned int getDoubleDecimals() const { return doubleDecimals; }
53 
54  public Q_SLOTS:
55  void setDoubleDecimals(unsigned int decs) { doubleDecimals = decs; }
56 
57  protected:
58  unsigned int doubleDecimals;
59 
60 };
61 
62 #endif
63 
unsigned int getDoubleDecimals() const
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void setDoubleDecimals(unsigned int decs)
void setEditorData(QWidget *editor, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
unsigned int doubleDecimals
QString displayText(const QVariant &value, const QLocale &locale) const
XmlRpcItemDelegate(QObject *parent=NULL)


qt_paramedit
Author(s): Christian Dornhege
autogenerated on Mon Feb 28 2022 23:37:51