designer/LEDPlugin.h

Wed, 29 Jun 2022 21:28:13 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 29 Jun 2022 21:28:13 +0200
changeset 316
dcd472be9ae8
parent 314
04b93b656b60
permissions
-rw-r--r--

Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.

#ifndef _LED_PLUGIN_H_
#define _LED_PLUGIN_H_

#include <QObject>
#include <QString>
#include <QWidget>
#include <QIcon>
#include <QtUiPlugin/QDesignerCustomWidgetInterface>

class LEDPlugin;

class LEDPlugin : public QObject, public QDesignerCustomWidgetInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
    Q_INTERFACES(QDesignerCustomWidgetInterface)

public:
	LEDPlugin(QObject* parent=0);

    QString name() const;
    QString group() const;
    QString toolTip() const;
    QString whatsThis() const;
    QString includeFile() const;
    QIcon icon() const;
    QString domXml() const;

    bool isContainer() const;
    bool isInitialized() const;

    QWidget *createWidget(QWidget *parent);
    void initialize(QDesignerFormEditorInterface *core);

private:
    bool initialized = false;
};

#endif

mercurial