diff --git a/src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.h b/src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.h index d36ef32825a9..581f6840a278 100644 --- a/src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.h +++ b/src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.h @@ -30,14 +30,15 @@ class QLineEdit; * \note not available in Python bindings */ +/** + * @brief The QgsExternalResourceWidgetWrapper class wraps a external resource widget + */ class GUI_EXPORT QgsExternalResourceWidgetWrapper : public QgsEditorWidgetWrapper { Q_OBJECT public: explicit QgsExternalResourceWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* editor = nullptr, QWidget* parent = nullptr ); - - // QgsEditorWidgetWrapper interface public: QVariant value() const override; diff --git a/src/gui/qgsexternalresourcewidget.h b/src/gui/qgsexternalresourcewidget.h index 7ced67757bdd..e6308009593f 100644 --- a/src/gui/qgsexternalresourcewidget.h +++ b/src/gui/qgsexternalresourcewidget.h @@ -30,7 +30,7 @@ class QgsPixmapLabel; /** \ingroup gui * Widget to display file path with a push button for an "open file" dialog - * It can also be used to display a picture. + * It can also be used to display a picture or a web page. **/ class GUI_EXPORT QgsExternalResourceWidget : public QWidget { @@ -49,6 +49,11 @@ class GUI_EXPORT QgsExternalResourceWidget : public QWidget Web }; + /** + * @brief QgsExternalResourceWidget creates a widget with a file picker and a document viewer + * Both part of the widget are optional. + * @see QgsFilePickerwidget + */ explicit QgsExternalResourceWidget( QWidget *parent = 0 ); /** @@ -71,16 +76,26 @@ class GUI_EXPORT QgsExternalResourceWidget : public QWidget //! setDocumentViewerContent defines the type of content to be shown. Widget will be adapated accordingly void setDocumentViewerContent( QgsExternalResourceWidget::DocumentViewerContent content ); - //! set the configuration of the document viewer + //! returns the height of the document viewer int documentViewerHeight() const; + /** + * @brief setDocumentViewerWidth set the height of the document viewer. + * @param height the height. Use 0 for automatic best display. + */ void setDocumentViewerHeight( int height ); + //! returns the width of the document viewer int documentViewerWidth() const ; + /** + * @brief setDocumentViewerWidth set the width of the document viewer. + * @param width the width. Use 0 for automatic best display. + */ void setDocumentViewerWidth( int width ); //! defines if the widget is readonly void setReadOnly( bool readOnly ); signals: + //! emitteed as soon as the current document changes void valueChanged( QString ); private slots: diff --git a/src/gui/qgsfilepickerwidget.h b/src/gui/qgsfilepickerwidget.h index 3399d1257a92..35cfe4e4e2a7 100644 --- a/src/gui/qgsfilepickerwidget.h +++ b/src/gui/qgsfilepickerwidget.h @@ -25,6 +25,9 @@ class QgsFilterLineEdit; #include +/** + * @brief The QgsFilePickerWidget class creates a widget for selecting a file or a folder. + */ class GUI_EXPORT QgsFilePickerWidget : public QWidget { Q_OBJECT @@ -37,12 +40,18 @@ class GUI_EXPORT QgsFilePickerWidget : public QWidget Q_PROPERTY( RelativeStorage relativeStorage READ relativeStorage WRITE setRelativeStorage ) public: + /** + * @brief The StorageMode enum determines if the file picker should pick files or directories + */ enum StorageMode { File, Directory }; + /** + * @brief The RelativeStorage enum determines if path is absolute, relative to the current project path or relative to a defined default path. + */ enum RelativeStorage { Absolute, @@ -50,6 +59,9 @@ class GUI_EXPORT QgsFilePickerWidget : public QWidget RelativeDefaultPath }; + /** + * @brief QgsFilePickerWidget creates a widget for selecting a file or a folder. + */ explicit QgsFilePickerWidget( QWidget *parent = 0 ); ~QgsFilePickerWidget(); @@ -81,23 +93,28 @@ class GUI_EXPORT QgsFilePickerWidget : public QWidget //! determines if the file path will be shown as a link void setUseLink( bool useLink ); - //! determines if the links shows the full path or not + //! returns if the links shows the full path or not bool fullUrl() const; + //! determines if the links shows the full path or not void setFullUrl( bool fullUrl ); - //! determinies the default root path + //! returns the default root path QString defaultRoot() const; + //! determines the default root path used as the first shown location when picking a file and used if the RelativeStorage is RelativeDefaultPath void setDefaultRoot( QString defaultRoot ); - //! determines the storage mode (i.e. file or directory) + //! returns the storage mode (i.e. file or directory) QgsFilePickerWidget::StorageMode storageMode() const; + //! determines the storage mode (i.e. file or directory) void setStorageMode( QgsFilePickerWidget::StorageMode storageMode ); - //! determines if the relative path is with respect to the project path or the default path + //! returns if the relative path is with respect to the project path or the default path QgsFilePickerWidget::RelativeStorage relativeStorage() const; + //! determines if the relative path is with respect to the project path or the default path void setRelativeStorage( QgsFilePickerWidget::RelativeStorage relativeStorage ); signals: + //! emitted as soon as the current file or directory is changed void fileChanged( QString ); private slots: