KProperty

KDefaultPropertyFactory.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2008-2015 Jarosław Staniek <staniek@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KDefaultPropertyFactory.h"
21#include "KPropertyUtils_p.h"
22#include "config-kproperty.h"
23#include "editors/booledit.h"
24#include "editors/coloredit.h"
25#include "editors/combobox.h"
26#include "editors/cursoredit.h"
27#include "editors/dateedit.h"
28#include "editors/datetimeedit.h"
29// #include "editors/dummywidget.h"
30#include "editors/pixmapedit.h"
31#include "editors/pointedit.h"
32#include "editors/pointfedit.h"
33#include "editors/fontedit.h"
34#include "editors/rectedit.h"
35#include "editors/KPropertyRectFEditor.h"
36#include "editors/sizeedit.h"
37#include "editors/sizefedit.h"
38#include "editors/sizepolicyedit.h"
39#include "editors/spinbox.h"
40/*#include "stringlistedit.h"*/
41#include "editors/linestyleedit.h"
42#include "editors/KPropertyStringEditor.h"
43// #include "symbolcombo.h"
44#include "editors/timeedit.h"
45#include "editors/KPropertyUrlEditor.h"
46
47KDefaultPropertyFactory::KDefaultPropertyFactory()
48 : KPropertyWidgetsFactory()
49{
50 KPropertyUtilsPrivate::setupPrivateIconsResourceWithMessage(
51 QString::fromLatin1("kproperty%1").arg(KPROPERTY_STABLE_VERSION_MAJOR),
52 QString::fromLatin1("icons/kproperty_%1.rcc").arg(KPropertyUtilsPrivate::supportedIconTheme()), QtFatalMsg);
53
54 addEditor( KProperty::Bool, new KPropertyBoolDelegate );
55//! @todo addEditor( KProperty::ByteArray, new KPropertyByteArrayDelegate );
56 addEditor( KProperty::Color, new KPropertyColorComboDelegate );
57 addEditor( KProperty::Cursor, new KPropertyCursorDelegate );
58 addEditor( KProperty::Date, new KPropertyDateDelegate );
59 addEditor( KProperty::DateTime, new KPropertyDateTimeDelegate );
60 addEditor( KProperty::Double, new KPropertyDoubleSpinBoxDelegate );
61 addEditor( KProperty::Font, new KPropertyFontDelegate );
62 addEditor( KProperty::Int, new KPropertyIntSpinBoxDelegate );
63 addEditor( KProperty::LineStyle, new KPropertyLineStyleComboDelegate );
64 addEditor( KProperty::LongLong, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
65 addEditor( KProperty::Pixmap, new KPropertyPixmapDelegate );
66 addEditor( KProperty::Point, new KPropertyPointDelegate );
67 addEditor( KProperty::PointF, new KPropertyPointFDelegate );
68 addEditor( KProperty::Rect, new KPropertyRectDelegate );
69 addEditor( KProperty::RectF, new KPropertyRectFDelegate );
70 addEditor( KProperty::Size, new KPropertySizeDelegate );
71 addEditor( KProperty::SizeF, new KPropertySizeFDelegate );
72 addEditor( KProperty::SizePolicy, new KPropertySizePolicyDelegate );
73 addEditor( KProperty::String, new KPropertyStringDelegate );
74 addEditor( KProperty::Time, new KPropertyTimeDelegate );
75 addEditor( KProperty::UInt, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
76 addEditor( KProperty::ULongLong, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
77 addEditor( KProperty::Url, new KPropertyUrlDelegate );
79 addEditor( KProperty::ValueFromList, new KPropertyComboBoxDelegate );
80}
81
82KDefaultPropertyFactory::~KDefaultPropertyFactory()
83{
84}
A delegate supporting Int, UInt, LongLong and ULongLong types.
Definition spinbox.h:91
Delegate for Url and ComposedUrl types.
@ ComposedUrl
composed URL
Definition KProperty.h:155
@ LineStyle
line style
Definition KProperty.h:154
@ ValueFromList
string value from a list
Definition KProperty.h:151
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.