git-svn-id: svn://db.shs.com.ru/libs@452 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
69
qad/widgets/plugin/imageviewplugin.cpp
Normal file
69
qad/widgets/plugin/imageviewplugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "image_view.h"
|
||||
#include "imageviewplugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
ImageViewPlugin::ImageViewPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void ImageViewPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool ImageViewPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * ImageViewPlugin::createWidget(QWidget * parent) {
|
||||
return new ImageView(parent);
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::name() const {
|
||||
return QLatin1String("ImageView");
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::group() const {
|
||||
return QLatin1String("Display Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon ImageViewPlugin::icon() const {
|
||||
return QIcon(/*":/icons/spinslider.png"*/);
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::toolTip() const {
|
||||
return QLatin1String("Image viewer");
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::whatsThis() const {
|
||||
return QLatin1String("Image viewer");
|
||||
}
|
||||
|
||||
|
||||
bool ImageViewPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"ImageView\" name=\"imageView\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString ImageViewPlugin::includeFile() const {
|
||||
return QLatin1String("image_view.h");
|
||||
}
|
||||
|
||||
36
qad/widgets/plugin/imageviewplugin.h
Normal file
36
qad/widgets/plugin/imageviewplugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef IMAGEVIEWPLUGIN_H
|
||||
#define IMAGEVIEWPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class ImageViewPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
ImageViewPlugin(QObject * parent = 0);
|
||||
|
||||
bool isContainer() const;
|
||||
bool isInitialized() const;
|
||||
QIcon icon() const;
|
||||
QString domXml() const;
|
||||
QString group() const;
|
||||
QString includeFile() const;
|
||||
QString name() const;
|
||||
QString toolTip() const;
|
||||
QString whatsThis() const;
|
||||
QWidget * createWidget(QWidget * parent);
|
||||
void initialize(QDesignerFormEditorInterface * core);
|
||||
|
||||
private:
|
||||
bool m_initialized;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "qvarianteditplugin.h"
|
||||
#include "qpiconfigplugin.h"
|
||||
#include "evalspinboxplugin.h"
|
||||
#include "imageviewplugin.h"
|
||||
|
||||
|
||||
QADWidgets::QADWidgets(QObject * parent): QObject(parent) {
|
||||
@@ -32,6 +33,7 @@ QADWidgets::QADWidgets(QObject * parent): QObject(parent) {
|
||||
m_widgets.append(new QVariantEditPlugin(this));
|
||||
m_widgets.append(new QPIConfigPlugin(this));
|
||||
m_widgets.append(new EvalSpinBoxPlugin(this));
|
||||
m_widgets.append(new ImageViewPlugin(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user