CommonGUI Class Reference

Static Public Member Functions

static QString askString (const QString &title, const QString &label, bool *ok=nullptr, const QString &defaultString="")
 Calls getText().
 
static QString getText (QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode=QLineEdit::Normal, const QString &text=QString(), bool *ok=nullptr)
 Opens a QInputDialog for text input, but sets its flags so that the '?' titlebar button doesn't appear.
 
static QList< bool > listViewStandardItemsToBoolList (QListView *listview)
 
static QStringList listViewStandardItemsToStringList (QListView *listview)
 Reads items from a QListView that uses QStandardItemModel and puts texts of these items into a list of strings.
 
static void removeSelectedRowsFromQTableWidget (QTableWidget *table)
 
static void removeSelectedRowsFromStandardItemView (QAbstractItemView *view, bool bSelectNextItem=false)
 Removes all selected rows from a QAbstractItemView.
 
static void setupDialog (QDialog &dialog)
 Setup common properties for the dialog box.
 
static void stringListToStandardItemsListView (QListView *targetListview, const QStringList &stringList)
 Puts a list of strings into a QListView that uses QStandardItemModel.
 

Detailed Description

Definition at line 36 of file commongui.h.

Member Function Documentation

QString CommonGUI::askString ( const QString &  title,
const QString &  label,
bool *  ok = nullptr,
const QString &  defaultString = "" 
)
static

Calls getText().

Definition at line 32 of file commongui.cpp.

QString CommonGUI::getText ( QWidget *  parent,
const QString &  title,
const QString &  label,
QLineEdit::EchoMode  mode = QLineEdit::Normal,
const QString &  text = QString(),
bool *  ok = nullptr 
)
static

Opens a QInputDialog for text input, but sets its flags so that the '?' titlebar button doesn't appear.

Definition at line 39 of file commongui.cpp.

QList< bool > CommonGUI::listViewStandardItemsToBoolList ( QListView *  listview)
static

Reads items from a QListView with QStandardItemModel and pulls the checked state and converts to a QList<bool>.

Definition at line 56 of file commongui.cpp.

QStringList CommonGUI::listViewStandardItemsToStringList ( QListView *  listview)
static

Reads items from a QListView that uses QStandardItemModel and puts texts of these items into a list of strings.

Parameters
listview- QListView that uses QStandardItemModel.

Definition at line 67 of file commongui.cpp.

void CommonGUI::removeSelectedRowsFromStandardItemView ( QAbstractItemView *  view,
bool  bSelectNextItem = false 
)
static

Removes all selected rows from a QAbstractItemView.

Parameters
viewQAbstractItemView from which items will be removed.
bSelectNextItemIf true then next lowest item on the list is selected. Default: false.

Definition at line 96 of file commongui.cpp.

void CommonGUI::setupDialog ( QDialog &  dialog)
static

Setup common properties for the dialog box.

  • Remove the '?' button from the title bar.

Definition at line 136 of file commongui.cpp.

void CommonGUI::stringListToStandardItemsListView ( QListView *  targetListview,
const QStringList &  stringList 
)
static

Puts a list of strings into a QListView that uses QStandardItemModel.

Parameters
targetListviewQListView that uses QStandardItemModel. This list view will be filled with data.
stringListSource data.

Definition at line 141 of file commongui.cpp.


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