Changeset View
Changeset View
Standalone View
Standalone View
src/lib/plugin/kpluginfactory.h
Show First 20 Lines • Show All 524 Lines • ▼ Show 20 Line(s) | 493 | #endif | |||
---|---|---|---|---|---|
525 | { | 525 | { | ||
526 | return new impl(parentWidget, parent, args); | 526 | return new impl(parentWidget, parent, args); | ||
527 | } | 527 | } | ||
528 | 528 | | |||
529 | private: | 529 | private: | ||
530 | void registerPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction); | 530 | void registerPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction); | ||
531 | }; | 531 | }; | ||
532 | 532 | | |||
533 | // Deprecation wrapper macro added only for 5.70, while backward typedef added in 4.0 | ||||
534 | #if KCOREADDONS_ENABLE_DEPRECATED_SINCE(5, 70) | ||||
535 | /** | ||||
536 | * Backward compatibility typedef for KPluginFactory | ||||
537 | * @deprecated since 4.0, use KPluginFactory | ||||
538 | */ | ||||
533 | typedef KPluginFactory KLibFactory; | 539 | typedef KPluginFactory KLibFactory; | ||
540 | #endif | ||||
534 | 541 | | |||
535 | template<typename T> | 542 | template<typename T> | ||
536 | inline T *KPluginFactory::create(QObject *parent, const QVariantList &args) | 543 | inline T *KPluginFactory::create(QObject *parent, const QVariantList &args) | ||
537 | { | 544 | { | ||
538 | QObject *o = create(T::staticMetaObject.className(), parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent) : nullptr, parent, args, QString()); | 545 | QObject *o = create(T::staticMetaObject.className(), parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent) : nullptr, parent, args, QString()); | ||
539 | 546 | | |||
540 | T *t = qobject_cast<T *>(o); | 547 | T *t = qobject_cast<T *>(o); | ||
541 | if (!t) { | 548 | if (!t) { | ||
Show All 32 Lines |