93 Dec =
new QAction ( tr (
"Dec" ),
this );
94 Dec->setShortcutContext ( Qt::WidgetShortcut );
95 connect ( Dec, SIGNAL ( triggered() ),
this, SLOT ( EmitDecSlot() ) );
96 Dec->setCheckable (
true );
97 Dec->setChecked (
false );
98 ContextMenu->addAction ( Dec );
100 Oct =
new QAction ( tr (
"Oct" ),
this );
101 Oct->setShortcutContext ( Qt::WidgetShortcut );
102 connect ( Oct, SIGNAL ( triggered() ),
this, SLOT ( EmitOctSlot() ) );
103 Oct->setCheckable (
true );
104 Oct->setChecked (
false );
105 ContextMenu->addAction ( Oct );
107 Hex =
new QAction ( tr (
"Hex" ),
this );
108 Hex->setShortcutContext ( Qt::WidgetShortcut );
109 Hex->setCheckable (
true );
110 Hex->setChecked (
false );
111 connect ( Hex, SIGNAL ( triggered() ),
this, SLOT ( EmitHexSlot() ) );
112 ContextMenu->addAction ( Hex );
117 QString tmp_st = this->toPlainText();
120 if ( tmp_st.isEmpty() && NullCheck )
127 setToolTip ( QString (
"Field cannot be empty!" ) );
130 emit StringValidated();
132 else if ( Validator != 0 )
134 if ( ( Validator->validate ( tmp_st, i ) ) == QValidator::Acceptable )
137 this->setPalette ( QApplication::palette (
this ) );
138 setToolTip ( QString (
"This new object ID is unique" ) );
140 else if ( ( Validator->validate ( tmp_st, i ) ) == QValidator::Intermediate )
144 setToolTip ( QString (
"This UID is already used" ) );
147 else if ( Validator == 0 )
150 setPalette ( QApplication::palette (
this ) );
152 if ( tmp_st == DefaultValue && CheckDefault )
158 this->setPalette ( QApplication::palette (
this ) );
161 emit StringValidated();
void SetDefaultValue(QString ValueDefault)
string_attr_text_edit(QWidget *parent=0, bool IsNull=true, bool IsMulti=false)
Include Qt Headers.
void SetMultiCheck(bool IsMulti)
void contextMenuEvent(QContextMenuEvent *Event)
void SetValidator(QValidator *ValidatorSet)
void SetCheckDefault(bool Default)
void SetLoadedDefaultFlag(bool Loaded)
void SetNullCheck(bool IsNull)