diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index c026516303ce..797a42806df9 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -2,7 +2,6 @@ SET(QGIS_APP_SRCS qgisapp.cpp qgisappinterface.cpp qgisappstylesheet.cpp - qgsabout.cpp qgsapplayertreeviewmenuprovider.cpp qgssponsors.cpp qgsaddattrdialog.cpp @@ -31,7 +30,6 @@ SET(QGIS_APP_SRCS qgsdecorationgriddialog.cpp qgsdxfexportdialog.cpp qgsformannotationdialog.cpp - qgshtmlannotationdialog.cpp qgsdelattrdialog.cpp qgsdiagramproperties.cpp qgsdisplayangle.cpp @@ -62,7 +60,6 @@ SET(QGIS_APP_SRCS qgsmaptooledit.cpp qgsmaptoolfeatureaction.cpp qgsmaptoolformannotation.cpp - qgsmaptoolhtmlannotation.cpp qgsmaptoolpinlabels.cpp qgsmaptoolshowhidelabels.cpp qgsmaptoolidentifyaction.cpp @@ -119,7 +116,6 @@ SET(QGIS_APP_SRCS composer/qgscomposer.cpp composer/qgscomposerarrowwidget.cpp composer/qgscomposerattributetablewidget.cpp - composer/qgscomposerhtmlwidget.cpp composer/qgscomposeritemwidget.cpp composer/qgscomposerlabelwidget.cpp composer/qgscomposerpicturewidget.cpp @@ -157,11 +153,19 @@ SET(QGIS_APP_SRCS qgsnewspatialitelayerdialog.cpp ) +IF (WITH_QTWEBKIT) + SET(QGIS_APP_SRCS ${QGIS_APP_SRCS} + qgsabout.cpp + qgshtmlannotationdialog.cpp + qgsmaptoolhtmlannotation.cpp + composer/qgscomposerhtmlwidget.cpp + ) +ENDIF (WITH_QTWEBKIT) + SET (QGIS_APP_MOC_HDRS qgisapp.h qgisappinterface.h qgisappstylesheet.h - qgsabout.h qgsaddattrdialog.h qgsaddjoindialog.h qgsaddtaborgroup.h @@ -193,7 +197,6 @@ SET (QGIS_APP_MOC_HDRS qgsfieldcalculator.h qgsfieldsproperties.h qgsformannotationdialog.h - qgshtmlannotationdialog.h qgsidentifyresultsdialog.h qgslabeldialog.h qgslabelengineconfigdialog.h @@ -261,7 +264,6 @@ SET (QGIS_APP_MOC_HDRS composer/qgscomposer.h composer/qgscomposerarrowwidget.h composer/qgscomposerattributetablewidget.h - composer/qgscomposerhtmlwidget.h composer/qgscomposeritemwidget.h composer/qgscomposerlabelwidget.h composer/qgscomposerlegendwidget.h @@ -292,7 +294,15 @@ SET (QGIS_APP_MOC_HDRS pluginmanager/qgspluginitemdelegate.h qgsnewspatialitelayerdialog.h +) + +IF (WITH_QTWEBKIT) + SET( QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS} + qgsabout.h + qgshtmlannotationdialog.h + composer/qgscomposerhtmlwidget.h ) +ENDIF (WITH_QTWEBKIT) SET (WITH_QWTPOLAR TRUE CACHE BOOL "Determines whether QwtPolar should be built") diff --git a/src/app/composer/qgscomposer.cpp b/src/app/composer/qgscomposer.cpp index d413498d2764..ccb51db650d4 100644 --- a/src/app/composer/qgscomposer.cpp +++ b/src/app/composer/qgscomposer.cpp @@ -31,8 +31,10 @@ #include "qgscomposerarrowwidget.h" #include "qgscomposerattributetablewidget.h" #include "qgscomposerframe.h" -#include "qgscomposerhtml.h" -#include "qgscomposerhtmlwidget.h" +#ifdef WITH_QTWEBKIT + #include "qgscomposerhtml.h" + #include "qgscomposerhtmlwidget.h" +#endif #include "qgscomposerlabel.h" #include "qgscomposerlabelwidget.h" #include "qgscomposerlegend.h" @@ -736,7 +738,9 @@ void QgsComposer::connectCompositionSlots() connect( mComposition, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) ); connect( mComposition, SIGNAL( composerArrowAdded( QgsComposerArrow* ) ), this, SLOT( addComposerArrow( QgsComposerArrow* ) ) ); +#ifdef WITH_QTWEBKIT connect( mComposition, SIGNAL( composerHtmlFrameAdded( QgsComposerHtml*, QgsComposerFrame* ) ), this, SLOT( addComposerHtmlFrame( QgsComposerHtml*, QgsComposerFrame* ) ) ); +#endif connect( mComposition, SIGNAL( composerLabelAdded( QgsComposerLabel* ) ), this, SLOT( addComposerLabel( QgsComposerLabel* ) ) ); connect( mComposition, SIGNAL( composerMapAdded( QgsComposerMap* ) ), this, SLOT( addComposerMap( QgsComposerMap* ) ) ); connect( mComposition, SIGNAL( composerScaleBarAdded( QgsComposerScaleBar* ) ), this, SLOT( addComposerScaleBar( QgsComposerScaleBar* ) ) ); @@ -3365,7 +3369,7 @@ void QgsComposer::addComposerTableV2( QgsComposerAttributeTableV2 *table, QgsCom QgsComposerAttributeTableWidget* tWidget = new QgsComposerAttributeTableWidget( table, frame ); mItemWidgetMap.insert( frame, tWidget ); } - +#ifdef WITH_QTWEBKIT void QgsComposer::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame ) { if ( !html ) @@ -3376,7 +3380,7 @@ void QgsComposer::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* QgsComposerHtmlWidget* hWidget = new QgsComposerHtmlWidget( html, frame ); mItemWidgetMap.insert( frame, hWidget ); } - +#endif void QgsComposer::deleteItem( QgsComposerItem* item ) { QMap::iterator it = mItemWidgetMap.find( item ); diff --git a/src/app/composer/qgscomposer.h b/src/app/composer/qgscomposer.h index b26a49c37d81..713921b488e8 100644 --- a/src/app/composer/qgscomposer.h +++ b/src/app/composer/qgscomposer.h @@ -395,8 +395,10 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase /**Adds a composer table v2 to the item/widget map and creates a configuration widget*/ void addComposerTableV2( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame ); +#ifdef WITH_QTWEBKIT /**Adds composer html and creates a configuration widget*/ void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame ); +#endif /**Removes item from the item/widget map and deletes the configuration widget. Does not delete the item itself*/ void deleteItem( QgsComposerItem* item ); diff --git a/src/app/pluginmanager/qgspluginmanager.cpp b/src/app/pluginmanager/qgspluginmanager.cpp index 6c0a9602ad61..4b724065e275 100644 --- a/src/app/pluginmanager/qgspluginmanager.cpp +++ b/src/app/pluginmanager/qgspluginmanager.cpp @@ -30,7 +30,9 @@ #include #include #include -#include +#ifdef WITH_QTWEBKIT + #include +#endif #include #include "qgis.h" @@ -97,7 +99,10 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, bool pluginsAreEnabled, Qt // Preset widgets leFilter->setFocus( Qt::MouseFocusReason ); + +#ifdef WITH_QTWEBKIT wvDetails->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks ); +#endif // Don't restore the last used tab from QSettings mOptionsListWidget->setCurrentRow( 0 ); @@ -473,7 +478,7 @@ void QgsPluginManager::reloadModelData() if ( !mCurrentlyDisplayedPlugin.isEmpty() ) { - wvDetails->setHtml( "" ); + wvDetails->setText( "" ); buttonInstall->setEnabled( false ); buttonUninstall->setEnabled( false ); } @@ -839,7 +844,7 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item ) html += ""; - wvDetails->setHtml( html ); + wvDetails->setText( html ); // Set buttonInstall text (and sometimes focus) buttonInstall->setDefault( false ); @@ -1084,7 +1089,7 @@ void QgsPluginManager::setCurrentTab( int idx ) // tabInfoHTML += ""; tabInfoHTML += it.value(); } - wvDetails->setHtml( tabInfoHTML ); + wvDetails->setText( tabInfoHTML ); // disable buttons buttonInstall->setEnabled( false ); @@ -1151,7 +1156,7 @@ void QgsPluginManager::on_vwPlugins_doubleClicked( const QModelIndex & theIndex } - +#ifdef WITH_QTWEBKIT void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url ) { if ( url.scheme() == "rpc2" ) @@ -1178,7 +1183,7 @@ void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url ) QDesktopServices::openUrl( url ); } } - +#endif void QgsPluginManager::on_leFilter_textChanged( QString theText ) diff --git a/src/app/pluginmanager/qgspluginmanager.h b/src/app/pluginmanager/qgspluginmanager.h index e0619ae72eea..3c2bfefc83e7 100644 --- a/src/app/pluginmanager/qgspluginmanager.h +++ b/src/app/pluginmanager/qgspluginmanager.h @@ -116,8 +116,10 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag //! Load/unload plugin by double click void on_vwPlugins_doubleClicked( const QModelIndex & index ); +#ifdef WITH_QTWEBKIT //! Handle click in the web wiew void on_wvDetails_linkClicked( const QUrl & url ); +#endif //! Update the filter when user changes the filter expression void on_leFilter_textChanged( QString theText ); diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index b69e4f8017b8..815449fabb5c 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -99,7 +99,9 @@ #include "qgisappstylesheet.h" #include "qgis.h" #include "qgisplugin.h" -#include "qgsabout.h" +#ifdef WITH_QTWEBKIT + #include "qgsabout.h" +#endif #include "qgsapplayertreeviewmenuprovider.h" #include "qgsapplication.h" #include "qgsattributeaction.h" @@ -1293,7 +1295,9 @@ void QgisApp::createActions() connect( mActionNeedSupport, SIGNAL( triggered() ), this, SLOT( supportProviders() ) ); connect( mActionQgisHomePage, SIGNAL( triggered() ), this, SLOT( helpQgisHomePage() ) ); connect( mActionCheckQgisVersion, SIGNAL( triggered() ), this, SLOT( checkQgisVersion() ) ); +#ifdef WITH_QTWEBKIT connect( mActionAbout, SIGNAL( triggered() ), this, SLOT( about() ) ); +#endif connect( mActionSponsors, SIGNAL( triggered() ), this, SLOT( sponsors() ) ); connect( mActionShowPinnedLabels, SIGNAL( toggled( bool ) ), this, SLOT( showPinnedLabels( bool ) ) ); @@ -1979,7 +1983,9 @@ void QgisApp::setTheme( QString theThemeName ) mActionDecreaseContrast->setIcon( QgsApplication::getThemeIcon( "/mActionDecreaseContrast.svg" ) ); mActionZoomActualSize->setIcon( QgsApplication::getThemeIcon( "/mActionZoomNative.png" ) ); mActionQgisHomePage->setIcon( QgsApplication::getThemeIcon( "/mActionQgisHomePage.png" ) ); +#ifdef WITH_QTWEBKIT mActionAbout->setIcon( QgsApplication::getThemeIcon( "/mActionHelpAbout.png" ) ); +#endif mActionSponsors->setIcon( QgsApplication::getThemeIcon( "/mActionHelpSponsors.png" ) ); mActionDraw->setIcon( QgsApplication::getThemeIcon( "/mActionDraw.svg" ) ); mActionToggleEditing->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.svg" ) ); @@ -2212,8 +2218,10 @@ void QgisApp::createCanvasTools() mMapTools.mTextAnnotation->setAction( mActionTextAnnotation ); mMapTools.mFormAnnotation = new QgsMapToolFormAnnotation( mMapCanvas ); mMapTools.mFormAnnotation->setAction( mActionFormAnnotation ); +#ifdef WITH_QTWEBKIT mMapTools.mHtmlAnnotation = new QgsMapToolHtmlAnnotation( mMapCanvas ); mMapTools.mHtmlAnnotation->setAction( mActionHtmlAnnotation ); +#endif mMapTools.mSvgAnnotation = new QgsMapToolSvgAnnotation( mMapCanvas ); mMapTools.mSvgAnnotation->setAction( mActionSvgAnnotation ); mMapTools.mAnnotation = new QgsMapToolAnnotation( mMapCanvas ); @@ -2724,6 +2732,7 @@ void QgisApp::sponsors() sponsors->activateWindow(); } +#ifdef WITH_QTWEBKIT void QgisApp::about() { static QgsAbout *abt = NULL; @@ -2789,6 +2798,7 @@ void QgisApp::about() abt->raise(); abt->activateWindow(); } +#endif void QgisApp::addLayerDefinition() { @@ -5715,13 +5725,14 @@ bool QgisApp::loadAnnotationItemsFromProject( const QDomDocument& doc ) QgsFormAnnotationItem* newFormItem = new QgsFormAnnotationItem( mMapCanvas ); newFormItem->readXML( doc, formItemList.at( i ).toElement() ); } - +#ifdef WITH_QTWEBKIT QDomNodeList htmlItemList = doc.elementsByTagName( "HtmlAnnotationItem" ); for ( int i = 0; i < htmlItemList.size(); ++i ) { QgsHtmlAnnotationItem* newHtmlItem = new QgsHtmlAnnotationItem( mMapCanvas ); newHtmlItem->readXML( doc, htmlItemList.at( i ).toElement() ); } +#endif QDomNodeList svgItemList = doc.elementsByTagName( "SVGAnnotationItem" ); for ( int i = 0; i < svgItemList.size(); ++i ) diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 8815efde4b46..78be94bba082 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -380,6 +380,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow QAction *actionHelpAPI() { return mActionHelpAPI; } QAction *actionQgisHomePage() { return mActionQgisHomePage; } QAction *actionCheckQgisVersion() { return mActionCheckQgisVersion; } + QAction *actionAbout() { return mActionAbout; } QAction *actionSponsors() { return mActionSponsors; } @@ -666,8 +667,11 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow //! QGis Sponsors void sponsors(); + +#ifdef WITH_QTWEBKIT //! About QGis void about(); +#endif //! Add a raster layer to the map (will prompt user for file name using dlg ) void addRasterLayer(); //#ifdef HAVE_POSTGRESQL diff --git a/src/app/qgsidentifyresultsdialog.cpp b/src/app/qgsidentifyresultsdialog.cpp index 5f45b49ff14a..bce4bd3f00cf 100644 --- a/src/app/qgsidentifyresultsdialog.cpp +++ b/src/app/qgsidentifyresultsdialog.cpp @@ -45,13 +45,14 @@ #include #include #include -#include #include #include #include #include #include -#include +#ifdef WITH_QTWEBKIT + #include +#endif //graph #include @@ -60,6 +61,7 @@ #include #include "qgsvectorcolorrampv2.h" // for random colors +#ifdef WITH_QTWEBKIT QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QWebView( parent ) { @@ -186,14 +188,6 @@ QSize QgsIdentifyResultsWebView::sizeHint() const return s; } -QgsIdentifyResultsFeatureItem::QgsIdentifyResultsFeatureItem( const QgsFields &fields, const QgsFeature &feature, const QgsCoordinateReferenceSystem &crs, const QStringList & strings ) - : QTreeWidgetItem( strings ) - , mFields( fields ) - , mFeature( feature ) - , mCrs( crs ) -{ -} - void QgsIdentifyResultsWebViewItem::setHtml( const QString &html ) { mWebView->setHtml( html ); @@ -227,6 +221,16 @@ void QgsIdentifyResultsWebViewItem::loadFinished( bool ok ) } +#endif + +QgsIdentifyResultsFeatureItem::QgsIdentifyResultsFeatureItem( const QgsFields &fields, const QgsFeature &feature, const QgsCoordinateReferenceSystem &crs, const QStringList & strings ) + : QTreeWidgetItem( strings ) + , mFields( fields ) + , mFeature( feature ) + , mCrs( crs ) +{ +} + // Tree hierarchy // // layer [userrole: QgsMapLayer] @@ -735,6 +739,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer, } } +#ifdef WITH_QTWEBKIT if ( currentFormat == QgsRaster::IdentifyFormatHtml || currentFormat == QgsRaster::IdentifyFormatText ) { QgsIdentifyResultsWebViewItem *attrItem = new QgsIdentifyResultsWebViewItem( lstResults ); @@ -749,6 +754,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer, } } else +#endif { for ( QMap::const_iterator it = attributes.begin(); it != attributes.end(); ++it ) { @@ -1320,6 +1326,8 @@ void QgsIdentifyResultsDialog::handleCurrentItemChanged( QTreeWidgetItem *curren return; } + +#ifdef WITH_QTWEBKIT // An item may be printed if a child is QgsIdentifyResultsWebViewItem for ( int i = 0; i < current->childCount(); i++ ) { @@ -1330,6 +1338,7 @@ void QgsIdentifyResultsDialog::handleCurrentItemChanged( QTreeWidgetItem *curren break; } } +#endif QTreeWidgetItem *layItem = layerItem( current ); if ( current == layItem ) @@ -1724,7 +1733,7 @@ void QgsIdentifyResultsDialog::printCurrentItem() QTreeWidgetItem *item = lstResults->currentItem(); if ( !item ) return; - +#ifdef WITH_QTWEBKIT // There should only be one HTML item / result QgsIdentifyResultsWebViewItem *wv = 0; for ( int i = 0; i < item->childCount() && !wv; i++ ) @@ -1739,6 +1748,7 @@ void QgsIdentifyResultsDialog::printCurrentItem() } wv->webView()->print(); +#endif } void QgsIdentifyResultsDialog::on_cmbIdentifyMode_currentIndexChanged( int index ) diff --git a/src/app/qgsidentifyresultsdialog.h b/src/app/qgsidentifyresultsdialog.h index eee9d1e04a77..9937fea45583 100644 --- a/src/app/qgsidentifyresultsdialog.h +++ b/src/app/qgsidentifyresultsdialog.h @@ -30,7 +30,9 @@ #include #include -#include +#ifdef WITH_QTWEBKIT + #include +#endif class QCloseEvent; class QTreeWidgetItem; @@ -49,6 +51,7 @@ class QwtPlotCurve; *@author Gary E.Sherman */ +#ifdef WITH_QTWEBKIT class APP_EXPORT QgsIdentifyResultsWebView : public QWebView { Q_OBJECT @@ -62,20 +65,6 @@ class APP_EXPORT QgsIdentifyResultsWebView : public QWebView QWebView *createWindow( QWebPage::WebWindowType type ) override; }; -class APP_EXPORT QgsIdentifyResultsFeatureItem: public QTreeWidgetItem -{ - public: - QgsIdentifyResultsFeatureItem( const QgsFields &fields, const QgsFeature &feature, const QgsCoordinateReferenceSystem &crs, const QStringList & strings = QStringList() ); - const QgsFields &fields() const { return mFields; } - const QgsFeature &feature() const { return mFeature; } - const QgsCoordinateReferenceSystem &crs() { return mCrs; } - - private: - QgsFields mFields; - QgsFeature mFeature; - QgsCoordinateReferenceSystem mCrs; -}; - class APP_EXPORT QgsIdentifyResultsWebViewItem: public QObject, public QTreeWidgetItem { Q_OBJECT @@ -94,6 +83,22 @@ class APP_EXPORT QgsIdentifyResultsWebViewItem: public QObject, public QTreeWidg QgsIdentifyResultsWebView *mWebView; }; +#endif + +class APP_EXPORT QgsIdentifyResultsFeatureItem: public QTreeWidgetItem +{ + public: + QgsIdentifyResultsFeatureItem( const QgsFields &fields, const QgsFeature &feature, const QgsCoordinateReferenceSystem &crs, const QStringList & strings = QStringList() ); + const QgsFields &fields() const { return mFields; } + const QgsFeature &feature() const { return mFeature; } + const QgsCoordinateReferenceSystem &crs() { return mCrs; } + + private: + QgsFields mFields; + QgsFeature mFeature; + QgsCoordinateReferenceSystem mCrs; +}; + class APP_EXPORT QgsIdentifyPlotCurve { public: @@ -107,6 +112,7 @@ class APP_EXPORT QgsIdentifyPlotCurve QwtPlotCurve* mPlotCurve; }; + class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdentifyResultsBase { Q_OBJECT diff --git a/src/app/qgsmaptoolannotation.cpp b/src/app/qgsmaptoolannotation.cpp index 600b3689a61e..5425dbb85d57 100644 --- a/src/app/qgsmaptoolannotation.cpp +++ b/src/app/qgsmaptoolannotation.cpp @@ -18,8 +18,10 @@ #include "qgsmaptoolannotation.h" #include "qgsformannotationdialog.h" #include "qgsformannotationitem.h" +#ifdef WITH_QTWEBKIT #include "qgshtmlannotationitem.h" #include "qgshtmlannotationdialog.h" +#endif #include "qgslogger.h" #include "qgsmapcanvas.h" #include "qgstextannotationdialog.h" @@ -65,12 +67,13 @@ QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem *item ) { return new QgsFormAnnotationDialog( fItem ); } - +#ifdef WITH_QTWEBKIT QgsHtmlAnnotationItem* hItem = dynamic_cast( item ); if ( hItem ) { return new QgsHtmlAnnotationDialog( hItem ); } +#endif QgsSvgAnnotationItem* sItem = dynamic_cast( item ); if ( sItem ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 55a1fce8bc06..8eeacce69edd 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -213,7 +213,6 @@ SET(QGIS_CORE_SRCS composer/qgsnumericscalebarstyle.cpp composer/qgssingleboxscalebarstyle.cpp composer/qgsticksscalebarstyle.cpp - composer/qgscomposerhtml.cpp composer/qgscomposermultiframe.cpp composer/qgscomposermodel.cpp composer/qgscomposition.cpp @@ -278,6 +277,13 @@ SET(QGIS_CORE_SRCS raster/qgshuesaturationfilter.cpp ) +IF (WITH_QTWEBKIT) + SET(QGIS_CORE_SRCS + ${QGIS_CORE_SRCS} + composer/qgscomposerhtml.cpp + ) +ENDIF (WITH_QTWEBKIT) + IF(ENABLE_MODELTEST) SET(MODELTEST_SRCS ../../tests/qt_modeltest/modeltest.cpp @@ -397,7 +403,6 @@ SET(QGIS_CORE_MOC_HDRS composer/qgscomposertable.h composer/qgscomposertablev2.h composer/qgscomposertablecolumn.h - composer/qgscomposerhtml.h composer/qgscomposermultiframe.h composer/qgscomposereffect.h composer/qgsatlascomposition.h @@ -425,6 +430,13 @@ SET(QGIS_CORE_MOC_HDRS layertree/qgslayertreeregistrybridge.h ) +IF (WITH_QTWEBKIT) + SET(QGIS_CORE_MOC_HDRS + ${QGIS_CORE_MOC_HDRS} + composer/qgscomposerhtml.h + ) +ENDIF (WITH_QTWEBKIT) + IF (NOT QT5_BUILD) SET(QGIS_CORE_MOC_HDRS ${QGIS_CORE_MOC_HDRS} qgshttptransaction.h @@ -641,7 +653,20 @@ SET(QGIS_CORE_HDRS layertree/qgslayertreeutils.h ) -IF (QT_MOBILITY_LOCATION_FOUND) +IF (WITH_QTWEBKIT) + SET(QGIS_CORE_HDRS + ${QGIS_CORE_HDRS} + composer/qgscomposerhtml.h + ) +ENDIF (WITH_QTWEBKIT) + +IF (NOT QT5_BUILD) + SET(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} + qgshttptransaction.h + ) +ENDIF (NOT QT5_BUILD) + +IF (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND) SET(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} gps/qgsgpsconnectionregistry.h ) diff --git a/src/core/composer/qgscomposerlabel.cpp b/src/core/composer/qgscomposerlabel.cpp index cc1cbe00b8b0..899af2a247cf 100644 --- a/src/core/composer/qgscomposerlabel.cpp +++ b/src/core/composer/qgscomposerlabel.cpp @@ -30,10 +30,13 @@ #include #include #include -#include -#include #include +#ifdef WITH_QTWEBKIT + #include + #include +#endif + QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ) : QgsComposerItem( composition ) , mHtmlState( 0 ) @@ -111,6 +114,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* QString textToDraw = displayText(); +#ifdef WITH_QTWEBKIT if ( mHtmlState ) { painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 ); @@ -167,6 +171,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* webPage->mainFrame()->render( painter );//DELETE WEBPAGE ? } else +#endif { painter->setFont( mFont ); //debug diff --git a/src/core/composer/qgscomposition.cpp b/src/core/composer/qgscomposition.cpp index c3dda8bddd4e..aae2fdcfdfe3 100644 --- a/src/core/composer/qgscomposition.cpp +++ b/src/core/composer/qgscomposition.cpp @@ -18,7 +18,9 @@ #include "qgscomposerutils.h" #include "qgscomposerarrow.h" #include "qgscomposerframe.h" -#include "qgscomposerhtml.h" +#ifdef WITH_QTWEBKIT + #include "qgscomposerhtml.h" +#endif #include "qgscomposerlabel.h" #include "qgscomposerlegend.h" #include "qgscomposermap.h" @@ -632,6 +634,7 @@ const QgsComposerMap* QgsComposition::getComposerMapById( const int id ) const return 0; } +#ifdef WITH_QTWEBKIT const QgsComposerHtml* QgsComposition::getComposerHtmlByItem( QgsComposerItem *item ) const { // an html item will be a composer frame and if it is we can try to get @@ -650,6 +653,7 @@ const QgsComposerHtml* QgsComposition::getComposerHtmlByItem( QgsComposerItem *i } return 0; } +#endif const QgsComposerItem* QgsComposition::getComposerItemById( const QString theId ) const { @@ -1332,6 +1336,7 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen pushAddRemoveCommand( newTable, tr( "Table added" ) ); } } +#ifdef WITH_QTWEBKIT // html //TODO - fix this. pasting multiframe frame items has no effect QDomNodeList composerHtmlList = elem.elementsByTagName( "ComposerHtml" ); @@ -1351,6 +1356,7 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen frame->setZValue( frame->zValue() + zOrderOffset ); }*/ } +#endif QDomNodeList composerAttributeTableV2List = elem.elementsByTagName( "ComposerAttributeTableV2" ); for ( int i = 0; i < composerAttributeTableV2List.size(); ++i ) { @@ -2389,6 +2395,7 @@ void QgsComposition::addComposerTable( QgsComposerAttributeTable* table ) emit composerTableAdded( table ); } +#ifdef WITH_QTWEBKIT void QgsComposition::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame ) { addItem( frame ); @@ -2398,6 +2405,7 @@ void QgsComposition::addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFra emit composerHtmlFrameAdded( html, frame ); } +#endif void QgsComposition::addComposerTableFrame( QgsComposerAttributeTableV2 *table, QgsComposerFrame *frame ) { @@ -2569,11 +2577,13 @@ void QgsComposition::sendItemAddedSignal( QgsComposerItem* item ) { //emit composerFrameAdded( multiframe, frame, ); QgsComposerMultiFrame* mf = frame->multiFrame(); +#ifdef WITH_QTWEBKIT QgsComposerHtml* html = dynamic_cast( mf ); if ( html ) { emit composerHtmlFrameAdded( html, frame ); } +#endif QgsComposerAttributeTableV2* table = dynamic_cast( mf ); if ( table ) { diff --git a/src/core/composer/qgscomposition.h b/src/core/composer/qgscomposition.h index 8f30c4fb4849..81be2d18e8e9 100644 --- a/src/core/composer/qgscomposition.h +++ b/src/core/composer/qgscomposition.h @@ -351,12 +351,14 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene @return QgsComposerMap or 0 pointer if the composer map item does not exist*/ const QgsComposerMap* getComposerMapById( const int id ) const; +#ifdef WITH_QTWEBKIT /**Returns the composer html with specified id (a string as named in the composer user interface item properties). @param item the item. @return QgsComposerHtml pointer or 0 pointer if no such item exists. */ Q_DECL_DEPRECATED const QgsComposerHtml* getComposerHtmlByItem( QgsComposerItem *item ) const; +#endif /**Returns a composer item given its text identifier. Ids are not necessarely unique, but this function returns only one element. @@ -562,8 +564,10 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene void addComposerShape( QgsComposerShape* shape ); /**Adds a composer table to the graphics scene and advices composer to create a widget for it (through signal)*/ void addComposerTable( QgsComposerAttributeTable* table ); +#ifdef WITH_QTWEBKIT /**Adds composer html frame and advises composer to create a widget for it (through signal)*/ void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* frame ); +#endif /**Adds composer tablev2 frame and advises composer to create a widget for it (through signal)*/ void addComposerTableFrame( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame ); @@ -870,8 +874,10 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene void selectedItemChanged( QgsComposerItem* selected ); /**Is emitted when new composer arrow has been added to the view*/ void composerArrowAdded( QgsComposerArrow* arrow ); +#ifdef WITH_QTWEBKIT /**Is emitted when a new composer html has been added to the view*/ void composerHtmlFrameAdded( QgsComposerHtml* html, QgsComposerFrame* frame ); +#endif /**Is emitted when new composer label has been added to the view*/ void composerLabelAdded( QgsComposerLabel* label ); /**Is emitted when new composer map has been added to the view*/ diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index abe055cb29a8..d31033e74cd6 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -77,9 +77,6 @@ editorwidgets/qgsfilenamewidgetwrapper.cpp editorwidgets/qgsfilenamewidgetfactory.cpp editorwidgets/qgshiddenwidgetwrapper.cpp editorwidgets/qgshiddenwidgetfactory.cpp -editorwidgets/qgsphotoconfigdlg.cpp -editorwidgets/qgsphotowidgetwrapper.cpp -editorwidgets/qgsphotowidgetfactory.cpp editorwidgets/qgsrangeconfigdlg.cpp editorwidgets/qgsrangewidgetwrapper.cpp editorwidgets/qgsrangewidgetfactory.cpp @@ -103,10 +100,6 @@ editorwidgets/qgsvaluemapwidgetfactory.cpp editorwidgets/qgsvaluerelationconfigdlg.cpp editorwidgets/qgsvaluerelationwidgetwrapper.cpp editorwidgets/qgsvaluerelationwidgetfactory.cpp -editorwidgets/qgswebviewconfigdlg.cpp -editorwidgets/qgswebviewwidgetwrapper.cpp -editorwidgets/qgswebviewwidgetfactory.cpp - layertree/qgscustomlayerorderwidget.cpp layertree/qgslayertreemapcanvasbridge.cpp @@ -170,7 +163,6 @@ qgsformannotationitem.cpp qgsgenericprojectionselector.cpp qgshighlight.cpp qgsidentifymenu.cpp -qgshtmlannotationitem.cpp qgslegendinterface.cpp qgsludialog.cpp qgsmanageconnectionsdialog.cpp @@ -226,6 +218,20 @@ qgsvertexmarker.cpp qgsunitselectionwidget.cpp ) +IF (WITH_QTWEBKIT) + SET(QGIS_GUI_SRCS + ${QGIS_GUI_SRCS} + qgshtmlannotationitem.cpp + + editorwidgets/qgsphotoconfigdlg.cpp + editorwidgets/qgsphotowidgetwrapper.cpp + editorwidgets/qgsphotowidgetfactory.cpp + editorwidgets/qgswebviewconfigdlg.cpp + editorwidgets/qgswebviewwidgetwrapper.cpp + editorwidgets/qgswebviewwidgetfactory.cpp + ) +ENDIF (WITH_QTWEBKIT) + IF (WITH_TOUCH) SET(QGIS_GUI_SRCS ${QGIS_GUI_SRCS} @@ -280,7 +286,6 @@ SET(QGIS_GUI_MOC_HDRS qgsfilterlineedit.h qgsformannotationitem.h qgsgenericprojectionselector.h - qgshtmlannotationitem.h qgsidentifymenu.h qgslegendinterface.h qgslonglongvalidator.h @@ -395,8 +400,6 @@ SET(QGIS_GUI_MOC_HDRS editorwidgets/qgsenumerationwidgetwrapper.h editorwidgets/qgsfilenamewidgetwrapper.h editorwidgets/qgshiddenwidgetwrapper.h - editorwidgets/qgsphotoconfigdlg.h - editorwidgets/qgsphotowidgetwrapper.h editorwidgets/qgsrangeconfigdlg.h editorwidgets/qgsrangewidgetwrapper.h editorwidgets/qgsrelationreferenceconfigdlg.h @@ -413,8 +416,6 @@ SET(QGIS_GUI_MOC_HDRS editorwidgets/qgsvaluemapwidgetwrapper.h editorwidgets/qgsvaluerelationconfigdlg.h editorwidgets/qgsvaluerelationwidgetwrapper.h - editorwidgets/qgswebviewconfigdlg.h - editorwidgets/qgswebviewwidgetwrapper.h layertree/qgscustomlayerorderwidget.h layertree/qgslayertreemapcanvasbridge.h @@ -422,6 +423,19 @@ SET(QGIS_GUI_MOC_HDRS layertree/qgslayertreeviewdefaultactions.h ) +IF (WITH_QTWEBKIT) + SET(QGIS_GUI_MOD_HDRS + ${QGIS_GUI_MOC_HDRS} + qgshtmlannotationitem.h + + editorwidgets/qgsphotoconfigdlg.h + editorwidgets/qgsphotowidgetwrapper.h + editorwidgets/qgswebviewconfigdlg.h + editorwidgets/qgswebviewwidgetwrapper.h + ) +ENDIF (WITH_QTWEBKIT) + + QT4_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS}) IF(MSVC) @@ -468,7 +482,6 @@ SET(QGIS_GUI_HDRS editorwidgets/qgsenumerationwidgetfactory.h editorwidgets/qgsfilenamewidgetfactory.h editorwidgets/qgshiddenwidgetfactory.h - editorwidgets/qgsphotowidgetfactory.h editorwidgets/qgsrangewidgetfactory.h editorwidgets/qgsrelationreferencefactory.h editorwidgets/qgstexteditwidgetfactory.h @@ -476,11 +489,18 @@ SET(QGIS_GUI_HDRS editorwidgets/qgsuuidwidgetfactory.h editorwidgets/qgsvaluemapwidgetfactory.h editorwidgets/qgsvaluerelationwidgetfactory.h - editorwidgets/qgswebviewwidgetfactory.h raster/qgsrasterrendererwidget.h ) +IF (WITH_QTWEBKIT) + SET(QGIS_GUI_HDRS + ${QGIS_GUI_HDRS} + editorwidgets/qgsphotowidgetfactory.h + editorwidgets/qgswebviewwidgetfactory.h + ) +ENDIF (WITH_QTWEBKIT) + IF (WITH_TOUCH) SET(QGIS_GUI_HDRS ${QGIS_GUI_HDRS} diff --git a/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp b/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp index 2e4f14fdd668..455fcbd4a7af 100644 --- a/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp +++ b/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp @@ -61,8 +61,10 @@ void QgsEditorWidgetRegistry::initEditors( QgsMapCanvas *mapCanvas, QgsMessageBa reg->registerWidget( "TextEdit", new QgsTextEditWidgetFactory( tr( "Text Edit" ) ) ); reg->registerWidget( "ValueRelation", new QgsValueRelationWidgetFactory( tr( "Value Relation" ) ) ); reg->registerWidget( "UuidGenerator", new QgsUuidWidgetFactory( tr( "Uuid Generator" ) ) ); +#ifdef WITH_QTWEBKIT reg->registerWidget( "Photo", new QgsPhotoWidgetFactory( tr( "Photo" ) ) ); reg->registerWidget( "WebView", new QgsWebViewWidgetFactory( tr( "Web View" ) ) ); +#endif reg->registerWidget( "Color", new QgsColorWidgetFactory( tr( "Color" ) ) ); reg->registerWidget( "RelationReference", new QgsRelationReferenceFactory( tr( "Relation Reference" ), mapCanvas, messageBar ) ); reg->registerWidget( "DateTime", new QgsDateTimeEditFactory( tr( "Date/Time" ) ) ); diff --git a/src/gui/qgsattributeeditor.cpp b/src/gui/qgsattributeeditor.cpp index 73eb6c014da3..b85b771857c1 100644 --- a/src/gui/qgsattributeeditor.cpp +++ b/src/gui/qgsattributeeditor.cpp @@ -57,7 +57,6 @@ #include #include #include -#include #include QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value ) diff --git a/src/gui/qgscomposerview.cpp b/src/gui/qgscomposerview.cpp index 12654c5bf043..4fa616eea92b 100644 --- a/src/gui/qgscomposerview.cpp +++ b/src/gui/qgscomposerview.cpp @@ -935,6 +935,7 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e ) } else { +#ifdef WITH_QTWEBKIT QgsComposerHtml* composerHtml = new QgsComposerHtml( composition(), true ); QgsAddRemoveMultiFrameCommand* command = new QgsAddRemoveMultiFrameCommand( QgsAddRemoveMultiFrameCommand::Added, composerHtml, composition(), tr( "Html item added" ) ); @@ -945,11 +946,10 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e ) composition()->beginMultiFrameCommand( composerHtml, tr( "Html frame added" ) ); composerHtml->addFrame( frame ); composition()->endMultiFrameCommand(); - composition()->setAllUnselected(); frame->setSelected( true ); emit selectedItemChanged( frame ); - +#endif removeRubberBand(); emit actionFinished(); } diff --git a/src/helpviewer/qgshelpviewer.cpp b/src/helpviewer/qgshelpviewer.cpp index 0882f663582e..65949018c020 100644 --- a/src/helpviewer/qgshelpviewer.cpp +++ b/src/helpviewer/qgshelpviewer.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "qgshelpviewer.h" #include "qgsapplication.h" @@ -72,7 +73,7 @@ void QgsHelpViewer::showHelp( QString help ) // Set the browser text to the help contents QString myStyle = QgsApplication::reportStyleSheet(); QString helpContents = "" + help + ""; - webView->setHtml( helpContents ); + webView->setText( helpContents ); setWindowTitle( tr( "QGIS Help" ) ); #ifndef WIN32 diff --git a/src/helpviewer/qgshelpviewerbase.ui b/src/helpviewer/qgshelpviewerbase.ui index b97f836cbfe2..ae0209d7d067 100644 --- a/src/helpviewer/qgshelpviewerbase.ui +++ b/src/helpviewer/qgshelpviewerbase.ui @@ -22,15 +22,25 @@ true - + + 0 + + + 0 + + + 0 + + 0 - - - - about:blank - + + + TextLabel + + + Qt::RichText @@ -44,13 +54,6 @@ - - - QWebView - QWidget -
QtWebKit/QWebView
-
-
diff --git a/src/ui/qgspluginmanagerbase.ui b/src/ui/qgspluginmanagerbase.ui index 2f44c4d44374..e58c19807820 100644 --- a/src/ui/qgspluginmanagerbase.ui +++ b/src/ui/qgspluginmanagerbase.ui @@ -60,7 +60,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -227,7 +236,16 @@ 6 - + + 0 + + + 0 + + + 0 + + 0 @@ -366,15 +384,25 @@ QFrame::Sunken - + + 0 + + + 0 + + + 0 + + 0 - - - - about:blank - + + + TextLabel + + + Qt::RichText @@ -503,7 +531,16 @@ QFrame::Raised - + + 0 + + + 0 + + + 0 + + 0 @@ -519,8 +556,8 @@ 0 0 - 355 - 695 + 432 + 693 @@ -839,7 +876,16 @@ p, li { white-space: pre-wrap; } QFrame::Raised - + + 0 + + + 0 + + + 0 + + 0 @@ -940,11 +986,6 @@ p, li { white-space: pre-wrap; } - - QWebView - QWidget -
QtWebKit/QWebView
-
QgsCollapsibleGroupBox QGroupBox @@ -961,7 +1002,6 @@ p, li { white-space: pre-wrap; } mOptionsListWidget leFilter vwPlugins - wvDetails buttonUpgradeAll buttonUninstall buttonInstall