General purpose Item implementation.
|
template<typename T_ID = QString, typename T_TEXT = QString, typename T_SUBTEXT = QString, typename T_ICON_FACTORY = std::function<std::unique_ptr<Icon>()>, typename T_ACTIONS = std::vector<Action>, typename T_INPUTACTION = QString>
requires (std::same_as<std::remove_cvref_t<T_ID>, QString> && std::same_as<std::remove_cvref_t<T_TEXT>, QString> && std::same_as<std::remove_cvref_t<T_SUBTEXT>, QString> && std::convertible_to<std::remove_cvref_t<T_ICON_FACTORY>, std::function<std::unique_ptr<Icon>()>> && std::same_as<std::remove_cvref_t<T_ACTIONS>, std::vector<Action>> && std::same_as<std::remove_cvref_t<T_INPUTACTION>, QString>) |
| | StandardItem (T_ID &&id, T_TEXT &&text, T_SUBTEXT &&subtext, T_ICON_FACTORY &&icon_factory, T_ACTIONS &&actions=std::vector< Action >{}, T_INPUTACTION &&input_action_text=QString{}) noexcept |
| | Constructs a StandardItem with the contents initialized with the data passed.
|
| |
| | StandardItem (const StandardItem &)=delete |
| |
| StandardItem & | operator= (const StandardItem &)=delete |
| |
| | StandardItem (StandardItem &&other) noexcept=default |
| | Constructs a StandardItem with the contents of other using move semantics.
|
| |
| StandardItem & | operator= (StandardItem &&other) noexcept=default |
| | Replaces the contents with those of other using move semantics.
|
| |
| | ~StandardItem () |
| | Destructs the StandardItem.
|
| |
| void | setId (QString id) |
| | Sets the item identifier to id.
|
| |
| void | setText (QString text) |
| | Sets the item text to text.
|
| |
| void | setSubtext (QString text) |
| | Sets the item subtext to text.
|
| |
| void | setIconFactory (std::function< std::unique_ptr< Icon >()> icon_factory) |
| | Sets the item factory to icon_factory.
|
| |
| std::function< std::unique_ptr< Icon >()> | iconFactory () |
| | Returns the item icon factory.
|
| |
| void | setActions (std::vector< Action > actions) |
| | Sets the item actions to actions.
|
| |
| void | setInputActionText (QString text) |
| | Sets the item input action text to text.
|
| |
| QString | id () const override |
| | Returns the item identifier.
|
| |
| QString | text () const override |
| | Returns the item text.
|
| |
| QString | subtext () const override |
| | Returns the item subtext.
|
| |
| QString | inputActionText () const override |
| | Returns the item input action text.
|
| |
| std::unique_ptr< Icon > | icon () const override |
| | Returns the item icon.
|
| |
| std::vector< Action > | actions () const override |
| | Returns the item actions.
|
| |
| virtual | ~Item () |
| | Destructs the item.
|
| |
| virtual void | addObserver (Observer *observer) |
| | Starts notifying observer about any changes.
|
| |
| virtual void | removeObserver (Observer *observer) |
| | Stops notifying observer about any changes.
|
| |
|
template<typename T_ID = QString, typename T_TEXT = QString, typename T_SUBTEXT = QString, typename T_ICON_FACTORY = std::function<std::unique_ptr<Icon>()>, typename T_ACTIONS = std::vector<Action>, typename T_INPUTACTION = QString>
requires (std::same_as<std::decay_t<T_ID>, QString> && std::same_as<std::decay_t<T_TEXT>, QString> && std::same_as<std::decay_t<T_SUBTEXT>, QString> && std::convertible_to<std::decay_t<T_ICON_FACTORY>, std::function<std::unique_ptr<Icon>()>> && std::same_as<std::decay_t<T_ACTIONS>, std::vector<Action>> && std::same_as<std::decay_t<T_INPUTACTION>, QString>) |
| static std::shared_ptr< StandardItem > | make (T_ID &&id, T_TEXT &&text, T_SUBTEXT &&subtext, T_ICON_FACTORY &&icon_factory, T_ACTIONS &&actions=std::vector< Action >{}, T_INPUTACTION &&input_action_text=QString{}) noexcept |
| | Constructs a shared_ptr holding a StandardItem with the contents initialized with the data passed.
|
| |