Skip to content

Commit b340f04

Browse files
authored
Remove web view widget in favor of attachment (external resource) (#4074)
* remove photo widget config * remove webview widget * Remove mention of duplicate widgets * Update api break * migrate web view widgets to attachments
1 parent f720106 commit b340f04

15 files changed

+13
-772
lines changed

doc/api_break.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ Use QgsComposerAttributeTableV2 instead.
249249
- QgsCRSCache was removed. QgsCoordinateReferenceSystem now internally uses a cache for CRS creation,
250250
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
251251
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).
252+
- QgsFileNameWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
252253
- QgsFormAnnotationItem. Use QgsFormAnnotation instead.
253254
- QgsHtmlAnnotationItem. Use QgsHtmlAnnotation instead.
254255
- QgsHttpTransaction. This class was outdated and code should be ported to native Qt or Python implementations.
@@ -264,11 +265,13 @@ should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinat
264265
- QgsMapCanvasMap. It is an internal class used by map canvas.
265266
- QgsMapLayerRegistry. Its functionality has been moved to QgsProject.
266267
- QgsMapRenderer. It has been replaced by QgsMapRendererJob with subclasses and QgsMapSettings.
268+
- QgsPhotoWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
267269
- QgsPseudoColorShader. This shader has been broken for some time and was replaced by QgsSingleBandPseudoColorRenderer.
268270
- QgsProjectBadLayerGuiHandler was removed. It was unused in QGIS code and barely useful. Implement your own QgsProjectBadLayerHandler subclass if needed.
269271
- QgsRendererV2DataDefinedMenus was removed. Use QgsDataDefinedButton instead.
270272
- QgsLegacyHelpers.
271273
- QgsProviderCountCalcEvent and QgsProviderExtentCalcEvent. These classes were unused in QGIS core and unmaintained.
274+
- QgsWebviewWidgetWrapper was removed. Use QgsExternalResourceWidgetWrapper instead.
272275
- QgsEditorWidgetConfig was removed. Use QVariantMap instead.
273276
- QgsSvgAnnotationItem. Use QgsSvgAnnotation instead.
274277
- QgsSymbologyV2Conversion was removed. Reading of renderers from pre-1.0 versions is not supported anymore.
@@ -850,6 +853,7 @@ QgsDiagramInterpolationSettings {#qgis_api_break_3_0_QgsDiagramInterpolat
850853

851854
QgsDiagramRenderer {#qgis_api_break_3_0_QgsDiagramRenderer}
852855
------------------
856+
853857
- xform, fields were no longer required and are removed.
854858
- referencedFields() no longer takes a QgsFields argument.
855859
- renderDiagram() now takes an optional data defined overrides collection argument.

src/core/qgsprojectfiletransform.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,15 @@ void QgsProjectFileTransform::transform2990()
716716
else if ( ewv2Type == QStringLiteral( "FileName" ) )
717717
{
718718
editWidgetElement.setAttribute( "type", QStringLiteral( "ExternalResource" ) );
719+
720+
editWidgetConfiguration.insert( QStringLiteral( "RelativeStorage" ), 1 );
721+
}
722+
else if ( ewv2Type == QStringLiteral( "WebView" ) )
723+
{
724+
editWidgetElement.setAttribute( "type", QStringLiteral( "ExternalResource" ) );
725+
726+
editWidgetConfiguration.insert( QStringLiteral( "DocumentViewerHeight" ), editWidgetConfiguration.value( QStringLiteral( "Height" ) ) );
727+
editWidgetConfiguration.insert( QStringLiteral( "DocumentViewerWidth" ), editWidgetConfiguration.value( QStringLiteral( "Width" ) ) );
719728
editWidgetConfiguration.insert( QStringLiteral( "RelativeStorage" ), 1 );
720729
}
721730

src/gui/CMakeLists.txt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,6 @@ SET(QGIS_GUI_SRCS
315315
qgsfiledownloader.cpp
316316
)
317317

318-
IF (WITH_QTWEBKIT)
319-
SET(QGIS_GUI_SRCS
320-
${QGIS_GUI_SRCS}
321-
editorwidgets/qgswebviewconfigdlg.cpp
322-
editorwidgets/qgswebviewwidgetfactory.cpp
323-
editorwidgets/qgswebviewwidgetwrapper.cpp
324-
)
325-
ENDIF (WITH_QTWEBKIT)
326-
327318

328319
IF (WITH_TOUCH)
329320
SET(QGIS_GUI_SRCS
@@ -614,14 +605,6 @@ SET(QGIS_GUI_MOC_HDRS
614605
layertree/qgslayertreeviewdefaultactions.h
615606
)
616607

617-
IF (WITH_QTWEBKIT)
618-
SET(QGIS_GUI_MOC_HDRS
619-
${QGIS_GUI_MOC_HDRS}
620-
editorwidgets/qgswebviewconfigdlg.h
621-
editorwidgets/qgswebviewwidgetwrapper.h
622-
)
623-
ENDIF (WITH_QTWEBKIT)
624-
625608
QT5_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS})
626609

627610
IF(MSVC)
@@ -710,13 +693,6 @@ SET(QGIS_GUI_HDRS
710693
symbology-ng/qgssymbolwidgetcontext.h
711694
)
712695

713-
IF (WITH_QTWEBKIT)
714-
SET(QGIS_GUI_HDRS
715-
${QGIS_GUI_HDRS}
716-
editorwidgets/qgswebviewwidgetfactory.h
717-
)
718-
ENDIF (WITH_QTWEBKIT)
719-
720696
IF (WITH_TOUCH)
721697
SET(QGIS_GUI_HDRS
722698
${QGIS_GUI_HDRS}

src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
#include "qgsuuidwidgetfactory.h"
4040
#include "qgsvaluemapwidgetfactory.h"
4141
#include "qgsvaluerelationwidgetfactory.h"
42-
#ifdef WITH_QTWEBKIT
43-
#include "qgswebviewwidgetfactory.h"
44-
#endif
4542

4643

4744
QgsEditorWidgetRegistry* QgsEditorWidgetRegistry::instance()
@@ -63,9 +60,6 @@ void QgsEditorWidgetRegistry::initEditors( QgsMapCanvas *mapCanvas, QgsMessageBa
6360
reg->registerWidget( QStringLiteral( "CheckBox" ), new QgsCheckboxWidgetFactory( tr( "Check Box" ) ) );
6461
reg->registerWidget( QStringLiteral( "ValueRelation" ), new QgsValueRelationWidgetFactory( tr( "Value Relation" ) ) );
6562
reg->registerWidget( QStringLiteral( "UuidGenerator" ), new QgsUuidWidgetFactory( tr( "Uuid Generator" ) ) );
66-
#ifdef WITH_QTWEBKIT
67-
reg->registerWidget( QStringLiteral( "WebView" ), new QgsWebViewWidgetFactory( tr( "Web View" ) ) );
68-
#endif
6963
reg->registerWidget( QStringLiteral( "Color" ), new QgsColorWidgetFactory( tr( "Color" ) ) );
7064
reg->registerWidget( QStringLiteral( "RelationReference" ), new QgsRelationReferenceFactory( tr( "Relation Reference" ), mapCanvas, messageBar ) );
7165
reg->registerWidget( QStringLiteral( "DateTime" ), new QgsDateTimeEditFactory( tr( "Date/Time" ) ) );
@@ -94,7 +88,6 @@ QgsEditorWidgetSetup QgsEditorWidgetRegistry::findBest( const QgsVectorLayer* vl
9488
if ( !setup.isNull() )
9589
return setup;
9690
}
97-
9891
return mAutoConf.editorWidgetSetup( vl, fieldName );
9992
}
10093

src/gui/editorwidgets/qgsphotoconfigdlg.cpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/gui/editorwidgets/qgsphotoconfigdlg.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/gui/editorwidgets/qgswebviewconfigdlg.cpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/gui/editorwidgets/qgswebviewconfigdlg.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/gui/editorwidgets/qgswebviewwidgetfactory.cpp

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/gui/editorwidgets/qgswebviewwidgetfactory.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)