A widget which allows easy editing of a QStringList. More...
#include <StringListWidget.h>
Public Types | |
enum | ListType { PlainStrings = 0, FilePaths = 1, Directories = 2 } |
The possible types of items which are listed in the string list widget. More... |
Signals | |
void | selectionChanged () |
Signal emitted when the selection changes. | |
void | stringListChanged (const QStringList &string_list) |
Signal emitted as soon as the list of string changed. |
Public Member Functions | |
QString | fileOpenDialogFilter () const |
Gets the file open dialog filter to be used for FilePaths ListType. | |
QString | fileOpenDialogPath () const |
Gets the file open dialog path to be used for FilePaths and Directories ListType. | |
ListType | listType () const |
Gets the type of items in the list. | |
QListView * | listView () |
Returns the list view used to display the strings. | |
QStringList | nonRemovableStringList () const |
Gets the current list of non-removable only strings. | |
bool | openOnDoubleClick () const |
Gets if files and folder must be opened when double clicked. | |
bool | readOnly () const |
Gets if this list is read only. | |
void | setFileOpenDialogFilter (const QString &open_dialog_filter) |
Sets the file open dialog filter to be used for FilePaths ListType. | |
void | setFileOpenDialogPath (const QString &open_dialog_path) |
Sets the file open dialog path to be used for FilePaths and Directories ListType. | |
void | setListType (const ListType &list_type) |
Sets the type of items in the list. | |
void | setNonRemovableStringList (const QStringList &string_list) |
Sets the current list of non-removable only strings. | |
void | setOpenOnDoubleClick (bool open_on_double_click) |
Sets if files and folders must be opened when double clicked. | |
void | setReadOnly (bool read_only) |
Sets if this list is read only. | |
void | setStringList (const QStringList &string_list) |
Sets the current list of string. | |
void | setStringType (const QString &string_type) |
Sets the string type. | |
QStringList | stringList () const |
Gets the current list of strings. | |
QStringListModel * | stringListModel () |
Returns the QStringListModel used as the model in the list view. | |
QString | stringType () const |
Gets the string type. |
A widget which allows easy editing of a QStringList.
The StringListWidget class is a simple widget which can be used to display a QStringList. You can give your string list a type using setStringType() and the list of strings to be displayed is set using setStringList().
The widget is a QMainWindow with a toolbar at the top containing actions to remove and add strings. To customize the operation of the widget the string list model can be accessed using stringListModel() and the view can be accessed through listView().
Below is an image of the string list widget with the string type set to "Architecture".
This class was added in Qtilities v1.0.
bool Qtilities::CoreGui::StringListWidget::openOnDoubleClick | ( | ) | const |
Gets if files and folder must be opened when double clicked.
False by default.
This function was added in Qtilities v1.1.
void Qtilities::CoreGui::StringListWidget::setOpenOnDoubleClick | ( | bool | open_on_double_click | ) |
Sets if files and folders must be opened when double clicked.
Only applicable for FilePaths and Directories list types, see listType().
This function was added in Qtilities v1.1.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|