QGIS API Documentation
2.0.1-Dufour
|
/namespace QgisGui The QgisGui namespace contains constants and helper functions used throughout the QGIS GUI. More...
Functions | |
bool GUI_EXPORT | openFilesRememberingFilter (QString const &filterName, QString const &filters, QStringList &selectedFiles, QString &enc, QString &title, bool cancelAll=false) |
Open files, preferring to have the default file selector be the last one used, if any; also, prefer to start in the last directory associated with filterName. | |
QPair< QString, QString > GUI_EXPORT | getSaveAsImageName (QWidget *theParent, QString theMessage) |
A helper function to get an image name from the user. | |
QString | createFileFilter_ (QString const &longName, QString const &glob) |
Convenience function for readily creating file filters. |
Variables | |
static const Qt::WFlags | ModalDialogFlags = 0 |
/namespace QgisGui The QgisGui namespace contains constants and helper functions used throughout the QGIS GUI.
QString QgisGui::createFileFilter_ | ( | QString const & | longName, |
QString const & | glob | ||
) |
Convenience function for readily creating file filters.
Given a long name for a file filter and a regular expression, return a file filter string suitable for use in a QFileDialog::OpenFiles() call. The regular express, glob, will have both all lower and upper case versions added.
Definition at line 165 of file qgisgui.cpp.
Referenced by getSaveAsImageName().
QPair< QString, QString > GUI_EXPORT QgisGui::getSaveAsImageName | ( | QWidget * | theParent, |
QString | theMessage | ||
) |
A helper function to get an image name from the user.
It will nicely provide filters with all available writable image formats.
theParent | widget that should act as the parent for the file dialog |
theMessage | the message to display to the user |
Definition at line 86 of file qgisgui.cpp.
References createFileFilter_(), and QgsDebugMsg.
Referenced by QgsRasterHistogramWidget::on_mSaveAsImageButton_clicked().
bool GUI_EXPORT QgisGui::openFilesRememberingFilter | ( | QString const & | filterName, |
QString const & | filters, | ||
QStringList & | selectedFiles, | ||
QString & | enc, | ||
QString & | title, | ||
bool | cancelAll = false |
||
) |
Open files, preferring to have the default file selector be the last one used, if any; also, prefer to start in the last directory associated with filterName.
filterName | the name of the filter; used for persistent store key |
filters | the file filters used for QFileDialog |
selectedFiles | string list of selected files; will be empty if none selected |
enc | encoding? |
title | the title for the dialog |
cancelAll | add button to cancel further requests |
Stores persistent settings under /UI/. The sub-keys will be filterName and filterName + "Dir".
Opens dialog on last directory associated with the filter name, or the current working directory if this is the first time invoked with the current filter name.
This method returns true if cancel all was clicked, otherwise false
Definition at line 28 of file qgisgui.cpp.
References QgsEncodingFileDialog::addCancelAll(), QgsEncodingFileDialog::cancelAll(), and QgsDebugMsg.
Referenced by QgsProjectBadLayerGuiHandler::findMissingFile().
|
static |
/var ModalDialogFlags /brief Flags used to create a modal dialog (adapted from QMessageBox).
Using these flags for all modal dialogs throughout QGIS ensures that for platforms such as the Mac where modal and modeless dialogs have different looks, QGIS modal dialogs will look the same as Qt modal dialogs and all modal dialogs will look distinct from modeless dialogs. Althought not the standard Mac modal look, it does lack the minimize control which makes sense only for modeless dislogs.
The Qt3 method of creating a true Mac modal dialog is deprecated in Qt4 and should not be used due to conflicts with QMessageBox style dialogs.
Qt::WindowMaximizeButtonHint is included but will be ignored if the dialog is a fixed size and does not have a size grip.