Changeset View
Changeset View
Standalone View
Standalone View
src/core/kcoreconfigskeleton.h
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 229 | protected: | |||
---|---|---|---|---|---|
242 | // HACK: Necessary to avoid introducing new virtuals in KConfigSkeletonItem | 242 | // HACK: Necessary to avoid introducing new virtuals in KConfigSkeletonItem | ||
243 | // KF6: Use proper pure virtuals in KConfigSkeletonItem | 243 | // KF6: Use proper pure virtuals in KConfigSkeletonItem | ||
244 | void setIsDefaultImpl(const std::function<bool()> &impl); | 244 | void setIsDefaultImpl(const std::function<bool()> &impl); | ||
245 | void setIsSaveNeededImpl(const std::function<bool()> &impl); | 245 | void setIsSaveNeededImpl(const std::function<bool()> &impl); | ||
246 | 246 | | |||
247 | KConfigSkeletonItemPrivate *const d_ptr; | 247 | KConfigSkeletonItemPrivate *const d_ptr; | ||
248 | }; | 248 | }; | ||
249 | 249 | | |||
250 | class KPropertySkeletonItemPrivate; | ||||
251 | | ||||
252 | /** | ||||
253 | * \class KPropertySkeletonItem kcoreconfigskeleton.h <KCoreConfigSkeleton> | ||||
254 | * | ||||
255 | * @short Class for proxying a QObject property as a preferences setting | ||||
256 | * @author Kevin Ottens | ||||
257 | * @see KConfigSkeletonItem | ||||
258 | * | ||||
259 | * This class represents one preferences setting as used by @ref KCoreConfigSkeleton. | ||||
260 | * Unlike other @ref KConfigSkeletonItem subclasses, this one won't store the preference | ||||
261 | * in KConfig but will use a QObject property as storage. | ||||
262 | * You will have to register instances of this class with the function KCoreConfigSkeleton::addItem(). | ||||
263 | * | ||||
264 | * @since 5.65 | ||||
265 | */ | ||||
266 | class KCONFIGCORE_EXPORT KPropertySkeletonItem : public KConfigSkeletonItem | ||||
267 | { | ||||
268 | Q_DECLARE_PRIVATE(KPropertySkeletonItem) | ||||
269 | public: | ||||
270 | /** | ||||
271 | * Constructor | ||||
272 | * | ||||
273 | * @param object The QObject instance which we'll manage the property of | ||||
274 | * @param propertyName The name of the property in @p object which we'll manage | ||||
275 | * @param defaultValue The default value of the property | ||||
276 | */ | ||||
277 | KPropertySkeletonItem(QObject *object, const QByteArray &propertyName, const QVariant &defaultValue); | ||||
278 | | ||||
279 | /** @copydoc KConfigSkeletonItem::property() */ | ||||
280 | QVariant property() const override; | ||||
281 | /** @copydoc KConfigSkeletonItem::setProperty(const QVariant &) */ | ||||
282 | void setProperty(const QVariant &p) override; | ||||
283 | /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */ | ||||
284 | bool isEqual(const QVariant &p) const override; | ||||
285 | | ||||
286 | /** @copydoc KConfigSkeletonItem::readConfig(KConfig *) */ | ||||
287 | void readConfig(KConfig *) override; | ||||
288 | /** @copydoc KConfigSkeletonItem::writeConfig(KConfig *) */ | ||||
289 | void writeConfig(KConfig *) override; | ||||
290 | | ||||
291 | /** @copydoc KConfigSkeletonItem::readDefault(KConfig *) */ | ||||
292 | void readDefault(KConfig *) override; | ||||
293 | /** @copydoc KConfigSkeletonItem::setDefault() */ | ||||
294 | void setDefault() override; | ||||
295 | /** @copydoc KConfigSkeletonItem::swapDefault() */ | ||||
296 | void swapDefault() override; | ||||
297 | }; | ||||
298 | | ||||
299 | | ||||
250 | /** | 300 | /** | ||
251 | * \class KConfigSkeletonGenericItem kcoreconfigskeleton.h <KConfigSkeletonGenericItem> | 301 | * \class KConfigSkeletonGenericItem kcoreconfigskeleton.h <KConfigSkeletonGenericItem> | ||
252 | */ | 302 | */ | ||
253 | template < typename T > class KConfigSkeletonGenericItem: public KConfigSkeletonItem | 303 | template < typename T > class KConfigSkeletonGenericItem: public KConfigSkeletonItem | ||
254 | { | 304 | { | ||
255 | public: | 305 | public: | ||
256 | /** @copydoc KConfigSkeletonItem(const QString&, const QString&) | 306 | /** @copydoc KConfigSkeletonItem(const QString&, const QString&) | ||
257 | @param reference The initial value to hold in the item | 307 | @param reference The initial value to hold in the item | ||
▲ Show 20 Lines • Show All 1297 Lines • Show Last 20 Lines |