QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
CustomElementInfoPartWidget Class Reference

The CustomElementInfoPartWidget class A single row letting the user define their own element information key/value pair, unlike ElementInfoPartWidget which is bound to one predefined key. The key is validated against DiagramContext::isKeyAcceptable() as the user types. More...

#include <customelementinfopartwidget.h>

Inherits QWidget.

Collaboration diagram for CustomElementInfoPartWidget:
Collaboration graph

Signals

void changed ()
void removeRequested (CustomElementInfoPartWidget *self)

Public Member Functions

 CustomElementInfoPartWidget (const QString &key=QString(), const QString &value=QString(), QWidget *parent=nullptr)
 CustomElementInfoPartWidget::CustomElementInfoPartWidget Constructor.
 ~CustomElementInfoPartWidget () override
QString key () const
QString value () const
bool hasValidKey () const

Private Slots

void validateKey ()
 CustomElementInfoPartWidget::validateKey Flag the key field when it doesn't match the accepted format, instead of silently dropping it later.

Private Attributes

QLineEdit * m_key_edit
QLineEdit * m_value_edit
QToolButton * m_remove_button

Detailed Description

The CustomElementInfoPartWidget class A single row letting the user define their own element information key/value pair, unlike ElementInfoPartWidget which is bound to one predefined key. The key is validated against DiagramContext::isKeyAcceptable() as the user types.

Constructor & Destructor Documentation

◆ CustomElementInfoPartWidget()

CustomElementInfoPartWidget::CustomElementInfoPartWidget ( const QString & key = QString(),
const QString & value = QString(),
QWidget * parent = nullptr )
explicit

CustomElementInfoPartWidget::CustomElementInfoPartWidget Constructor.

Parameters
keyinitial key name (empty for a freshly added row)
valueinitial value
parentparent widget
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CustomElementInfoPartWidget()

CustomElementInfoPartWidget::~CustomElementInfoPartWidget ( )
override

Member Function Documentation

◆ changed

void CustomElementInfoPartWidget::changed ( )
signal
Here is the caller graph for this function:

◆ hasValidKey()

bool CustomElementInfoPartWidget::hasValidKey ( ) const
Returns
true if the typed key is non-empty and matches DiagramContext::isKeyAcceptable()
Here is the call graph for this function:

◆ key()

QString CustomElementInfoPartWidget::key ( ) const
Returns
the key name currently typed in this row
Here is the caller graph for this function:

◆ removeRequested

void CustomElementInfoPartWidget::removeRequested ( CustomElementInfoPartWidget * self)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateKey

void CustomElementInfoPartWidget::validateKey ( )
privateslot

CustomElementInfoPartWidget::validateKey Flag the key field when it doesn't match the accepted format, instead of silently dropping it later.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ value()

QString CustomElementInfoPartWidget::value ( ) const
Returns
the value currently typed in this row
Here is the caller graph for this function:

Member Data Documentation

◆ m_key_edit

QLineEdit* CustomElementInfoPartWidget::m_key_edit
private

◆ m_remove_button

QToolButton* CustomElementInfoPartWidget::m_remove_button
private

◆ m_value_edit

QLineEdit* CustomElementInfoPartWidget::m_value_edit
private

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