API Documentation
Loading...
Searching...
No Matches
ModelChooserCombo Class Reference

#include <ModelChooserCombo.h>

Inheritance diagram for ModelChooserCombo:
[legend]
Collaboration diagram for ModelChooserCombo:
[legend]

Signals

void newModelSelectedSignal ()
 
void modelSelectedSignal (UUID id)
 
- Signals inherited from QCustomComboBox
void edited ()
 

Public Member Functions

 ModelChooserCombo (QWidget *parent=nullptr)
 
void setIncludeParentName (bool include_parent_name, const String &parent_type=String())
 
void setIncludePath (bool include_parent_name, const String &parent_type=String())
 
void setManager (QTModelManager *manager)
 
bool canAddModel (const Model &model)
 
bool isModelAllowed (const Model &model)
 
void setModelFilter (const std::function< bool(const Model &)> &model_filter)
 
void setModelType (const String &type)
 
void setIDs (const Buffer< UUID > &ids)
 
void addID (const UUID &id)
 
void removeID (const UUID &id)
 
void setModels (const Buffer< Model > &models)
 
TranslatedString displayName (const Model &m)
 
void refreshFromManager ()
 
void setAllowNew (bool allow_new, const TranslatedString &new_title)
 
void setCurrentSelection (UUID id)
 
void setToNew ()
 
bool isNewSelected () const
 
void setExclusionList (const Buffer< UUID > &exclusion_list)
 
UUID selectedID () const
 
virtual void onSorted (const Buffer< uint04 > &sorted_indices)
 
void setDisplayNameCallback (std::function< TranslatedString(const Model &)> &callback)
 
void setModelParentID (const UUID &parent)
 
- Public Member Functions inherited from QCustomComboBox
 QCustomComboBox (QWidget *parent=nullptr)
 
const QCustomValidatorcustomValidator () const
 
QCustomValidatorcustomValidator ()
 
void setCustomValidator (const QCustomValidator &validator)
 
void setup (const TranslatedString &title, const Buffer< TranslatedString > &values)
 
void setup (const TranslatedString &title, const Buffer< String > &values, const Buffer< TranslatedString > &display_values)
 
bool isUsingCustom () const
 
template<class t_object >
void setup (const TranslatedString &title, const Buffer< std::pair< TranslatedString, t_object > > &items)
 
template<class t_object >
std::enable_if< ObjectInfo< t_object >::Enum >::type setup (const TranslatedString &title, const Buffer< t_object > &items)
 
template<class t_object >
std::enable_if< ObjectInfo< t_object >::Number >::type setup (const TranslatedString &title, const Buffer< t_object > &items)
 
template<class t_enum >
std::enable_if< ObjectInfo< t_enum >::Enum >::type setup (const TranslatedString &title, uint04 size)
 
template<class t_object >
std::enable_if<!ObjectInfo< t_object >::Enum &&!ObjectInfo< t_object >::Number >::type setup (const TranslatedString &title, const Buffer< t_object > &items)
 
template<class t_enum >
std::enable_if< ObjectInfo< t_enum >::Enum >::type setup (const TranslatedString &title, t_enum first, t_enum last)
 
template<class t_type >
void add (const t_type &value, const TranslatedString &display_value, bool refresh_widget=false)
 
template<class t_type >
void remove (const t_type &value, bool refresh_widget=false)
 
void refresh ()
 
template<class t_type >
void setupResource (const TranslatedString &title, Resource< t_type > &resource)
 
void setAutoFormat (bool auto_format)
 
template<class t_enum >
std::enable_if< ObjectInfo< t_enum >::Enum >::type set (t_enum value)
 
template<class t_type >
t_type getAs () const
 
template<class t_type >
t_type getAs (uint04 index) const
 
template<class t_type >
void setValue (const t_type &t_value)
 
void setValue (const TranslatedString &t_value)
 
void setTitle (const TranslatedString &title)
 
void clearValue ()
 
QSize minimumSizeHint () const override
 
QSize sizeHint () const override
 
fltp08 getUnitValue () const
 
Angle< fltp08getUnitAngle () const
 
void setValue (const String &value)
 
void setToolTip (const TranslatedString &tooltip)
 
void setUnitType (UnitType unit, uint01 dimension=Constant< uint01 >::NaN)
 
void setConstantUnit (const ConstPointer< Unit > &unit, uint01 dimension=Constant< uint01 >::NaN)
 
void setCustomUnit (const String &unit, UnitType fallback_unit, uint01 dimension=Constant< uint01 >::NaN)
 
void setUnitValue (fltp08 value, uint01 unit_dimension=0)
 
void setAllowCustom (bool allow_custom)
 
void setSuffix (const TranslatedString &suffix)
 
const TranslatedStringsuffix () const
 
void focusInEvent (QFocusEvent *e) override
 
void updateFontSize ()
 
bool event (QEvent *event) override
 
void sortAlphabetically (uint04 start=0, uint04 size=Constant< uint04 >::NaN)
 
const Buffer< String > & values () const
 
const Buffer< TranslatedString > & displayValues () const
 
void showPopup () override
 
void hidePopup () override
 
void resizeEvent (QResizeEvent *event) override
 
void paintEvent (QPaintEvent *) override
 
void wheelEvent (QWheelEvent *e) override
 
void lockInCustomValue ()
 

Protected Slots

void onObjectsDeletedSlot ()
 
void onObjectAddedSlot (const Buffer< UUID > &ids)
 
void addModel (const Model &m)
 
void onObjectUpdatedSlot (Buffer< UUID > ids)
 
void onEdited ()
 
- Protected Slots inherited from QCustomComboBox
void onEdit ()
 
void onEditTextChangedSlot ()
 
void onChange ()
 

Protected Member Functions

void _removeID (const UUID &id)
 
void _addModel (const Model &m)
 
- Protected Member Functions inherited from QCustomComboBox
void refreshWidget ()
 
void adjustLineEditSize ()
 

Protected Attributes

Set< UUIDm_exclusion_list
 
std::function< TranslatedString(const Model &)> m_display_name_callback
 
Dictionary< UUID, uint04m_models
 
Dictionary< UUID, Buffer< UUID > > m_model_parents
 
UUID m_model_parent = Constant<UUID>::NaN
 
String m_model_type
 
String m_parent_type
 
QTModelManagerm_manager
 
std::function< bool(const Model &)> m_model_filter
 
bool m_allow_add_new
 
bool m_include_parent_name
 
bool m_include_path
 
- Protected Attributes inherited from QCustomComboBox
bool m_is_refreshing = false
 
bool m_is_changing = false
 
bool m_allow_custom
 
bool m_using_custom
 
bool m_auto_format
 
bool m_sort_alphabetically = false
 
bool m_is_showing_popup = false
 
uint04 m_custom_index
 
uint04 m_sort_offset = 0
 
uint04 m_last_index
 
Buffer< Stringm_values
 
Buffer< TranslatedStringm_display_values
 
String m_current_custom
 
TranslatedString m_suffix
 
QCustomLineEditm_line_edit
 
Dictionary< uint04, uint04enum_to_index
 
Dictionary< uint04, uint04index_to_enum
 
QTResourceListenerm_resource_changed_listener
 

Constructor & Destructor Documentation

◆ ModelChooserCombo()

ModelChooserCombo ( QWidget * parent = nullptr)

Member Function Documentation

◆ _addModel()

void _addModel ( const Model & m)
protected

◆ _removeID()

void _removeID ( const UUID & id)
protected

◆ addID()

void addID ( const UUID & id)

◆ addModel

void addModel ( const Model & m)
inlineprotectedslot

◆ canAddModel()

bool canAddModel ( const Model & model)
inline

◆ displayName()

TranslatedString displayName ( const Model & m)

◆ isModelAllowed()

bool isModelAllowed ( const Model & model)

◆ isNewSelected()

bool isNewSelected ( ) const
inline

◆ modelSelectedSignal

void modelSelectedSignal ( UUID id)
signal

◆ newModelSelectedSignal

void newModelSelectedSignal ( )
signal

◆ onEdited

void onEdited ( )
protectedslot

◆ onObjectAddedSlot

void onObjectAddedSlot ( const Buffer< UUID > & ids)
protectedslot

◆ onObjectsDeletedSlot

void onObjectsDeletedSlot ( )
protectedslot

◆ onObjectUpdatedSlot

void onObjectUpdatedSlot ( Buffer< UUID > ids)
protectedslot

◆ onSorted()

void onSorted ( const Buffer< uint04 > & sorted_indices)
virtual

Reimplemented from QCustomComboBox.

◆ refreshFromManager()

void refreshFromManager ( )
inline

◆ removeID()

void removeID ( const UUID & id)
inline

◆ selectedID()

UUID selectedID ( ) const
inline

◆ setAllowNew()

void setAllowNew ( bool allow_new,
const TranslatedString & new_title )

◆ setCurrentSelection()

void setCurrentSelection ( UUID id)

◆ setDisplayNameCallback()

void setDisplayNameCallback ( std::function< TranslatedString(const Model &)> & callback)
inline

◆ setExclusionList()

void setExclusionList ( const Buffer< UUID > & exclusion_list)
inline

◆ setIDs()

void setIDs ( const Buffer< UUID > & ids)
inline

◆ setIncludeParentName()

void setIncludeParentName ( bool include_parent_name,
const String & parent_type = String() )

◆ setIncludePath()

void setIncludePath ( bool include_parent_name,
const String & parent_type = String() )

◆ setManager()

void setManager ( QTModelManager * manager)

◆ setModelFilter()

void setModelFilter ( const std::function< bool(const Model &)> & model_filter)
inline

◆ setModelParentID()

void setModelParentID ( const UUID & parent)

◆ setModels()

void setModels ( const Buffer< Model > & models)

◆ setModelType()

void setModelType ( const String & type)

◆ setToNew()

void setToNew ( )
inline

Member Data Documentation

◆ m_allow_add_new

bool m_allow_add_new
protected

◆ m_display_name_callback

std::function<TranslatedString(const Model&)> m_display_name_callback
protected

◆ m_exclusion_list

Set<UUID> m_exclusion_list
protected

◆ m_include_parent_name

bool m_include_parent_name
protected

◆ m_include_path

bool m_include_path
protected

◆ m_manager

QTModelManager* m_manager
protected

◆ m_model_filter

std::function<bool(const Model&)> m_model_filter
protected

◆ m_model_parent

UUID m_model_parent = Constant<UUID>::NaN
protected

◆ m_model_parents

Dictionary<UUID, Buffer<UUID> > m_model_parents
protected

◆ m_model_type

String m_model_type
protected

◆ m_models

Dictionary<UUID, uint04> m_models
protected

◆ m_parent_type

String m_parent_type
protected

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