| 536 | } |
| 537 | |
| 538 | FormLineEdit::FormLineEdit(Okular::FormFieldText *text, PageView *pageView) |
| 539 | : QLineEdit(pageView->viewport()) |
| 540 | , FormWidgetIface(this, text) |
| 541 | { |
| 542 | int maxlen = text->maximumLength(); |
| 543 | if (maxlen >= 0) { |
| 544 | setMaxLength(maxlen); |
| 545 | } |
| 546 | setAlignment(text->textAlignment()); |
| 547 | setText(text->text()); |
| 548 | if (text->isPassword()) { |
| 549 | setEchoMode(QLineEdit::Password); |
| 550 | } |
| 551 | |
| 552 | m_prevCursorPos = cursorPosition(); |
| 553 | m_prevAnchorPos = cursorPosition(); |
| 554 | m_editing = false; |
| 555 | |
| 556 | connect(this, &QLineEdit::textEdited, this, &FormLineEdit::slotChanged); |
| 557 | connect(this, &QLineEdit::cursorPositionChanged, this, &FormLineEdit::slotChanged); |
| 558 | |
| 559 | setVisible(text->isVisible()); |
| 560 | } |
| 561 | |
| 562 | void FormLineEdit::setFormWidgetsController(FormWidgetsController *controller) |
| 563 | { |
nothing calls this directly
no test coverage detected