DateEdit::DateEdit(QWidget *parent) : QLineEdit(parent) { setValidator(new DateValidator(this)); #if COMPAT_QT_VERSION >= 0x030200 setInputMask("00/00/0000;_"); #endif }
IPAddrCtrl::IPAddrCtrl(QWidget *parent) : QLineEdit(parent) { QRegExp ipAddrREStr("^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$"); QRegExp ipAddrRegExp(ipAddrREStr); ipAddrValidator = new QRegExpValidator(ipAddrRegExp, this); setInputMask("000.000.000.000"); connect(this, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString))); }
void LineEdit::setUndefined(bool enabled = true) { this->blockSignals(true); itsUndefined = enabled; if (enabled) { blockSignals(true); QLineEdit::setInputMask(""); QLineEdit::setText(MULTIPLE_VALUE_TEXT); itsPreviousText = text(); } else { setInputMask(itsInputMask); setText(itsPreviousText); } this->blockSignals(false); }
QHexLineEdit::QHexLineEdit(QWidget *parent) : QLineEdit(parent) { //setStyleSheet("QLineEdit { padding: 0px 0px 0px 13px; }"); QString mask = ">"; if (m_byteLength > 0) { for (int _ = 0; _ < m_byteLength; ++_) { mask.append("HH"); } } else mask.append("H"); setInputMask(mask); }
DateEdit::DateEdit(QWidget *parent) : QLineEdit(parent) { setValidator(new DateValidator(this)); setInputMask("00/00/0000;_"); }
int QLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 21) qt_static_metacall(this, _c, _id, _a); _id -= 21; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = inputMask(); break; case 1: *reinterpret_cast< QString*>(_v) = text(); break; case 2: *reinterpret_cast< int*>(_v) = maxLength(); break; case 3: *reinterpret_cast< bool*>(_v) = hasFrame(); break; case 4: *reinterpret_cast< EchoMode*>(_v) = echoMode(); break; case 5: *reinterpret_cast< QString*>(_v) = displayText(); break; case 6: *reinterpret_cast< int*>(_v) = cursorPosition(); break; case 7: *reinterpret_cast< Qt::Alignment*>(_v) = alignment(); break; case 8: *reinterpret_cast< bool*>(_v) = isModified(); break; case 9: *reinterpret_cast< bool*>(_v) = hasSelectedText(); break; case 10: *reinterpret_cast< QString*>(_v) = selectedText(); break; case 11: *reinterpret_cast< bool*>(_v) = dragEnabled(); break; case 12: *reinterpret_cast< bool*>(_v) = isReadOnly(); break; case 13: *reinterpret_cast< bool*>(_v) = isUndoAvailable(); break; case 14: *reinterpret_cast< bool*>(_v) = isRedoAvailable(); break; case 15: *reinterpret_cast< bool*>(_v) = hasAcceptableInput(); break; case 16: *reinterpret_cast< QString*>(_v) = placeholderText(); break; case 17: *reinterpret_cast< Qt::CursorMoveStyle*>(_v) = cursorMoveStyle(); break; } _id -= 18; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setInputMask(*reinterpret_cast< QString*>(_v)); break; case 1: setText(*reinterpret_cast< QString*>(_v)); break; case 2: setMaxLength(*reinterpret_cast< int*>(_v)); break; case 3: setFrame(*reinterpret_cast< bool*>(_v)); break; case 4: setEchoMode(*reinterpret_cast< EchoMode*>(_v)); break; case 6: setCursorPosition(*reinterpret_cast< int*>(_v)); break; case 7: setAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break; case 8: setModified(*reinterpret_cast< bool*>(_v)); break; case 11: setDragEnabled(*reinterpret_cast< bool*>(_v)); break; case 12: setReadOnly(*reinterpret_cast< bool*>(_v)); break; case 16: setPlaceholderText(*reinterpret_cast< QString*>(_v)); break; case 17: setCursorMoveStyle(*reinterpret_cast< Qt::CursorMoveStyle*>(_v)); break; } _id -= 18; } else if (_c == QMetaObject::ResetProperty) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 18; } #endif // QT_NO_PROPERTIES return _id; }