Changeset View
Changeset View
Standalone View
Standalone View
src/formeditor/WidgetInfo.cpp
1 | /* This file is part of the KDE project | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at> | 2 | Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at> | ||
3 | Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr> | 3 | Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr> | ||
4 | Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org> | 4 | Copyright (C) 2004-2017 Jarosław Staniek <staniek@kde.org> | ||
5 | 5 | | |||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or | ||
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public | ||
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either | ||
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. | ||
10 | 10 | | |||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 30 | public: | |||
54 | QList<QByteArray> autoSaveProperties; | 54 | QList<QByteArray> autoSaveProperties; | ||
55 | QByteArray saveName; | 55 | QByteArray saveName; | ||
56 | QPointer<WidgetFactory> factory; | 56 | QPointer<WidgetFactory> factory; | ||
57 | QHash<QByteArray, tristate> *propertiesWithDisabledAutoSync; | 57 | QHash<QByteArray, tristate> *propertiesWithDisabledAutoSync; | ||
58 | QHash<QByteArray, int> *customTypesForProperty; | 58 | QHash<QByteArray, int> *customTypesForProperty; | ||
59 | QByteArray parentFactoryName; | 59 | QByteArray parentFactoryName; | ||
60 | QByteArray inheritedClassName; //!< Used for inheriting widgets between factories | 60 | QByteArray inheritedClassName; //!< Used for inheriting widgets between factories | ||
61 | WidgetInfo* inheritedClass; | 61 | WidgetInfo* inheritedClass; | ||
62 | 62 | Qt::Alignment supportedAlignmentFlags = Qt::Alignment(Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask) ^ Qt::AlignAbsolute; | |||
63 | }; | 63 | }; | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | //-------------------------------------- | 66 | //-------------------------------------- | ||
67 | 67 | | |||
68 | using namespace KFormDesigner; | 68 | using namespace KFormDesigner; | ||
69 | 69 | | |||
70 | WidgetInfo::WidgetInfo(WidgetFactory *f) | 70 | WidgetInfo::WidgetInfo(WidgetFactory *f) | ||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 265 | { | |||
266 | return d->factory->internalProperty(d->className, property); | 266 | return d->factory->internalProperty(d->className, property); | ||
267 | } | 267 | } | ||
268 | 268 | | |||
269 | void WidgetInfo::setInternalProperty(const QByteArray& property, const QVariant& value) | 269 | void WidgetInfo::setInternalProperty(const QByteArray& property, const QVariant& value) | ||
270 | { | 270 | { | ||
271 | InternalPropertyHandlerInterface *iface = static_cast<InternalPropertyHandlerInterface*>(d->factory); | 271 | InternalPropertyHandlerInterface *iface = static_cast<InternalPropertyHandlerInterface*>(d->factory); | ||
272 | iface->setInternalProperty(d->className, property, value); | 272 | iface->setInternalProperty(d->className, property, value); | ||
273 | } | 273 | } | ||
274 | | ||||
275 | Qt::Alignment WidgetInfo::supportedAlignmentFlags() const | ||||
276 | { | ||||
277 | return d->supportedAlignmentFlags; | ||||
278 | } | ||||
279 | | ||||
280 | void WidgetInfo::setSupportedAlignmentFlags(Qt::Alignment flags) | ||||
281 | { | ||||
282 | d->supportedAlignmentFlags = flags; | ||||
283 | } |