KProperty

cursoredit.h
1 /* This file is part of the KDE project
2  Copyright (C) 2004 Cedric Pasteur <[email protected]>
3  Copyright (C) 2004 Alexander Dymo <[email protected]>
4  Copyright (C) 2008-2015 Jarosław Staniek <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KPROPERTY_CURSOREDIT_H
23 #define KPROPERTY_CURSOREDIT_H
24 
25 #include "combobox.h"
26 
27 class KPROPERTYWIDGETS_EXPORT KPropertyCursorEditor : public KPropertyComboBoxEditor
28 {
29  Q_OBJECT
30  Q_PROPERTY(QCursor value READ cursorValue WRITE setCursorValue USER true)
31 
32 public:
33  explicit KPropertyCursorEditor(QWidget *parent = nullptr);
34  ~KPropertyCursorEditor() override;
35 
36  virtual QCursor cursorValue() const;
37 
38 public Q_SLOTS:
39  virtual void setCursorValue(const QCursor &value);
40 
41 private:
42  Q_DISABLE_COPY(KPropertyCursorEditor)
43  class Private;
44  Private * const d;
45 };
46 
47 class KPROPERTYWIDGETS_EXPORT KPropertyCursorDelegate : public KPropertyEditorCreatorInterface,
48  public KPropertyValuePainterInterface,
50 {
51 public:
52  KPropertyCursorDelegate();
53 
54  QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option,
55  const QModelIndex &index) const override;
56 
57  void paint(QPainter *painter, const QStyleOptionViewItem &option,
58  const QModelIndex &index) const override;
59 
60  QString valueToString(const QVariant &value, const QLocale &locale) const override;
61 };
62 
63 #endif
An interface for editor widget creators.
Provides a specialized conversion of value to string depending on type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 23:10:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.