Class SBGWindowDialog#
This class is the base class of dialogs. More...
#include <SBGWindowDialog.hpp>
Inherits the following classes: QDialog
Inherited by the following classes: SBGFileExporter, SBGFileImporter
Public Functions#
Type | Name |
---|---|
SB_DECLARE_DATA (SBGWindowDialog) |
|
virtual int | getFormat () const Returns the dialog format. |
virtual QPixmap | getLogo () const Returns the dialog logo. |
virtual QString | getName () const Returns the dialog name (used as a title for the embedding window) |
virtual SBUUID | getUUID () const Returns the dialog UUID. |
SBGWindow * | getWindow () const Returns the pointer to the embedding window. |
void | loadDefaultSettings () Loads the dialog's default settings. |
virtual void | loadSettings (SBGSettings * settings) Loads the dialog settings . |
void | saveDefaultSettings () Saves the dialog's default settings. |
virtual void | saveSettings (SBGSettings * settings) Saves the dialog settings . |
virtual | ~SBGWindowDialog () Destructs the dialog. |
Public Static Functions#
Type | Name |
---|---|
bool | askUser (const QString & dialogTitle, const QString & dialogText, QDialogButtonBox * buttonBox=nullptr, const QPixmap & logo=QPixmap()) Asks a question to the user with a message in a modal pop-up dialog. |
bool | askUser (const QString & dialogTitle, const QString & labelText, const QString & text, bool monospaceFont=false, QDialogButtonBox * buttonBox=nullptr, const QPixmap & logo=QPixmap()) Asks a question to the user with a message and text in a modal pop-up dialog. |
bool | askUser (SBGWindowWidget * widget, QDialogButtonBox * butons=nullptr, const QPixmap & logo=QPixmap()) Asks a question to the user with a widget in a modal pop-up dialog. |
bool | askUser (QWidget * widget, QDialogButtonBox * butons=nullptr, const QPixmap & logo=QPixmap()) Asks a question to the user with a widget in a modal pop-up dialog. |
bool | getChoiceFromUser (const QString & dialogTitle, int & resultIndex, const QString & label, const QStringList & choices, const QStringList & toolTips, const QList< QPixmap > & icons, const QPixmap & logo=QPixmap()) Gets a choice from the user in a modal pop-up dialog. |
bool | getColorFromUser (const QString & dialogTitle, SBColor & result, const QPixmap & logo=QPixmap()) Gets a color from the user in a modal pop-up dialog. |
bool | getColorSchemeFromUser (const QString & dialogTitle, std::string & colorSchemeClassName, const SBDPalette * defaultPalette, SBDPalette * newPalette, const QPixmap & logo=QPixmap()) Gets a color scheme and a color palette from the user in a modal pop-up dialog. If the defaultPalette is provided it is set as a default one in the dialog. |
bool | getCredentialsFromUser (const QString & dialogTitle, QString & user, QString & password, const QPixmap & logo=QPixmap()) Gets credentials from the user in a modal pop-up dialog. |
bool | getCredentialsFromUser (const QString & dialogTitle, QString & host, int & port, QString & user, QString & password, const QPixmap & logo=QPixmap()) Gets credentials from the user in a modal pop-up dialog. |
bool | getDoubleFromUser (const QString & dialogTitle, double & result, double minimum, double maximum, double singleStep=1.0, const QString & prefix="", const QString & suffix="", int decimals=2, const QPixmap & logo=QPixmap()) Gets a number from the user in a modal pop-up dialog. |
bool | getDoubleIntervalFromUser (const QString & dialogTitle, const QStringList & labelText, std::pair< double, double > & result, const std::pair< double, double > & minValueInterval, const std::pair< double, double > & maxValueInterval, const std::pair< double, double > & singleStep=std::pair< double, double >(1.0, 1.0), const QString & prefix="", const QString & suffix="", const QPixmap & logo=QPixmap()) Gets a double interval from the user in a modal pop-up dialog. |
bool | getFileNameFromUser (const QString & dialogTitle, QString & result, const QString & dir=QString(), const QString & filter=QString(), QString * selectedFilter=Q_NULLPTR, QFileDialog::Options options=QFileDialog::Options(), const QPixmap & logo=QPixmap()) Gets a filename from the user in a modal pop-up dialog with Open button. |
bool | getFileNamesFromUser (const QString & dialogTitle, QStringList & result, const QString & dir=QString(), const QString & filter=QString(), QString * selectedFilter=Q_NULLPTR, QFileDialog::Options options=QFileDialog::Options(), const QPixmap & logo=QPixmap()) Gets a filename from the user in a modal pop-up dialog with Open button. |
bool | getFontFromUser (const QString & dialogTitle, QFont & result, const QPixmap & logo=QPixmap()) Gets a font from the user in a modal pop-up dialog. |
bool | getIntegerFromUser (const QString & dialogTitle, int & result, int minimum, int maximum, int singleStep=1, const QString & prefix="", const QString & suffix="", const QPixmap & logo=QPixmap()) Gets a number from the user in a modal pop-up dialog. |
bool | getIntegerIntervalFromUser (const QString & dialogTitle, const QStringList & labelText, std::pair< int, int > & result, const std::pair< int, int > & minValueInterval, const std::pair< int, int > & maxValueInterval, const std::pair< int, int > & singleStep=std::pair< int, int >(1, 1), const QString & prefix="", const QString & suffix="", const QPixmap & logo=QPixmap()) Gets an integer interval from the user in a modal pop-up dialog. |
bool | getItemFromUser (const QString & dialogTitle, int & resultIndex, const QString & label, const QStringList & items, const QPixmap & logo=QPixmap()) Gets an item from the user in a modal pop-up dialog. |
bool | getItemFromUser (const QString & dialogTitle, QString & result, const QString & label, const QStringList & items, int current=0, const QPixmap & logo=QPixmap()) Gets an item from the user in a modal pop-up dialog. |
SBDPalette * | getPaletteFromUser (const QString & dialogTitle, bool & ok, const SBDPalette * defaultPalette=nullptr, const QPixmap & logo=QPixmap()) Gets a color palette from the user in a modal pop-up dialog. If the defaultPalette is provided it is set as a default one in the color palette dialog. |
bool | getPathFromUser (const QString & dialogTitle, QString & result, const QPixmap & logo=QPixmap()) Gets a path from the user in a modal pop-up dialog. |
bool | getPlainTextFromUser (const QString & dialogTitle, QString & result, int maxSize=0, const QString & placeholderText="", const QPixmap & logo=QPixmap()) Gets a plain text from the user in a modal pop-up dialog. |
bool | getPromptFromUser (const QString & dialogTitle, QString & result, const QString & placeholderText="", const QPixmap & logo=QPixmap()) Gets a string from the user in a modal pop-up dialog. |
bool | getSaveFileNameFromUser (const QString & dialogTitle, QString & result, const QString & dir=QString(), const QString & filter=QString(), QString * selectedFilter=Q_NULLPTR, QFileDialog::Options options=QFileDialog::Options(), const QPixmap & logo=QPixmap()) Gets a filename from the user in a modal pop-up dialog with Save button. |
bool | getStringFromUser (const QString & dialogTitle, QString & result, const QString & placeholderText="", const QPixmap & logo=QPixmap()) Gets a string from the user in a modal pop-up dialog. |
void | informUser (const QString & dialogTitle, const QString & dialogText, const QPixmap & logo=QPixmap()) Informs the user with a message in a modal pop-up dialog. |
void | informUser (const QString & dialogTitle, const QString & labelText, const QString & text, bool monospaceFont=false, const QPixmap & logo=QPixmap()) Informs the user with a message and text in a modal pop-up dialog. |
void | informUser (SBGWindowWidget * widget, const QPixmap & logo=QPixmap(), bool hasOKButton=true) Informs the user with a widget in a modal pop-up dialog. |
void | informUser (QWidget * widget, const QPixmap & logo=QPixmap(), bool hasOKButton=true) Informs the user with a widget in a modal pop-up dialog. |
Protected Functions#
Type | Name |
---|---|
SBGWindowDialog () |
|
void | hideEvent (QHideEvent * event) |
void | showEvent (QShowEvent * event) |
Detailed Description#
This class is the base class of dialogs in the SAMSON GUI. SAMSON Extension do not create instances of this class, but of classes that derive from this class. In order for a dialog to have the SAMSON interface style, the dialog is embedded in a window.
See also: SBGWindow, SBGWindowWidget
Public Functions Documentation#
function SB_DECLARE_DATA#
function getFormat#
Returns the dialog format.
function getLogo#
Returns the dialog logo.
function getName#
Returns the dialog name (used as a title for the embedding window)
function getUUID#
Returns the dialog UUID.
function getWindow#
Returns the pointer to the embedding window.
function loadDefaultSettings#
Loads the dialog's default settings.
function loadSettings#
Loads the dialog settings
.
function saveDefaultSettings#
Saves the dialog's default settings.
function saveSettings#
Saves the dialog settings
.
function ~SBGWindowDialog#
Destructs the dialog.
Public Static Functions Documentation#
function askUser [1/4]#
Asks a question to the user with a message in a modal pop-up dialog.
static bool SBGWindowDialog::askUser (
const QString & dialogTitle,
const QString & dialogText,
QDialogButtonBox * buttonBox=nullptr,
const QPixmap & logo=QPixmap()
)
This static function asks the user a question with a message in a modal pop-up dialog. This is a convenience function which makes it easy to program questions to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the Cancel button or the OK button. The function returns true
if the user presses the OK button, or false
if the user presses the Cancel button or closes the dialog.
bool userReply = SBGWindowDialog::askUser("Information", "This operation will be
applied to all atoms in the document. Would you like to continue?");
See also: informUser
function askUser [2/4]#
Asks a question to the user with a message and text in a modal pop-up dialog.
static bool SBGWindowDialog::askUser (
const QString & dialogTitle,
const QString & labelText,
const QString & text,
bool monospaceFont=false,
QDialogButtonBox * buttonBox=nullptr,
const QPixmap & logo=QPixmap()
)
This static function asks the user a question with a message and text in a modal pop-up dialog. This is a convenience function which makes it easy to program questions to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the Cancel button or the OK button. The function returns true
if the user presses the OK button, or false
if the user presses the Cancel button or closes the dialog.
bool userReply = SBGWindowDialog::askUser("Information", "This operation produced the following warnings. Would you like to continue?", "Log text here");
See also: informUser
function askUser [3/4]#
Asks a question to the user with a widget in a modal pop-up dialog.
static bool SBGWindowDialog::askUser (
SBGWindowWidget * widget,
QDialogButtonBox * butons=nullptr,
const QPixmap & logo=QPixmap()
)
This static function asks the user a question with a widget
in a modal pop-up dialog. This is a convenience function which makes it easy to program questions to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the Cancel button or the OK button. The function returns true
if the user presses the OK button, or false
if the user presses the Cancel button or closes the dialog. The dialog title and icon are taken from the widget. Note that the OK button and the Cancel button are created by this function, and the widget does not have to contain some.
// MyCustomWidget derives from SBGWindowWidget
MyCustomWidget* myCustomWidget = new MyCustomWidget();
bool userReply = SBGWindowDialog::askUser(myCustomWidget);
// do something based on the user reply
...
delete myCustomWidget;
See also: informUser
function askUser [4/4]#
Asks a question to the user with a widget in a modal pop-up dialog.
static bool SBGWindowDialog::askUser (
QWidget * widget,
QDialogButtonBox * butons=nullptr,
const QPixmap & logo=QPixmap()
)
This static function asks the user a question with a widget
in a modal pop-up dialog. This is a convenience function which makes it easy to program questions to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the Cancel button or the OK button. The function returns true
if the user presses the OK button, or false
if the user presses the Cancel button or closes the dialog. The dialog title and icon are taken from the widget. Note that the OK button and the Cancel button are created by this function, and the widget does not have to contain some.
// MyCustomWidget derives from QWidget
QWidget* myCustomWidget = new QWidget();
bool userReply = SBGWindowDialog::askUser(myCustomWidget);
// do something based on the user reply
...
delete myCustomWidget;
See also: informUser
function getChoiceFromUser#
Gets a choice from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getChoiceFromUser (
const QString & dialogTitle,
int & resultIndex,
const QString & label,
const QStringList & choices,
const QStringList & toolTips,
const QList< QPixmap > & icons,
const QPixmap & logo=QPixmap()
)
function getColorFromUser#
Gets a color from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getColorFromUser (
const QString & dialogTitle,
SBColor & result,
const QPixmap & logo=QPixmap()
)
function getColorSchemeFromUser#
Gets a color scheme and a color palette from the user in a modal pop-up dialog. If the defaultPalette
is provided it is set as a default one in the dialog.
static bool SBGWindowDialog::getColorSchemeFromUser (
const QString & dialogTitle,
std::string & colorSchemeClassName,
const SBDPalette * defaultPalette,
SBDPalette * newPalette,
const QPixmap & logo=QPixmap()
)
function getCredentialsFromUser [1/2]#
Gets credentials from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getCredentialsFromUser (
const QString & dialogTitle,
QString & user,
QString & password,
const QPixmap & logo=QPixmap()
)
function getCredentialsFromUser [2/2]#
Gets credentials from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getCredentialsFromUser (
const QString & dialogTitle,
QString & host,
int & port,
QString & user,
QString & password,
const QPixmap & logo=QPixmap()
)
function getDoubleFromUser#
Gets a number from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getDoubleFromUser (
const QString & dialogTitle,
double & result,
double minimum,
double maximum,
double singleStep=1.0,
const QString & prefix="",
const QString & suffix="",
int decimals=2,
const QPixmap & logo=QPixmap()
)
function getDoubleIntervalFromUser#
Gets a double interval from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getDoubleIntervalFromUser (
const QString & dialogTitle,
const QStringList & labelText,
std::pair< double, double > & result,
const std::pair< double, double > & minValueInterval,
const std::pair< double, double > & maxValueInterval,
const std::pair< double, double > & singleStep=std::pair< double, double >(1.0, 1.0),
const QString & prefix="",
const QString & suffix="",
const QPixmap & logo=QPixmap()
)
function getFileNameFromUser#
Gets a filename from the user in a modal pop-up dialog with Open button.
static bool SBGWindowDialog::getFileNameFromUser (
const QString & dialogTitle,
QString & result,
const QString & dir=QString(),
const QString & filter=QString(),
QString * selectedFilter=Q_NULLPTR,
QFileDialog::Options options=QFileDialog::Options(),
const QPixmap & logo=QPixmap()
)
function getFileNamesFromUser#
Gets a filename from the user in a modal pop-up dialog with Open button.
static bool SBGWindowDialog::getFileNamesFromUser (
const QString & dialogTitle,
QStringList & result,
const QString & dir=QString(),
const QString & filter=QString(),
QString * selectedFilter=Q_NULLPTR,
QFileDialog::Options options=QFileDialog::Options(),
const QPixmap & logo=QPixmap()
)
function getFontFromUser#
Gets a font from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getFontFromUser (
const QString & dialogTitle,
QFont & result,
const QPixmap & logo=QPixmap()
)
function getIntegerFromUser#
Gets a number from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getIntegerFromUser (
const QString & dialogTitle,
int & result,
int minimum,
int maximum,
int singleStep=1,
const QString & prefix="",
const QString & suffix="",
const QPixmap & logo=QPixmap()
)
function getIntegerIntervalFromUser#
Gets an integer interval from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getIntegerIntervalFromUser (
const QString & dialogTitle,
const QStringList & labelText,
std::pair< int, int > & result,
const std::pair< int, int > & minValueInterval,
const std::pair< int, int > & maxValueInterval,
const std::pair< int, int > & singleStep=std::pair< int, int >(1, 1),
const QString & prefix="",
const QString & suffix="",
const QPixmap & logo=QPixmap()
)
function getItemFromUser [1/2]#
Gets an item from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getItemFromUser (
const QString & dialogTitle,
int & resultIndex,
const QString & label,
const QStringList & items,
const QPixmap & logo=QPixmap()
)
function getItemFromUser [2/2]#
Gets an item from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getItemFromUser (
const QString & dialogTitle,
QString & result,
const QString & label,
const QStringList & items,
int current=0,
const QPixmap & logo=QPixmap()
)
function getPaletteFromUser#
Gets a color palette from the user in a modal pop-up dialog. If the defaultPalette
is provided it is set as a default one in the color palette dialog.
static SBDPalette * SBGWindowDialog::getPaletteFromUser (
const QString & dialogTitle,
bool & ok,
const SBDPalette * defaultPalette=nullptr,
const QPixmap & logo=QPixmap()
)
function getPathFromUser#
Gets a path from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getPathFromUser (
const QString & dialogTitle,
QString & result,
const QPixmap & logo=QPixmap()
)
function getPlainTextFromUser#
Gets a plain text from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getPlainTextFromUser (
const QString & dialogTitle,
QString & result,
int maxSize=0,
const QString & placeholderText="",
const QPixmap & logo=QPixmap()
)
function getPromptFromUser#
Gets a string from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getPromptFromUser (
const QString & dialogTitle,
QString & result,
const QString & placeholderText="",
const QPixmap & logo=QPixmap()
)
function getSaveFileNameFromUser#
Gets a filename from the user in a modal pop-up dialog with Save button.
static bool SBGWindowDialog::getSaveFileNameFromUser (
const QString & dialogTitle,
QString & result,
const QString & dir=QString(),
const QString & filter=QString(),
QString * selectedFilter=Q_NULLPTR,
QFileDialog::Options options=QFileDialog::Options(),
const QPixmap & logo=QPixmap()
)
function getStringFromUser#
Gets a string from the user in a modal pop-up dialog.
static bool SBGWindowDialog::getStringFromUser (
const QString & dialogTitle,
QString & result,
const QString & placeholderText="",
const QPixmap & logo=QPixmap()
)
function informUser [1/4]#
Informs the user with a message in a modal pop-up dialog.
static void SBGWindowDialog::informUser (
const QString & dialogTitle,
const QString & dialogText,
const QPixmap & logo=QPixmap()
)
This static function informs the user with a message in a modal pop-up dialog. This is a convenience function which makes it easy to program messages to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the OK button.
SBGWindowDialog::informUser("Information", "This operation will be applied to
all atoms in the document.");
See also: askUser
function informUser [2/4]#
Informs the user with a message and text in a modal pop-up dialog.
static void SBGWindowDialog::informUser (
const QString & dialogTitle,
const QString & labelText,
const QString & text,
bool monospaceFont=false,
const QPixmap & logo=QPixmap()
)
This static function informs the user with a message and text in a modal pop-up dialog. This is a convenience function which makes it easy to program messages with logs to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the OK button.
SBGWindowDialog::informUser("Information", "This operation produced the following log:", "Log text here");
See also: askUser
function informUser [3/4]#
Informs the user with a widget in a modal pop-up dialog.
static void SBGWindowDialog::informUser (
SBGWindowWidget * widget,
const QPixmap & logo=QPixmap(),
bool hasOKButton=true
)
This static function informs the user with a widget
in a modal pop-up dialog. This is a convenience function which makes it easy to program messages to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the OK button. The dialog title and icon are taken from the widget. Note that the OK button is created by this function, and the widget does not have to contain one.
// MyCustomWidget derives from SBGWindowWidget
MyCustomWidget* myCustomWidget = new MyCustomWidget();
SBGWindowDialog::informUser(myCustomWidget);
delete myCustomWidget;
See also: askUser
function informUser [4/4]#
Informs the user with a widget in a modal pop-up dialog.
static void SBGWindowDialog::informUser (
QWidget * widget,
const QPixmap & logo=QPixmap(),
bool hasOKButton=true
)
This static function informs the user with a widget
in a modal pop-up dialog. This is a convenience function which makes it easy to program messages to the user with the SAMSON style. The function creates a modal pop-up dialog that blocks all other user interaction until the user pushes the OK button. The dialog title and icon are taken from the widget. Note that the OK button is created by this function, and the widget does not have to contain one.
// MyCustomWidget derives from SBGWindowWidget
QWidget* myCustomWidget = new QWidget();
SBGWindowDialog::informUser(myCustomWidget);
delete myCustomWidget;
See also: askUser