|
| 1 | +/*************************************************************************** |
| 2 | + qgsscrollareawidgetplugin.cpp |
| 3 | + -------------------------------------- |
| 4 | + Date : March 2017 |
| 5 | + Copyright : (C) 2017 Nyall Dawson |
| 6 | + Email : nyall dot dawson at gmail dot com |
| 7 | +*************************************************************************** |
| 8 | +* * |
| 9 | +* This program is free software; you can redistribute it and/or modify * |
| 10 | +* it under the terms of the GNU General Public License as published by * |
| 11 | +* the Free Software Foundation; either version 2 of the License, or * |
| 12 | +* (at your option) any later version. * |
| 13 | +* * |
| 14 | +***************************************************************************/ |
| 15 | + |
| 16 | + |
| 17 | +#include "qgiscustomwidgets.h" |
| 18 | +#include "qgsscrollareawidgetplugin.h" |
| 19 | +#include "qgsscrollarea.h" |
| 20 | + |
| 21 | + |
| 22 | +QgsScrollAreaWidgetPlugin::QgsScrollAreaWidgetPlugin( QObject *parent ) |
| 23 | + : QObject( parent ) |
| 24 | +{} |
| 25 | + |
| 26 | +QString QgsScrollAreaWidgetPlugin::name() const |
| 27 | +{ |
| 28 | + return "QgsScrollArea"; |
| 29 | +} |
| 30 | + |
| 31 | +QString QgsScrollAreaWidgetPlugin::group() const |
| 32 | +{ |
| 33 | + return QgisCustomWidgets::groupName(); |
| 34 | +} |
| 35 | + |
| 36 | +QString QgsScrollAreaWidgetPlugin::includeFile() const |
| 37 | +{ |
| 38 | + return "qgsscrollarea.h"; |
| 39 | +} |
| 40 | + |
| 41 | +QIcon QgsScrollAreaWidgetPlugin::icon() const |
| 42 | +{ |
| 43 | + return QIcon( ":/images/icons/qgis-icon-60x60.png" ); |
| 44 | +} |
| 45 | + |
| 46 | +bool QgsScrollAreaWidgetPlugin::isContainer() const |
| 47 | +{ |
| 48 | + return true; |
| 49 | +} |
| 50 | + |
| 51 | +QWidget *QgsScrollAreaWidgetPlugin::createWidget( QWidget *parent ) |
| 52 | +{ |
| 53 | + return new QgsScrollArea( parent ); |
| 54 | +} |
| 55 | + |
| 56 | +bool QgsScrollAreaWidgetPlugin::isInitialized() const |
| 57 | +{ |
| 58 | + return mInitialized; |
| 59 | +} |
| 60 | + |
| 61 | +void QgsScrollAreaWidgetPlugin::initialize( QDesignerFormEditorInterface *core ) |
| 62 | +{ |
| 63 | + Q_UNUSED( core ); |
| 64 | + if ( mInitialized ) |
| 65 | + return; |
| 66 | + mInitialized = true; |
| 67 | +} |
| 68 | + |
| 69 | + |
| 70 | +QString QgsScrollAreaWidgetPlugin::toolTip() const |
| 71 | +{ |
| 72 | + return tr( "Scroll area" ); |
| 73 | +} |
| 74 | + |
| 75 | +QString QgsScrollAreaWidgetPlugin::whatsThis() const |
| 76 | +{ |
| 77 | + return ""; |
| 78 | +} |
| 79 | + |
| 80 | +QString QgsScrollAreaWidgetPlugin::domXml() const |
| 81 | +{ |
| 82 | + return QString( "<ui language=\"c++\">\n" |
| 83 | + " <widget class=\"%1\" name=\"mScrollArea\">\n" |
| 84 | + " <property name=\"geometry\">\n" |
| 85 | + " <rect>\n" |
| 86 | + " <x>0</x>\n" |
| 87 | + " <y>0</y>\n" |
| 88 | + " <width>300</width>\n" |
| 89 | + " <height>100</height>\n" |
| 90 | + " </rect>\n" |
| 91 | + " </property>\n" |
| 92 | + " </widget>\n" |
| 93 | + "</ui>\n" ) |
| 94 | + .arg( name() ); |
| 95 | +} |
0 commit comments