Skip to content

Commit a68958f

Browse files
committed
browser: register editor widgets (fixes #11529)
1 parent 51e01d6 commit a68958f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/browser/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
5959
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
6060
${CMAKE_CURRENT_SOURCE_DIR}/../gui
6161
${CMAKE_CURRENT_SOURCE_DIR}/../gui/attributetable
62+
${CMAKE_CURRENT_SOURCE_DIR}/../gui/editorwidgets
63+
${CMAKE_CURRENT_SOURCE_DIR}/../gui/editorwidgets/core
6264
${CMAKE_CURRENT_BINARY_DIR}/../ui
6365
${CMAKE_CURRENT_BINARY_DIR}
6466
${GEOS_INCLUDE_DIR}

src/browser/main.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@
2828
#include "qgsconfig.h"
2929
#include <qmainwindow.h>
3030

31+
#include "qgseditorwidgetregistry.h"
32+
#include "qgsclassificationwidgetwrapperfactory.h"
33+
#include "qgsrangewidgetfactory.h"
34+
#include "qgsuniquevaluewidgetfactory.h"
35+
#include "qgsfilenamewidgetfactory.h"
36+
#include "qgsvaluemapwidgetfactory.h"
37+
#include "qgsenumerationwidgetfactory.h"
38+
#include "qgshiddenwidgetfactory.h"
39+
#include "qgscheckboxwidgetfactory.h"
40+
#include "qgstexteditwidgetfactory.h"
41+
#include "qgsvaluerelationwidgetfactory.h"
42+
#include "qgsuuidwidgetfactory.h"
43+
#include "qgsphotowidgetfactory.h"
44+
#include "qgswebviewwidgetfactory.h"
45+
#include "qgscolorwidgetfactory.h"
46+
#include "qgsrelationreferencefactory.h"
47+
#include "qgsdatetimeeditfactory.h"
48+
3149
int main( int argc, char ** argv )
3250
{
3351
QSettings settings;
@@ -58,5 +76,23 @@ int main( int argc, char ** argv )
5876

5977
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
6078

79+
QgsEditorWidgetRegistry* editorWidgetRegistry = QgsEditorWidgetRegistry::instance();
80+
editorWidgetRegistry->registerWidget( "Classification", new QgsClassificationWidgetWrapperFactory( QObject::tr( "Classification" ) ) );
81+
editorWidgetRegistry->registerWidget( "Range", new QgsRangeWidgetFactory( QObject::tr( "Range" ) ) );
82+
editorWidgetRegistry->registerWidget( "UniqueValues", new QgsUniqueValueWidgetFactory( QObject::tr( "Unique Values" ) ) );
83+
editorWidgetRegistry->registerWidget( "FileName", new QgsFileNameWidgetFactory( QObject::tr( "File Name" ) ) );
84+
editorWidgetRegistry->registerWidget( "ValueMap", new QgsValueMapWidgetFactory( QObject::tr( "Value Map" ) ) );
85+
editorWidgetRegistry->registerWidget( "Enumeration", new QgsEnumerationWidgetFactory( QObject::tr( "Enumeration" ) ) );
86+
editorWidgetRegistry->registerWidget( "Hidden", new QgsHiddenWidgetFactory( QObject::tr( "Hidden" ) ) );
87+
editorWidgetRegistry->registerWidget( "CheckBox", new QgsCheckboxWidgetFactory( QObject::tr( "Check Box" ) ) );
88+
editorWidgetRegistry->registerWidget( "TextEdit", new QgsTextEditWidgetFactory( QObject::tr( "Text Edit" ) ) );
89+
editorWidgetRegistry->registerWidget( "ValueRelation", new QgsValueRelationWidgetFactory( QObject::tr( "Value Relation" ) ) );
90+
editorWidgetRegistry->registerWidget( "UuidGenerator", new QgsUuidWidgetFactory( QObject::tr( "Uuid Generator" ) ) );
91+
editorWidgetRegistry->registerWidget( "Photo", new QgsPhotoWidgetFactory( QObject::tr( "Photo" ) ) );
92+
editorWidgetRegistry->registerWidget( "WebView", new QgsWebViewWidgetFactory( QObject::tr( "Web View" ) ) );
93+
editorWidgetRegistry->registerWidget( "Color", new QgsColorWidgetFactory( QObject::tr( "Color" ) ) );
94+
editorWidgetRegistry->registerWidget( "RelationReference", new QgsRelationReferenceFactory( QObject::tr( "Relation Reference" ), 0, 0 ) );
95+
editorWidgetRegistry->registerWidget( "DateTime", new QgsDateTimeEditFactory( QObject::tr( "Date/Time" ) ) );
96+
6197
return a.exec();
6298
}

0 commit comments

Comments
 (0)