QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsExternalResourceWidget Class Reference

Widget to display file path with a push button for an "open file" dialog It can also be used to display a picture or a web page. More...

#include <qgsexternalresourcewidget.h>

Inheritance diagram for QgsExternalResourceWidget:

Public Types

enum  DocumentViewerContent {
  NoContent , Image , Web , Audio ,
  Video
}

Signals

void valueChanged (const QString &value)
 Emitted as soon as the current document changes.

Public Member Functions

 QgsExternalResourceWidget (QWidget *parent=nullptr)
 QgsExternalResourceWidget creates a widget with a file widget and a document viewer Both part of the widget are optional.
QString defaultRoot () const
 Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath.
QVariant documentPath (QMetaType::Type type=QMetaType::Type::QString) const
 documentPath returns the path of the current document in the widget
Q_DECL_DEPRECATED QVariant documentPath (QVariant::Type type) const
 documentPath returns the path of the current document in the widget
QgsExternalResourceWidget::DocumentViewerContent documentViewerContent () const
 returns the type of content used in the document viewer
int documentViewerHeight () const
 returns the height of the document viewer
int documentViewerWidth () const
 returns the width of the document viewer
QgsExternalStorageFileWidgetfileWidget ()
 Returns file widget to allow its configuration.
bool fileWidgetVisible () const
 returns if the file widget is visible in the widget
QgsMessageBarmessageBar () const
 Returns message bar used to report messages.
QgsFileWidget::RelativeStorage relativeStorage () const
 Configures if paths are handled absolute or relative and if relative, which should be the base path.
void setDefaultRoot (const QString &defaultRoot)
 Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath.
void setDocumentPath (const QVariant &documentPath)
void setDocumentViewerContent (QgsExternalResourceWidget::DocumentViewerContent content)
 setDocumentViewerContent defines the type of content to be shown. Widget will be adapted accordingly
void setDocumentViewerHeight (int height)
 setDocumentViewerWidth set the height of the document viewer.
void setDocumentViewerWidth (int width)
 setDocumentViewerWidth set the width of the document viewer.
void setFileWidgetVisible (bool visible)
 Sets the visibility of the file widget in the layout.
void setMessageBar (QgsMessageBar *messageBar)
 Set messageBar to report messages.
void setReadOnly (bool readOnly)
 defines if the widget is readonly
void setRelativeStorage (QgsFileWidget::RelativeStorage relativeStorage)
 Configures if paths are handled absolute or relative and if relative, which should be the base path.
void setStorageAuthConfigId (const QString &authCfg)
 Sets the authentication configuration ID to be used for the current external storage (if defined).
void setStorageType (const QString &storageType)
 Set storageType storage type unique identifier as defined in QgsExternalStorageRegistry or an empty QString if there is no storage defined, only file selection.
QString storageAuthConfigId () const
 Returns the authentication configuration ID used for the current external storage (if defined).
QString storageType () const
 Returns storage type unique identifier as defined in QgsExternalStorageRegistry.

Properties

QString defaultRoot
DocumentViewerContent documentViewerContent
int documentViewerHeight
int documentViewerWidth
bool fileWidgetVisible
QgsFileWidget::RelativeStorage relativeStorage

Friends

class TestQgsExternalResourceWidgetWrapper

Detailed Description

Widget to display file path with a push button for an "open file" dialog It can also be used to display a picture or a web page.

Definition at line 52 of file qgsexternalresourcewidget.h.

Member Enumeration Documentation

◆ DocumentViewerContent

Enumerator
NoContent 
Image 
Web 
Audio 
Video 

Definition at line 72 of file qgsexternalresourcewidget.h.

Constructor & Destructor Documentation

◆ QgsExternalResourceWidget()

QgsExternalResourceWidget::QgsExternalResourceWidget ( QWidget * parent = nullptr)
explicit

QgsExternalResourceWidget creates a widget with a file widget and a document viewer Both part of the widget are optional.

See also
QgsFileWidget

Definition at line 45 of file qgsexternalresourcewidget.cpp.

Member Function Documentation

◆ defaultRoot()

QString QgsExternalResourceWidget::defaultRoot ( ) const

Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath.

Definition at line 268 of file qgsexternalresourcewidget.cpp.

◆ documentPath() [1/2]

QVariant QgsExternalResourceWidget::documentPath ( QMetaType::Type type = QMetaType::Type::QString) const

documentPath returns the path of the current document in the widget

Parameters
typedetermines the type of the returned null variant if the document is not defined yet

Definition at line 88 of file qgsexternalresourcewidget.cpp.

◆ documentPath() [2/2]

QVariant QgsExternalResourceWidget::documentPath ( QVariant::Type type) const

documentPath returns the path of the current document in the widget

Parameters
typedetermines the type of the returned null variant if the document is not defined yet
Deprecated
QGIS 3.38. Use the method with a QMetaType::Type argument instead.

Definition at line 101 of file qgsexternalresourcewidget.cpp.

◆ documentViewerContent()

QgsExternalResourceWidget::DocumentViewerContent QgsExternalResourceWidget::documentViewerContent ( ) const

returns the type of content used in the document viewer

Definition at line 128 of file qgsexternalresourcewidget.cpp.

◆ documentViewerHeight()

int QgsExternalResourceWidget::documentViewerHeight ( ) const

returns the height of the document viewer

Definition at line 141 of file qgsexternalresourcewidget.cpp.

◆ documentViewerWidth()

int QgsExternalResourceWidget::documentViewerWidth ( ) const

returns the width of the document viewer

Definition at line 152 of file qgsexternalresourcewidget.cpp.

◆ fileWidget()

QgsExternalStorageFileWidget * QgsExternalResourceWidget::fileWidget ( )

Returns file widget to allow its configuration.

Definition at line 112 of file qgsexternalresourcewidget.cpp.

◆ fileWidgetVisible()

bool QgsExternalResourceWidget::fileWidgetVisible ( ) const

returns if the file widget is visible in the widget

Definition at line 117 of file qgsexternalresourcewidget.cpp.

◆ messageBar()

QgsMessageBar * QgsExternalResourceWidget::messageBar ( ) const

Returns message bar used to report messages.

Since
QGIS 3.22

Definition at line 315 of file qgsexternalresourcewidget.cpp.

◆ relativeStorage()

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage ( ) const

Configures if paths are handled absolute or relative and if relative, which should be the base path.

Definition at line 279 of file qgsexternalresourcewidget.cpp.

◆ setDefaultRoot()

void QgsExternalResourceWidget::setDefaultRoot ( const QString & defaultRoot)

Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath.

Definition at line 273 of file qgsexternalresourcewidget.cpp.

◆ setDocumentPath()

void QgsExternalResourceWidget::setDocumentPath ( const QVariant & documentPath)

Definition at line 107 of file qgsexternalresourcewidget.cpp.

◆ setDocumentViewerContent()

void QgsExternalResourceWidget::setDocumentViewerContent ( QgsExternalResourceWidget::DocumentViewerContent content)

setDocumentViewerContent defines the type of content to be shown. Widget will be adapted accordingly

Definition at line 133 of file qgsexternalresourcewidget.cpp.

◆ setDocumentViewerHeight()

void QgsExternalResourceWidget::setDocumentViewerHeight ( int height)

setDocumentViewerWidth set the height of the document viewer.

Parameters
heightthe height. Use 0 for automatic best display.

Definition at line 146 of file qgsexternalresourcewidget.cpp.

◆ setDocumentViewerWidth()

void QgsExternalResourceWidget::setDocumentViewerWidth ( int width)

setDocumentViewerWidth set the width of the document viewer.

Parameters
widththe width. Use 0 for automatic best display.

Definition at line 157 of file qgsexternalresourcewidget.cpp.

◆ setFileWidgetVisible()

void QgsExternalResourceWidget::setFileWidgetVisible ( bool visible)

Sets the visibility of the file widget in the layout.

Definition at line 122 of file qgsexternalresourcewidget.cpp.

◆ setMessageBar()

void QgsExternalResourceWidget::setMessageBar ( QgsMessageBar * messageBar)

Set messageBar to report messages.

Since
QGIS 3.22

Definition at line 310 of file qgsexternalresourcewidget.cpp.

◆ setReadOnly()

void QgsExternalResourceWidget::setReadOnly ( bool readOnly)

defines if the widget is readonly

Definition at line 163 of file qgsexternalresourcewidget.cpp.

◆ setRelativeStorage()

void QgsExternalResourceWidget::setRelativeStorage ( QgsFileWidget::RelativeStorage relativeStorage)

Configures if paths are handled absolute or relative and if relative, which should be the base path.

Definition at line 284 of file qgsexternalresourcewidget.cpp.

◆ setStorageAuthConfigId()

void QgsExternalResourceWidget::setStorageAuthConfigId ( const QString & authCfg)

Sets the authentication configuration ID to be used for the current external storage (if defined).

Since
QGIS 3.22

Definition at line 300 of file qgsexternalresourcewidget.cpp.

◆ setStorageType()

void QgsExternalResourceWidget::setStorageType ( const QString & storageType)

Set storageType storage type unique identifier as defined in QgsExternalStorageRegistry or an empty QString if there is no storage defined, only file selection.

See also
storageType
Since
QGIS 3.22

Definition at line 290 of file qgsexternalresourcewidget.cpp.

◆ storageAuthConfigId()

QString QgsExternalResourceWidget::storageAuthConfigId ( ) const

Returns the authentication configuration ID used for the current external storage (if defined).

Since
QGIS 3.22

Definition at line 305 of file qgsexternalresourcewidget.cpp.

◆ storageType()

QString QgsExternalResourceWidget::storageType ( ) const

Returns storage type unique identifier as defined in QgsExternalStorageRegistry.

Returns an empty QString if there is no storage defined, only file selection.

See also
setStorageType
Since
QGIS 3.22

Definition at line 295 of file qgsexternalresourcewidget.cpp.

◆ valueChanged

void QgsExternalResourceWidget::valueChanged ( const QString & value)
signal

Emitted as soon as the current document changes.

◆ TestQgsExternalResourceWidgetWrapper

friend class TestQgsExternalResourceWidgetWrapper
friend

Definition at line 251 of file qgsexternalresourcewidget.h.

Property Documentation

◆ defaultRoot

QString QgsExternalResourceWidget::defaultRoot
readwrite

Definition at line 69 of file qgsexternalresourcewidget.h.

◆ documentViewerContent

DocumentViewerContent QgsExternalResourceWidget::documentViewerContent
readwrite

Definition at line 65 of file qgsexternalresourcewidget.h.

◆ documentViewerHeight

int QgsExternalResourceWidget::documentViewerHeight
readwrite

Definition at line 66 of file qgsexternalresourcewidget.h.

◆ documentViewerWidth

int QgsExternalResourceWidget::documentViewerWidth
readwrite

Definition at line 67 of file qgsexternalresourcewidget.h.

◆ fileWidgetVisible

bool QgsExternalResourceWidget::fileWidgetVisible
readwrite

Definition at line 64 of file qgsexternalresourcewidget.h.

◆ relativeStorage

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage
readwrite

Definition at line 68 of file qgsexternalresourcewidget.h.


The documentation for this class was generated from the following files: