2022-12-18 14:19:04 +00:00
|
|
|
/*##############################################################################
|
|
|
|
## Author: Shaun Reed ##
|
2023-01-02 03:26:58 +00:00
|
|
|
## Legal: All Content (c) 2023 Shaun Reed, all rights reserved ##
|
2022-12-18 14:19:04 +00:00
|
|
|
## About: Collection of widget plugins for Qt Designer ##
|
|
|
|
## ##
|
|
|
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
|
|
|
################################################################################
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QTK_WIDGETPLUGINCOLLECTION_H
|
|
|
|
#define QTK_WIDGETPLUGINCOLLECTION_H
|
|
|
|
|
|
|
|
#include <QDesignerCustomWidgetCollectionInterface>
|
|
|
|
|
|
|
|
class WidgetPluginCollection :
|
|
|
|
public QObject,
|
|
|
|
public QDesignerCustomWidgetCollectionInterface {
|
|
|
|
Q_OBJECT
|
|
|
|
// Since we're exporting a collection, this is the only plugin metadata
|
2023-01-02 03:26:58 +00:00
|
|
|
// needed. We don't need this for-each widget in the collection.
|
2022-12-18 14:19:04 +00:00
|
|
|
Q_PLUGIN_METADATA(IID "com.Klips.WidgetPluginCollection")
|
|
|
|
// Tell Qt Object system that we're implementing an interface.
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
|
|
|
|
|
|
|
public:
|
2023-01-02 03:26:58 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Contructors / Destructors
|
|
|
|
**************************************************************************/
|
|
|
|
|
2022-12-18 14:19:04 +00:00
|
|
|
explicit WidgetPluginCollection(QObject * parent = nullptr);
|
2023-01-02 03:26:58 +00:00
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* Public Methods
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return QList of all custom widgets pointers.
|
|
|
|
*/
|
2022-12-18 14:19:04 +00:00
|
|
|
[[nodiscard]] QList<QDesignerCustomWidgetInterface *> customWidgets() const;
|
|
|
|
|
|
|
|
private:
|
2023-01-02 03:26:58 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Private Members
|
|
|
|
**************************************************************************/
|
|
|
|
|
2022-12-18 14:19:04 +00:00
|
|
|
QList<QDesignerCustomWidgetInterface *> m_collection;
|
|
|
|
QString m_collectionName;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QTK_WIDGETPLUGINCOLLECTION_H
|