7#include "textgotolinewidget.h" 
    9#include <KLocalizedString> 
   19using namespace TextCustomEditor;
 
   21class Q_DECL_HIDDEN TextCustomEditor::TextGoToLineWidgetPrivate
 
   24    TextGoToLineWidgetPrivate() = 
default;
 
   26    QSpinBox *mSpinbox = 
nullptr;
 
   27    QPushButton *mGoToLine = 
nullptr;
 
   30TextGoToLineWidget::TextGoToLineWidget(
QWidget *parent)
 
   32    , d(new TextCustomEditor::TextGoToLineWidgetPrivate)
 
   35    hbox->setContentsMargins(2, 2, 2, 2);
 
   38    closeBtn->setIconSize(
QSize(16, 16));
 
   39    closeBtn->setToolTip(
i18nc(
"@info:tooltip", 
"Close"));
 
   40    closeBtn->setObjectName(QStringLiteral(
"closebutton"));
 
   41#ifndef QT_NO_ACCESSIBILITY 
   42    closeBtn->setAccessibleName(
i18n(
"Close"));
 
   45    closeBtn->setAutoRaise(
true);
 
   47    hbox->addWidget(closeBtn);
 
   49    auto lab = 
new QLabel(
i18nc(
"@label:textbox", 
"Go to Line:"));
 
   53    d->mSpinbox->setMinimum(1);
 
   54    d->mSpinbox->setObjectName(QStringLiteral(
"line"));
 
   56    hbox->addWidget(d->mSpinbox);
 
   58    d->mGoToLine->setFlat(
true);
 
   60    d->mGoToLine->setObjectName(QStringLiteral(
"gotoline"));
 
   61    hbox->addWidget(d->mGoToLine);
 
   63    d->mSpinbox->setFocus();
 
   64    d->mSpinbox->installEventFilter(
this);
 
   67TextGoToLineWidget::~TextGoToLineWidget()
 
   74bool TextGoToLineWidget::eventFilter(QObject *obj, QEvent *event)
 
   76    if (obj == d->mSpinbox) {
 
   78            auto e = 
static_cast<QKeyEvent *
>(event);
 
   88void TextGoToLineWidget::setMaximumLineCount(
int max)
 
   90    d->mSpinbox->setMaximum(max);
 
   93void TextGoToLineWidget::goToLine()
 
   96    d->mSpinbox->setFocus();
 
   97    d->mSpinbox->selectAll();
 
  100void TextGoToLineWidget::slotGoToLine()
 
  102    Q_EMIT moveToLine(d->mSpinbox->value());
 
  105void TextGoToLineWidget::showEvent(QShowEvent *e)
 
  108        d->mSpinbox->setFocus();
 
  113void TextGoToLineWidget::slotBlockCountChanged(
int numberBlockCount)
 
  116        setMaximumLineCount(numberBlockCount);
 
  120void TextGoToLineWidget::slotCloseBar()
 
  126bool TextGoToLineWidget::event(QEvent *e)
 
  134        auto kev = 
static_cast<QKeyEvent *
>(e);
 
  144#include "moc_textgotolinewidget.cpp" 
QString i18nc(const char *context, const char *text, const TYPE &arg...)
 
QString i18n(const char *text, const TYPE &arg...)
 
bool spontaneous() const const
 
QIcon fromTheme(const QString &name)
 
virtual bool eventFilter(QObject *watched, QEvent *event)
 
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)