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

#include <QCustomLineEdit.h>

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

Public Slots

void onFinishedSlot ()
 
void updateColor ()
 
void updateCharColors ()
 
void onEdited ()
 

Signals

void editedSignal ()
 
void editingFinishedSignal ()
 
void inputHintChangedSignal ()
 

Public Member Functions

 QCustomLineEdit (QWidget *parent=Q_NULLPTR)
 
 QCustomLineEdit (const QString &value, QWidget *parent=Q_NULLPTR)
 
 ~QCustomLineEdit ()
 
virtual void setTitle (const TranslatedString &title)
 
QCustomValidatorcustomValidator ()
 
const QCustomValidatorcustomValidator () const
 
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 setUnitType (UnitType unit, uint01 dimension=Constant< uint01 >::NaN)
 
void setAsKeyboardFocus ()
 
bool isValid () const
 
void setEditable (bool editable)
 
bool isEditable () const
 
bool isEditing () const
 
bool hasUserFocus () const
 
void clearBackgroundColor ()
 
void setInputHint (const TranslatedString &hint)
 
void clearInputHint ()
 
void setToolTip (const TranslatedString &tooltip)
 
String getValue (bool allow_placeholder) const
 
String getValue () const
 
template<class t_angle_type >
void setUnitValue (Angle< t_angle_type > value)
 
void setUnitValue (fltp08 value)
 
void setPlaceHolderUnitValue (fltp08 value)
 
template<class t_angle_type = fltp08>
Angle< t_angle_type > getUnitAngle (bool allow_placeholder=true) const
 
fltp08 getUnitValue (bool allow_placeholder=true) const
 
template<class t_type >
void setup (const TranslatedString &title)
 
void setup (const TranslatedString &title, UnitType unit_type, uint01 dim=Constant< uint01 >::NaN)
 
void setup (const TranslatedString &title, const TypeInfo &type)
 
void setup (GenericOption &option)
 
template<class t_type >
void setup (ApplicationOption< t_type > &option)
 
template<class t_type >
void setup (const TranslatedString &title, Resource< t_type > &resource)
 
void setup (const TranslatedString &title, Resource< String > &resource)
 
void setAllowPlaceholderAsValue (bool allow)
 
template<class t_type >
t_type getAs (bool allow_placeholder) const
 
template<class t_type >
t_type getAs () const
 
template<class t_type >
std::enable_if< ObjectInfo< t_type >::Number, void >::type setValue (const t_type &input_value)
 
template<class t_type >
std::enable_if<!ObjectInfo< t_type >::Number, void >::type setValue (const t_type &input_value)
 
void setValue (const TimeSpan &input_value)
 
void setValue (const Angle< sint04 > &input_value)
 
void setValue (const Angle< fltp08 > &input_value)
 
void setBackgroundColor (const RGBColor &color)
 
RGBColor backgroundColor () const
 
template<class t_type >
void setPlaceholderValue (const t_type &input_value, bool allow_placeholder_as_value=true)
 
void setPlaceholderValue (const TranslatedString &input_value, bool allow_placeholder_as_value=true)
 
QSize sizeHint () const override
 
QSize minimumSizeHint () const override
 
void wheelEvent (QWheelEvent *event) override
 
void forceValue (const String &units)
 
bool event (QEvent *event) override
 
const TranslatedStringinputHint () const
 
void updateHints ()
 
void setStep (fltp08 step)
 
void setAutoShowTooltip (bool auto_show_tooltip)
 
void setPlaceholderText (const QString &value)
 
void startUserEdit (bool select_all=true)
 
void setFontMultiplier (fltp04 font_multiplier)
 
void setBold (bool is_bold)
 

Static Public Member Functions

static bool UseKeypad ()
 

Protected Member Functions

void _setInputHint (const TranslatedString &hint)
 
void paintEvent (QPaintEvent *event) override
 
void setupForUnit (const ConstPointer< Unit > &unit, uint01 dimension=Constant< uint01 >::NaN)
 
virtual void mousePressEvent (QMouseEvent *e) override
 
virtual void focusInEvent (QFocusEvent *e) override
 
virtual void focusOutEvent (QFocusEvent *e) override
 
virtual void creatUnitLister ()
 
void updateFont ()
 
void _setBackgroundColor (const RGBColor &color)
 

Protected Attributes

String m_current_value
 
String m_fixed_up_current_value
 
String m_last_valid
 
String m_custom_unit
 
TranslatedString m_input_hint
 
TranslatedString m_custom_input_hint
 
TranslatedString m_title
 
TranslatedString m_tooltip
 
RGBColor m_background_color = Constant<RGBColor>::NaN
 
QTResourceListenerm_resource_changed_listener = nullptr
 
QTResourceListenerm_unit_changed_listener = nullptr
 
QCustomValidator m_validator
 
fltp04 m_font_multiplier = 1.0f
 
bool m_is_editable = true
 
bool m_auto_show_tooltip = true
 
bool m_suppress_focus_out = false
 
bool m_allow_placeholder_as_value = true
 
bool m_is_bold = false
 
bool m_ignore_focus_lock = false
 
bool m_has_edited = false
 

Constructor & Destructor Documentation

◆ QCustomLineEdit() [1/2]

QCustomLineEdit ( QWidget * parent = Q_NULLPTR)
explicit

◆ QCustomLineEdit() [2/2]

QCustomLineEdit ( const QString & value,
QWidget * parent = Q_NULLPTR )
explicit

◆ ~QCustomLineEdit()

Member Function Documentation

◆ _setBackgroundColor()

void _setBackgroundColor ( const RGBColor & color)
protected

◆ _setInputHint()

void _setInputHint ( const TranslatedString & hint)
protected

◆ backgroundColor()

RGBColor backgroundColor ( ) const

◆ clearBackgroundColor()

void clearBackgroundColor ( )

◆ clearInputHint()

void clearInputHint ( )

◆ creatUnitLister()

void creatUnitLister ( )
protectedvirtual

◆ customValidator() [1/2]

QCustomValidator & customValidator ( )

◆ customValidator() [2/2]

const QCustomValidator & customValidator ( ) const

◆ editedSignal

void editedSignal ( )
signal

◆ editingFinishedSignal

void editingFinishedSignal ( )
signal

◆ event()

bool event ( QEvent * event)
override

◆ focusInEvent()

void focusInEvent ( QFocusEvent * e)
overrideprotectedvirtual

Reimplemented in CommandLineEdit.

◆ focusOutEvent()

void focusOutEvent ( QFocusEvent * e)
overrideprotectedvirtual

◆ forceValue()

void forceValue ( const String & units)

◆ getAs() [1/2]

template<class t_type >
t_type getAs ( ) const
inline

◆ getAs() [2/2]

template<class t_type >
t_type getAs ( bool allow_placeholder) const
inline

◆ getUnitAngle()

template<class t_angle_type = fltp08>
Angle< t_angle_type > getUnitAngle ( bool allow_placeholder = true) const
inline

◆ getUnitValue()

fltp08 getUnitValue ( bool allow_placeholder = true) const

◆ getValue() [1/2]

String getValue ( ) const

◆ getValue() [2/2]

String getValue ( bool allow_placeholder) const

◆ hasUserFocus()

bool hasUserFocus ( ) const

◆ inputHint()

const TranslatedString & inputHint ( ) const

◆ inputHintChangedSignal

void inputHintChangedSignal ( )
signal

◆ isEditable()

bool isEditable ( ) const
inline

◆ isEditing()

bool isEditing ( ) const

◆ isValid()

bool isValid ( ) const

◆ minimumSizeHint()

QSize minimumSizeHint ( ) const
override

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent * e)
overrideprotectedvirtual

◆ onEdited

void onEdited ( )
slot

◆ onFinishedSlot

void onFinishedSlot ( )
slot

◆ paintEvent()

void paintEvent ( QPaintEvent * event)
overrideprotected

◆ setAllowPlaceholderAsValue()

void setAllowPlaceholderAsValue ( bool allow)

◆ setAsKeyboardFocus()

void setAsKeyboardFocus ( )

◆ setAutoShowTooltip()

void setAutoShowTooltip ( bool auto_show_tooltip)
inline

◆ setBackgroundColor()

void setBackgroundColor ( const RGBColor & color)

◆ setBold()

void setBold ( bool is_bold)

◆ setConstantUnit()

void setConstantUnit ( const ConstPointer< Unit > & unit,
uint01 dimension = Constant<uint01>::NaN )

◆ setCustomUnit()

void setCustomUnit ( const String & unit,
UnitType fallback_unit,
uint01 dimension = Constant<uint01>::NaN )

◆ setEditable()

void setEditable ( bool editable)

◆ setFontMultiplier()

void setFontMultiplier ( fltp04 font_multiplier)

◆ setInputHint()

void setInputHint ( const TranslatedString & hint)

◆ setPlaceholderText()

void setPlaceholderText ( const QString & value)

◆ setPlaceHolderUnitValue()

void setPlaceHolderUnitValue ( fltp08 value)

◆ setPlaceholderValue() [1/2]

template<class t_type >
void setPlaceholderValue ( const t_type & input_value,
bool allow_placeholder_as_value = true )
inline

◆ setPlaceholderValue() [2/2]

void setPlaceholderValue ( const TranslatedString & input_value,
bool allow_placeholder_as_value = true )

◆ setStep()

void setStep ( fltp08 step)

◆ setTitle()

void setTitle ( const TranslatedString & title)
virtual

Reimplemented in DesignObjectStringWidget.

◆ setToolTip()

void setToolTip ( const TranslatedString & tooltip)

◆ setUnitType()

void setUnitType ( UnitType unit,
uint01 dimension = Constant<uint01>::NaN )

◆ setUnitValue() [1/2]

template<class t_angle_type >
void setUnitValue ( Angle< t_angle_type > value)
inline

◆ setUnitValue() [2/2]

void setUnitValue ( fltp08 value)

◆ setup() [1/7]

template<class t_type >
void setup ( ApplicationOption< t_type > & option)
inline

◆ setup() [2/7]

template<class t_type >
void setup ( const TranslatedString & title)
inline

◆ setup() [3/7]

void setup ( const TranslatedString & title,
const TypeInfo & type )

◆ setup() [4/7]

void setup ( const TranslatedString & title,
Resource< String > & resource )

◆ setup() [5/7]

template<class t_type >
void setup ( const TranslatedString & title,
Resource< t_type > & resource )
inline

◆ setup() [6/7]

void setup ( const TranslatedString & title,
UnitType unit_type,
uint01 dim = Constant<uint01>::NaN )

◆ setup() [7/7]

void setup ( GenericOption & option)

◆ setupForUnit()

void setupForUnit ( const ConstPointer< Unit > & unit,
uint01 dimension = Constant<uint01>::NaN )
protected

◆ setValue() [1/5]

void setValue ( const Angle< fltp08 > & input_value)
inline

◆ setValue() [2/5]

void setValue ( const Angle< sint04 > & input_value)
inline

◆ setValue() [3/5]

template<class t_type >
std::enable_if< ObjectInfo< t_type >::Number, void >::type setValue ( const t_type & input_value)
inline

◆ setValue() [4/5]

template<class t_type >
std::enable_if<!ObjectInfo< t_type >::Number, void >::type setValue ( const t_type & input_value)
inline

◆ setValue() [5/5]

void setValue ( const TimeSpan & input_value)

◆ sizeHint()

QSize sizeHint ( ) const
override

◆ startUserEdit()

void startUserEdit ( bool select_all = true)

◆ updateCharColors

void updateCharColors ( )
slot

◆ updateColor

void updateColor ( )
slot

◆ updateFont()

void updateFont ( )
protected

◆ updateHints()

void updateHints ( )

◆ UseKeypad()

bool UseKeypad ( )
static

◆ wheelEvent()

void wheelEvent ( QWheelEvent * event)
override

Member Data Documentation

◆ m_allow_placeholder_as_value

bool m_allow_placeholder_as_value = true
protected

◆ m_auto_show_tooltip

bool m_auto_show_tooltip = true
protected

◆ m_background_color

RGBColor m_background_color = Constant<RGBColor>::NaN
protected

◆ m_current_value

String m_current_value
protected

◆ m_custom_input_hint

TranslatedString m_custom_input_hint
protected

◆ m_custom_unit

String m_custom_unit
protected

◆ m_fixed_up_current_value

String m_fixed_up_current_value
protected

◆ m_font_multiplier

fltp04 m_font_multiplier = 1.0f
protected

◆ m_has_edited

bool m_has_edited = false
protected

◆ m_ignore_focus_lock

bool m_ignore_focus_lock = false
protected

◆ m_input_hint

TranslatedString m_input_hint
protected

◆ m_is_bold

bool m_is_bold = false
protected

◆ m_is_editable

bool m_is_editable = true
protected

◆ m_last_valid

String m_last_valid
protected

◆ m_resource_changed_listener

QTResourceListener* m_resource_changed_listener = nullptr
protected

◆ m_suppress_focus_out

bool m_suppress_focus_out = false
protected

◆ m_title

TranslatedString m_title
protected

◆ m_tooltip

TranslatedString m_tooltip
protected

◆ m_unit_changed_listener

QTResourceListener* m_unit_changed_listener = nullptr
protected

◆ m_validator

QCustomValidator m_validator
protected

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