Wt
4.11.1
|
Classes that implement Wt's model/view system. More...
Classes | |
struct | Wt::any_traits< Type > |
A traits class for a type stored in a cpp17::any. More... | |
class | Wt::ItemDataRole |
Enumeration that indicates a role for a data item. More... | |
class | Wt::Chart::WAbstractChart |
Abstract base class for MVC-based charts. More... | |
class | Wt::Chart::WCartesianChart |
A cartesian chart. More... | |
class | Wt::Chart::WPieChart |
A pie chart. More... | |
class | Wt::Dbo::QueryModel< Result > |
A Wt MVC Model to view/edit query results. More... | |
class | Wt::WAbstractItemDelegate |
Abstract delegate class for rendering an item in an item view. More... | |
class | Wt::WAbstractItemModel |
An abstract model for use with Wt's view classes. More... | |
class | Wt::WAbstractItemView |
An abstract base class for item Views. More... | |
class | Wt::WAbstractListModel |
An abstract list model for use with Wt's view classes. More... | |
class | Wt::WAbstractProxyModel |
An abstract proxy model for Wt's item models. More... | |
class | Wt::WAbstractTableModel |
An abstract table model for use with Wt's view classes. More... | |
class | Wt::WAggregateProxyModel |
A proxy model for Wt's item models that provides column aggregation. More... | |
class | Wt::WBatchEditProxyModel |
A proxy model for Wt's item models that provides batch editing. More... | |
class | Wt::WComboBox |
A widget that provides a drop-down combo-box control. More... | |
class | Wt::WItemDelegate |
Standard delegate class for rendering a view item. More... | |
class | Wt::WItemSelectionModel |
A class that represents a selection for a WAbstractItemView. More... | |
class | Wt::WModelIndex |
A value class that describes an index to an item in a data model. More... | |
class | Wt::WReadOnlyProxyModel |
A read-only wrapper for a source model. More... | |
class | Wt::WSelectionBox |
A selection box allows selection from a list of options. More... | |
class | Wt::WSortFilterProxyModel |
A proxy model for Wt's item models that provides filtering and/or sorting. More... | |
class | Wt::WStandardItem |
An item in a WStandardItemModel. More... | |
class | Wt::WStandardItemModel |
A standard data model, which stores its data in memory. More... | |
class | Wt::WStringListModel |
An model that manages a list of strings. More... | |
class | Wt::WSuggestionPopup |
A widget which popups to assist in editing a textarea or lineedit. More... | |
class | Wt::WTableView |
An MVC View widget for tabular data. More... | |
class | Wt::WTreeView |
A view class that displays a model as a tree or tree table. More... | |
Enumerations | |
enum class | Wt::MatchFlag { Wt::Exactly = 0x0 , Wt::StringExactly = 0x1 , Wt::StartsWith = 0x2 , Wt::EndsWith = 0x3 , Wt::RegExp = 0x4 , Wt::WildCard = 0x5 , Wt::CaseSensitive = 0x10 , Wt::Wrap = 0x20 } |
Flags that specify how to match two values. More... | |
enum class | Wt::HeaderFlag { Wt::ColumnIsCollapsed = 0x1 , Wt::ColumnIsExpandedLeft = 0x2 , Wt::ColumnIsExpandedRight = 0x4 , Wt::UserCheckable = 0x8 , Wt::Tristate = 0x10 , Wt::XHTMLText = 0x40 } |
Flags that indicate table header options. More... | |
enum class | Wt::ItemFlag { Wt::Selectable = 0x1 , Wt::Editable = 0x2 , Wt::UserCheckable = 0x4 , Wt::DragEnabled = 0x8 , Wt::DropEnabled = 0x10 , Wt::Tristate = 0x20 , Wt::XHTMLText = 0x40 , Wt::Dirty = 0x80 , Wt::DeferredToolTip = 0x100 } |
Flags that indicate data item options. More... | |
enum class | Wt::SortOrder { Wt::Ascending , Wt::Descending } |
Enumeration that indicates a sort order. More... | |
enum class | Wt::DropAction { Wt::Copy = 0x1 , Wt::Move = 0x2 } |
Enumeration that indicates a drop action. More... | |
Functions | |
WString | Wt::asString (const cpp17::any &v, const WString &formatString=WString()) |
Interprets a cpp17::any as a string value. More... | |
double | Wt::asNumber (const cpp17::any &v) |
Interprets a cpp17::any as a number value. More... | |
template<typename Type > | |
void | Wt::registerType () |
Registers MVC-support for a type passed in a cpp17::any. More... | |
Classes that implement Wt's model/view system.
The library provides support for tabular, tree-like and tree-table like models. All of these implement WAbstractItemModel.
The following concrete model implementations are provided:
Proxy models are helper models which wrap around another model, to provide additional functionality on top of the existing model. The following propy models:
Abstract models cannot be instantiated as such, but are the base point for custom model implementations:
WModelIndex represents an index to an item of a WAbstractItemModel, identified by a row, column and parent node.
Item delegates are used by WTableView and WTreeView to render a single item and to provide editing support.
The abstract base class is WAbstractItemDelegate, and a default implementation is provided by WItemDelegate.
|
strong |
Enumeration that indicates a drop action.
Enumerator | |
---|---|
Copy | Copy the selection. |
Move | Move the selection (deleting originals) |
|
strong |
Flags that indicate table header options.
Enumerator | |
---|---|
ColumnIsCollapsed | Flag that indicates that the column can be expanded. |
ColumnIsExpandedLeft | Flag that indicates that the column was expanded to the left. |
ColumnIsExpandedRight | Flag that indicates that the column was expanded to the right. |
UserCheckable | Flag that indicates that the header can be checked. |
Tristate | Flag that indicates that the item has three states. When set, Wt::ItemDataRole::Checked data is of type Wt::CheckState |
XHTMLText | Flag that indicates that the item text (ItemDataRole::Display, ItemDataRole::ToolTip) is HTML. |
|
strong |
Flags that indicate data item options.
Enumerator | |
---|---|
Selectable | Item can be selected. |
Editable | Item can be edited. |
UserCheckable | Item can be checked (checkbox is enabled) |
DragEnabled | Item can be dragged. |
DropEnabled | Item can be a drop target. |
Tristate | Item has tree states. When set, Wt::ItemDataRole::Checked data is of type Wt::CheckState |
XHTMLText | Item's text (ItemDataRole::Display, ItemDataRole::ToolTip) is HTML. |
Dirty | Item's value has been modified. |
DeferredToolTip | Item's tooltip is deferred. |
|
strong |
Flags that specify how to match two values.
Except when MatchFlag::Exactly, the lexical matching is done (by comparing string representations of the value with the query). This is by default case insensitive, unless MatchFlag::CaseSensitive is OR'ed.
|
strong |
double Wt::asNumber | ( | const cpp17::any & | v | ) |
Interprets a cpp17::any as a number value.
The conversion works as follows:
Other types are converted according to Wt::any_traits<Type>::asNumber(). For these other types, you need to register their support first using Wt::registerType<Type>() and you may want to specialize Wt::any_traits<Type> for a custom handling of their conversions.
Interprets a cpp17::any as a string value.
The conversion works as follows:
Other types are converted according to Wt::any_traits<Type>::asString(). For these other types, you need to register their support first using Wt::registerType<Type>() and you may want to specialize Wt::any_traits<Type> for a custom handling of their conversions.
void Wt::registerType | ( | ) |
Registers MVC-support for a type passed in a cpp17::any.
By registering a type using this method, the global function Wt::asString(), which converts a cpp17::any to a string, will know how to interpret a cpp17::any holding a value of type Type
using Wt::any_traits<Type>::asString(). This gives Wt's built-in standard View classes the ability to display Wt::ItemDataRole::Display data of a Wt::WAbstractItemModel model.
Similarly, Wt::asNumber() uses Wt::any_traits<Type>::asNumber() for use by Wt::Chart::WCartesianChart and Wt::Chart::WPieChart as numerical data.
The default implementation of Wt::any_traits<Type> converts a value t
to a Wt::WString by using std::ostream<<, expecting a UTF-8 string. This conversion thus relies on the std::ostream<< operator to be overloaded for the type. You may want to specialize Wt::any_traits to provide a custom conversion for a type, or if you want to take into account the format string.
The following types are registered by Wt itself:
This method is thread-safe, and it is not an error to register the same type multiple times.