mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
added new QgsDateTimeEdit to custom widgets
This commit is contained in:
parent
01b290c4d4
commit
834c630f54
@ -18,6 +18,7 @@ SET (QGIS_CUSTOMWIDGETS_SRCS
|
||||
qgscollapsiblegroupboxplugin.cpp
|
||||
qgscolorbuttonplugin.cpp
|
||||
qgscolorbuttonv2plugin.cpp
|
||||
qgsdatetimeeditplugin.cpp
|
||||
qgsdatadefinedbuttonplugin.cpp
|
||||
qgsfieldcomboboxplugin.cpp
|
||||
qgsfieldexpressionwidgetplugin.cpp
|
||||
@ -32,6 +33,7 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS
|
||||
qgscollapsiblegroupboxplugin.h
|
||||
qgscolorbuttonplugin.h
|
||||
qgscolorbuttonv2plugin.h
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsfieldcomboboxplugin.h
|
||||
qgsfieldexpressionwidgetplugin.h
|
||||
@ -54,6 +56,7 @@ SET(QGIS_CUSTOMWIDGETS_HDRS
|
||||
qgscollapsiblegroupboxplugin.h
|
||||
qgscolorbuttonplugin.h
|
||||
qgscolorbuttonv2plugin.h
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsfieldcomboboxplugin.h
|
||||
qgsfieldexpressionwidgetplugin.h
|
||||
|
63
src/customwidgets/CMakeLists.txt.user
Normal file
63
src/customwidgets/CMakeLists.txt.user
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-09-01T10:16:06. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">-1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
|
||||
<value type="QByteArray">{316279e7-c793-4c38-a9aa-b021b7d95d28}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">15</value>
|
||||
</data>
|
||||
</qtcreator>
|
97
src/customwidgets/qgsdatetimeeditplugin.cpp
Normal file
97
src/customwidgets/qgsdatetimeeditplugin.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
/***************************************************************************
|
||||
qgsdatetimeeditplugin.cpp
|
||||
--------------------------------------
|
||||
Date : 01.09.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgiscustomwidgets.h"
|
||||
#include "qgsdatetimeeditplugin.h"
|
||||
#include "qgsdatetimeedit.h"
|
||||
|
||||
|
||||
QgsDateTimeEditPlugin::QgsDateTimeEditPlugin( QObject *parent )
|
||||
: QObject( parent )
|
||||
, mInitialized( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QString QgsDateTimeEditPlugin::name() const
|
||||
{
|
||||
return "QgsDateTimeEdit";
|
||||
}
|
||||
|
||||
QString QgsDateTimeEditPlugin::group() const
|
||||
{
|
||||
return QgisCustomWidgets::groupName();
|
||||
}
|
||||
|
||||
QString QgsDateTimeEditPlugin::includeFile() const
|
||||
{
|
||||
return "qgsdatetimeedit.h";
|
||||
}
|
||||
|
||||
QIcon QgsDateTimeEditPlugin::icon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
bool QgsDateTimeEditPlugin::isContainer() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QWidget *QgsDateTimeEditPlugin::createWidget( QWidget *parent )
|
||||
{
|
||||
return new QgsDateTimeEdit( parent );
|
||||
}
|
||||
|
||||
bool QgsDateTimeEditPlugin::isInitialized() const
|
||||
{
|
||||
return mInitialized;
|
||||
}
|
||||
|
||||
void QgsDateTimeEditPlugin::initialize( QDesignerFormEditorInterface *core )
|
||||
{
|
||||
Q_UNUSED( core );
|
||||
if ( mInitialized )
|
||||
return;
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
QString QgsDateTimeEditPlugin::toolTip() const
|
||||
{
|
||||
return tr( "Define date" );
|
||||
}
|
||||
|
||||
QString QgsDateTimeEditPlugin::whatsThis() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QString QgsDateTimeEditPlugin::domXml() const
|
||||
{
|
||||
return QString( "<ui language=\"c++\">\n"
|
||||
" <widget class=\"%1\" name=\"mDateTimeEdit\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>90</width>\n"
|
||||
" <height>27</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" </widget>\n"
|
||||
"</ui>\n" )
|
||||
.arg( name() );
|
||||
}
|
48
src/customwidgets/qgsdatetimeeditplugin.h
Normal file
48
src/customwidgets/qgsdatetimeeditplugin.h
Normal file
@ -0,0 +1,48 @@
|
||||
/***************************************************************************
|
||||
qgsdatetimeeditplugin.h
|
||||
--------------------------------------
|
||||
Date : 01.09.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSDATETIMEEDITPLUGIN_H
|
||||
#define QGSDATETIMEEDITPLUGIN_H
|
||||
|
||||
#include <QDesignerExportWidget>
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
|
||||
|
||||
class CUSTOMWIDGETS_EXPORT QgsDateTimeEditPlugin : public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( QDesignerCustomWidgetInterface )
|
||||
|
||||
public:
|
||||
explicit QgsDateTimeEditPlugin( QObject *parent = 0 );
|
||||
|
||||
private:
|
||||
bool mInitialized;
|
||||
|
||||
// QDesignerCustomWidgetInterface interface
|
||||
public:
|
||||
QString name() const;
|
||||
QString group() const;
|
||||
QString includeFile() const;
|
||||
QIcon icon() const;
|
||||
bool isContainer() const;
|
||||
QWidget *createWidget( QWidget *parent );
|
||||
bool isInitialized() const;
|
||||
void initialize( QDesignerFormEditorInterface *core );
|
||||
QString toolTip() const;
|
||||
QString whatsThis() const;
|
||||
QString domXml() const;
|
||||
};
|
||||
#endif // QGSDATETIMEEDITPLUGIN_H
|
Loading…
x
Reference in New Issue
Block a user