-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
154 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
class QgsExternalResourceWidget : QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsexternalresourcewidget.h> | ||
%End | ||
|
||
public: | ||
|
||
enum DocumentViewerContent | ||
{ | ||
NoContent, | ||
Image, | ||
Web | ||
}; | ||
|
||
explicit QgsExternalResourceWidget( QWidget* parent /TransferThis/ ); | ||
|
||
~QgsExternalResourceWidget(); | ||
|
||
/** | ||
* @brief documentPath returns the path of the current document in the widget | ||
* @param type determines the type of the returned null variant if the document is not defined yet | ||
*/ | ||
QVariant documentPath( QVariant::Type type = QVariant::String ) const; | ||
void setDocumentPath( QVariant documentPath ); | ||
|
||
//! access the file picker widget to allow its configuration | ||
QgsFilePickerWidget* filePickerwidget(); | ||
|
||
//! returns if the file picker is visible in the widget | ||
bool filePickerVisible() const; | ||
//! set the visiblity of the file picker in the widget | ||
void setFilePickerVisible( bool visible ); | ||
|
||
//! returns the type of content used in the document viewer | ||
QgsExternalResourceWidget::DocumentViewerContent documentViewerContent() const; | ||
//! 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 | ||
int documentViewerHeight() const; | ||
void setDocumentViewerHeight( int height ); | ||
int documentViewerWidth() const ; | ||
void setDocumentViewerWidth( int width ); | ||
|
||
//! defines if the widget is readonly | ||
void setReadOnly( bool readOnly ); | ||
|
||
signals: | ||
void valueChanged( QString ); | ||
|
||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
class QgsFilePickerWidget : QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsfilepickerwidget.h> | ||
%End | ||
|
||
public: | ||
|
||
enum StorageMode | ||
{ | ||
File, | ||
Directory | ||
}; | ||
|
||
enum RelativeStorage | ||
{ | ||
Absolute, | ||
RelativeProject, | ||
RelativeDefaultPath | ||
}; | ||
|
||
explicit QgsFilePickerWidget( QWidget* parent /TransferThis/ ); | ||
|
||
~QgsFilePickerWidget(); | ||
|
||
//! Returns the current file path | ||
QString filePath(); | ||
|
||
//! Sets the file path | ||
void setFilePath( QString path ); | ||
|
||
//! defines if the widget is readonly | ||
void setReadOnly( bool readOnly ); | ||
|
||
//! returns the open file dialog title | ||
QString dialogTitle() const; | ||
/** | ||
* @brief setDialogTitle defines the open file dialog title | ||
* @note if not defined, the title is "Select a file" or "Select a directory" depending on the configuration. | ||
*/ | ||
void setDialogTitle( QString title ); | ||
|
||
//! determines if the tool button is shown | ||
bool filePickerButtonVisible() const; | ||
//! determines if the tool button is shown | ||
void setFilePickerButtonVisible( bool visible ); | ||
|
||
//! determines if the file path will be shown as a link | ||
bool useLink() const; | ||
//! 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 | ||
bool fullUrl() const; | ||
void setFullUrl( bool fullUrl ); | ||
|
||
//! determinies the default root path | ||
QString defaultRoot() const; | ||
void setDefaultRoot( QString defaultRoot ); | ||
|
||
//! determines the storage mode (i.e. file or directory) | ||
QgsFilePickerWidget::StorageMode storageMode() const; | ||
void setStorageMode( QgsFilePickerWidget::StorageMode storageMode ); | ||
|
||
//! determines if the relative path is with respect to the project path or the default path | ||
QgsFilePickerWidget::RelativeStorage relativeStorage() const; | ||
void setRelativeStorage( QgsFilePickerWidget::RelativeStorage relativeStorage ); | ||
|
||
signals: | ||
void fileChanged( QString ); | ||
|
||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters