Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 13, 2016
1 parent 492f1ad commit 3ce6454
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.h
Expand Up @@ -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;
Expand Down
19 changes: 17 additions & 2 deletions src/gui/qgsexternalresourcewidget.h
Expand Up @@ -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
{
Expand All @@ -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 );

/**
Expand All @@ -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:
Expand Down
25 changes: 21 additions & 4 deletions src/gui/qgsfilepickerwidget.h
Expand Up @@ -25,6 +25,9 @@ class QgsFilterLineEdit;

#include <QWidget>

/**
* @brief The QgsFilePickerWidget class creates a widget for selecting a file or a folder.
*/
class GUI_EXPORT QgsFilePickerWidget : public QWidget
{
Q_OBJECT
Expand All @@ -37,19 +40,28 @@ 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,
RelativeProject,
RelativeDefaultPath
};

/**
* @brief QgsFilePickerWidget creates a widget for selecting a file or a folder.
*/
explicit QgsFilePickerWidget( QWidget *parent = 0 );

~QgsFilePickerWidget();
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3ce6454

Please sign in to comment.