mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Replace QgsDataDefinedButton custom widget with QgsPropertyOverrideButton widget
This commit is contained in:
parent
c4ec256dc2
commit
2468b27641
@ -14,8 +14,7 @@ SET (QGIS_CUSTOMWIDGETS_SRCS
|
||||
qgiscustomwidgets.cpp
|
||||
qgscollapsiblegroupboxplugin.cpp
|
||||
qgscolorbuttonplugin.cpp
|
||||
qgsdatetimeeditplugin.cpp
|
||||
qgsdatadefinedbuttonplugin.cpp
|
||||
qgsdatetimeeditplugin.cpp
|
||||
qgsdockwidgetplugin.cpp
|
||||
qgsdoublespinboxplugin.cpp
|
||||
qgsexpressionbuilderwidgetplugin.cpp
|
||||
@ -27,6 +26,7 @@ SET (QGIS_CUSTOMWIDGETS_SRCS
|
||||
qgsfilterlineeditplugin.cpp
|
||||
qgsmaplayercomboboxplugin.cpp
|
||||
qgsprojectionselectionwidgetplugin.cpp
|
||||
qgspropertyoverridebuttonplugin.cpp
|
||||
qgsrelationeditorwidgetplugin.cpp
|
||||
qgsrelationreferencewidgetplugin.cpp
|
||||
qgsscalerangewidgetplugin.cpp
|
||||
@ -39,7 +39,6 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS
|
||||
qgscollapsiblegroupboxplugin.h
|
||||
qgscolorbuttonplugin.h
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsdockwidgetplugin.h
|
||||
qgsdoublespinboxplugin.h
|
||||
qgsexpressionbuilderwidgetplugin.h
|
||||
@ -51,6 +50,7 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS
|
||||
qgsfilterlineeditplugin.h
|
||||
qgsmaplayercomboboxplugin.h
|
||||
qgsprojectionselectionwidgetplugin.h
|
||||
qgspropertyoverridebuttonplugin.h
|
||||
qgsrelationeditorwidgetplugin.h
|
||||
qgsrelationreferencewidgetplugin.h
|
||||
qgsscalerangewidgetplugin.h
|
||||
@ -69,7 +69,6 @@ SET(QGIS_CUSTOMWIDGETS_HDRS
|
||||
qgscollapsiblegroupboxplugin.h
|
||||
qgscolorbuttonplugin.h
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsdockwidgetplugin.h
|
||||
qgsdoublespinboxplugin.h
|
||||
qgsexpressionbuilderwidgetplugin.h
|
||||
@ -81,6 +80,7 @@ SET(QGIS_CUSTOMWIDGETS_HDRS
|
||||
qgsfilterlineeditplugin.h
|
||||
qgsmaplayercomboboxplugin.h
|
||||
qgsprojectionselectionwidgetplugin.h
|
||||
qgspropertyoverridebuttonplugin.h
|
||||
qgsrelationeditorwidgetplugin.h
|
||||
qgsrelationreferencewidgetplugin.h
|
||||
qgsscalerangewidgetplugin.h
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "qgiscustomwidgets.h"
|
||||
#include "qgscollapsiblegroupboxplugin.h"
|
||||
#include "qgscolorbuttonplugin.h"
|
||||
#include "qgsdatadefinedbuttonplugin.h"
|
||||
#include "qgsdatetimeeditplugin.h"
|
||||
#include "qgsdockwidgetplugin.h"
|
||||
#include "qgsdoublespinboxplugin.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "qgsfilterlineeditplugin.h"
|
||||
#include "qgsmaplayercomboboxplugin.h"
|
||||
#include "qgsprojectionselectionwidgetplugin.h"
|
||||
#include "qgspropertyoverridebuttonplugin.h"
|
||||
#include "qgsrelationeditorwidgetplugin.h"
|
||||
#include "qgsrelationreferencewidgetplugin.h"
|
||||
#include "qgsscalerangewidgetplugin.h"
|
||||
@ -42,7 +42,6 @@ QgisCustomWidgets::QgisCustomWidgets( QObject *parent )
|
||||
{
|
||||
mWidgets.append( new QgsCollapsibleGroupBoxPlugin( this ) );
|
||||
mWidgets.append( new QgsColorButtonPlugin( this ) );
|
||||
mWidgets.append( new QgsDataDefinedButtonPlugin( this ) );
|
||||
mWidgets.append( new QgsDateTimeEditPlugin( this ) );
|
||||
mWidgets.append( new QgsDockWidgetPlugin( this ) );
|
||||
mWidgets.append( new QgsDoubleSpinBoxPlugin( this ) );
|
||||
@ -54,6 +53,7 @@ QgisCustomWidgets::QgisCustomWidgets( QObject *parent )
|
||||
mWidgets.append( new QgsFilterLineEditPlugin( this ) );
|
||||
mWidgets.append( new QgsMapLayerComboBoxPlugin( this ) );
|
||||
mWidgets.append( new QgsProjectionSelectionWidgetPlugin( this ) );
|
||||
mWidgets.append( new QgsPropertyOverrideButtonPlugin( this ) );
|
||||
mWidgets.append( new QgsRelationEditorWidgetPlugin( this ) );
|
||||
mWidgets.append( new QgsRelationReferenceWidgetPlugin( this ) );
|
||||
mWidgets.append( new QgsScaleRangeWidgetPlugin( this ) );
|
||||
|
@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
qgsdatadefinedbuttonplugin.cpp
|
||||
--------------------------------------
|
||||
qgspropertyoverridebuttonplugin.cpp
|
||||
----------------------------------
|
||||
Date : 25.04.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.com
|
||||
@ -14,53 +14,53 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgiscustomwidgets.h"
|
||||
#include "qgsdatadefinedbuttonplugin.h"
|
||||
#include "qgsdatadefinedbutton.h"
|
||||
#include "qgspropertyoverridebuttonplugin.h"
|
||||
#include "qgspropertyoverridebutton.h"
|
||||
|
||||
|
||||
QgsDataDefinedButtonPlugin::QgsDataDefinedButtonPlugin( QObject *parent )
|
||||
QgsPropertyOverrideButtonPlugin::QgsPropertyOverrideButtonPlugin( QObject *parent )
|
||||
: QObject( parent )
|
||||
, mInitialized( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::name() const
|
||||
QString QgsPropertyOverrideButtonPlugin::name() const
|
||||
{
|
||||
return "QgsDataDefinedButton";
|
||||
return "QgsPropertyOverrideButton";
|
||||
}
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::group() const
|
||||
QString QgsPropertyOverrideButtonPlugin::group() const
|
||||
{
|
||||
return QgisCustomWidgets::groupName();
|
||||
}
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::includeFile() const
|
||||
QString QgsPropertyOverrideButtonPlugin::includeFile() const
|
||||
{
|
||||
return "qgsdatadefinedbutton.h";
|
||||
return "qgspropertyoverridebutton.h";
|
||||
}
|
||||
|
||||
QIcon QgsDataDefinedButtonPlugin::icon() const
|
||||
QIcon QgsPropertyOverrideButtonPlugin::icon() const
|
||||
{
|
||||
return QIcon( ":/images/icons/qgis-icon-60x60.png" );
|
||||
}
|
||||
|
||||
bool QgsDataDefinedButtonPlugin::isContainer() const
|
||||
bool QgsPropertyOverrideButtonPlugin::isContainer() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QWidget *QgsDataDefinedButtonPlugin::createWidget( QWidget *parent )
|
||||
QWidget *QgsPropertyOverrideButtonPlugin::createWidget( QWidget *parent )
|
||||
{
|
||||
return new QgsDataDefinedButton( parent );
|
||||
return new QgsPropertyOverrideButton( parent );
|
||||
}
|
||||
|
||||
bool QgsDataDefinedButtonPlugin::isInitialized() const
|
||||
bool QgsPropertyOverrideButtonPlugin::isInitialized() const
|
||||
{
|
||||
return mInitialized;
|
||||
}
|
||||
|
||||
void QgsDataDefinedButtonPlugin::initialize( QDesignerFormEditorInterface *core )
|
||||
void QgsPropertyOverrideButtonPlugin::initialize( QDesignerFormEditorInterface *core )
|
||||
{
|
||||
Q_UNUSED( core );
|
||||
if ( mInitialized )
|
||||
@ -69,20 +69,20 @@ void QgsDataDefinedButtonPlugin::initialize( QDesignerFormEditorInterface *core
|
||||
}
|
||||
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::toolTip() const
|
||||
QString QgsPropertyOverrideButtonPlugin::toolTip() const
|
||||
{
|
||||
return tr( "A widget to define the scale range" );
|
||||
return tr( "A widget to define override for a corresponding property" );
|
||||
}
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::whatsThis() const
|
||||
QString QgsPropertyOverrideButtonPlugin::whatsThis() const
|
||||
{
|
||||
return tr( "A widget to define the scale range." );
|
||||
return tr( "A widget to define override for a corresponding property." );
|
||||
}
|
||||
|
||||
QString QgsDataDefinedButtonPlugin::domXml() const
|
||||
QString QgsPropertyOverrideButtonPlugin::domXml() const
|
||||
{
|
||||
return QString( "<ui language=\"c++\">\n"
|
||||
" <widget class=\"%1\" name=\"mDataDefinedButton\">\n"
|
||||
" <widget class=\"%1\" name=\"mPropertyOverrideButton\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
--------------------------------------
|
||||
qgspropertyoverridebuttonplugin.h
|
||||
--------------------------------
|
||||
Date : 25.04.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.com
|
||||
@ -13,8 +13,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSDATADEFINEDBUTTONPLUGIN_H
|
||||
#define QGSDATADEFINEDBUTTONPLUGIN_H
|
||||
#ifndef QGSPROPERTYOVERRIDEBUTTONPLUGIN_H
|
||||
#define QGSPROPERTYOVERRIDEBUTTONPLUGIN_H
|
||||
|
||||
|
||||
#include <QtGlobal>
|
||||
@ -23,13 +23,13 @@
|
||||
#include "qgis_customwidgets.h"
|
||||
|
||||
|
||||
class CUSTOMWIDGETS_EXPORT QgsDataDefinedButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
|
||||
class CUSTOMWIDGETS_EXPORT QgsPropertyOverrideButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( QDesignerCustomWidgetInterface )
|
||||
|
||||
public:
|
||||
explicit QgsDataDefinedButtonPlugin( QObject *parent = 0 );
|
||||
explicit QgsPropertyOverrideButtonPlugin( QObject *parent = 0 );
|
||||
|
||||
private:
|
||||
bool mInitialized;
|
||||
@ -48,4 +48,4 @@ class CUSTOMWIDGETS_EXPORT QgsDataDefinedButtonPlugin : public QObject, public Q
|
||||
QString whatsThis() const override;
|
||||
QString domXml() const override;
|
||||
};
|
||||
#endif // QGSDATADEFINEDBUTTONPLUGIN_H
|
||||
#endif // QGSPROPERTYOVERRIDEBUTTONPLUGIN_H
|
Loading…
x
Reference in New Issue
Block a user