QGIS API Documentation  2.99.0-Master (a18066b)
Public Types | Signals | Public Member Functions | Properties | List of all members
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:
Inheritance graph
[legend]

Public Types

enum  DocumentViewerContent { NoContent, Image, Web }
 

Signals

void valueChanged (const QString &)
 emitteed as soon as the current document changes More...
 

Public Member Functions

 QgsExternalResourceWidget (QWidget *parent=0)
 QgsExternalResourceWidget creates a widget with a file widget and a document viewer Both part of the widget are optional. More...
 
QString defaultRoot () const
 Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath. More...
 
QVariant documentPath (QVariant::Type type=QVariant::String) const
 documentPath returns the path of the current document in the widget More...
 
QgsExternalResourceWidget::DocumentViewerContent documentViewerContent () const
 returns the type of content used in the document viewer More...
 
int documentViewerHeight () const
 returns the height of the document viewer More...
 
int documentViewerWidth () const
 returns the width of the document viewer More...
 
QgsFileWidgetfileWidget ()
 access the file widget to allow its configuration More...
 
bool fileWidgetVisible () const
 returns if the file widget is visible in the widget More...
 
QgsFileWidget::RelativeStorage relativeStorage () const
 Configures if paths are handled absolute or relative and if relative, which should be the base path. More...
 
void setDefaultRoot (const QString &defaultRoot)
 Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget::RelativeDefaultPath. More...
 
void setDocumentPath (const QVariant &documentPath)
 
void setDocumentViewerContent (QgsExternalResourceWidget::DocumentViewerContent content)
 setDocumentViewerContent defines the type of content to be shown. Widget will be adapted accordingly More...
 
void setDocumentViewerHeight (int height)
 setDocumentViewerWidth set the height of the document viewer. More...
 
void setDocumentViewerWidth (int width)
 setDocumentViewerWidth set the width of the document viewer. More...
 
void setFileWidgetVisible (bool visible)
 set the visiblity of the file widget in the layout More...
 
void setReadOnly (bool readOnly)
 defines if the widget is readonly More...
 
void setRelativeStorage (QgsFileWidget::RelativeStorage relativeStorage)
 Configures if paths are handled absolute or relative and if relative, which should be the base path. More...
 

Properties

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

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 36 of file qgsexternalresourcewidget.h.

Member Enumeration Documentation

◆ DocumentViewerContent

Enumerator
NoContent 
Image 
Web 

Definition at line 48 of file qgsexternalresourcewidget.h.

Constructor & Destructor Documentation

◆ QgsExternalResourceWidget()

QgsExternalResourceWidget::QgsExternalResourceWidget ( QWidget *  parent = 0)
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 30 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.

◆ documentPath()

QVariant QgsExternalResourceWidget::documentPath ( QVariant::Type  type = QVariant::String) 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 64 of file qgsexternalresourcewidget.cpp.

◆ documentViewerContent()

QgsExternalResourceWidget::DocumentViewerContent QgsExternalResourceWidget::documentViewerContent ( ) const

returns the type of content used in the document viewer

◆ documentViewerHeight()

int QgsExternalResourceWidget::documentViewerHeight ( ) const

returns the height of the document viewer

◆ documentViewerWidth()

int QgsExternalResourceWidget::documentViewerWidth ( ) const

returns the width of the document viewer

◆ fileWidget()

QgsFileWidget * QgsExternalResourceWidget::fileWidget ( )

access the file widget to allow its configuration

Definition at line 82 of file qgsexternalresourcewidget.cpp.

◆ fileWidgetVisible()

bool QgsExternalResourceWidget::fileWidgetVisible ( ) const

returns if the file widget is visible in the widget

◆ relativeStorage()

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage ( ) const

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

◆ 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 195 of file qgsexternalresourcewidget.cpp.

◆ setDocumentPath()

void QgsExternalResourceWidget::setDocumentPath ( const QVariant &  documentPath)

Definition at line 77 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 103 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 114 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 125 of file qgsexternalresourcewidget.cpp.

◆ setFileWidgetVisible()

void QgsExternalResourceWidget::setFileWidgetVisible ( bool  visible)

set the visiblity of the file widget in the layout

Definition at line 92 of file qgsexternalresourcewidget.cpp.

◆ setReadOnly()

void QgsExternalResourceWidget::setReadOnly ( bool  readOnly)

defines if the widget is readonly

Definition at line 131 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 206 of file qgsexternalresourcewidget.cpp.

◆ valueChanged

void QgsExternalResourceWidget::valueChanged ( const QString &  )
signal

emitteed as soon as the current document changes

Property Documentation

◆ defaultRoot

QString QgsExternalResourceWidget::defaultRoot
readwrite

Definition at line 45 of file qgsexternalresourcewidget.h.

◆ documentViewerContent

QgsExternalResourceWidget::DocumentViewerContent QgsExternalResourceWidget::documentViewerContent
readwrite

Definition at line 41 of file qgsexternalresourcewidget.h.

◆ documentViewerHeight

int QgsExternalResourceWidget::documentViewerHeight
readwrite

Definition at line 42 of file qgsexternalresourcewidget.h.

◆ documentViewerWidth

int QgsExternalResourceWidget::documentViewerWidth
readwrite

Definition at line 43 of file qgsexternalresourcewidget.h.

◆ fileWidgetVisible

bool QgsExternalResourceWidget::fileWidgetVisible
readwrite

Definition at line 40 of file qgsexternalresourcewidget.h.

◆ relativeStorage

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage
readwrite

Definition at line 44 of file qgsexternalresourcewidget.h.


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