diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-07-11 16:39:26 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-07-11 15:44:38 +0200 |
commit | 726847e48c30e45bcdcf6e5bde66552f1d56b9eb (patch) | |
tree | e578d0923a843a6bf1bbc3bb695a55fed0c896aa /src/plugins/bookmarks | |
parent | 53ddc32e93bff15549bcbf53c644e2c650439b1e (diff) | |
download | qt-creator-726847e48c30e45bcdcf6e5bde66552f1d56b9eb.tar.gz |
Bookmarks: Use a spinbox for line number
Change-Id: I42b00caf1d744d79af93e7100daa8fed5f8a29a8
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/bookmarks')
-rw-r--r-- | src/plugins/bookmarks/bookmarkmanager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index d42d26ea04..fb7fad931f 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -56,6 +56,7 @@ #include <QLineEdit> #include <QMenu> #include <QPainter> +#include <QSpinBox> Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*) @@ -695,16 +696,17 @@ void BookmarkManager::edit() auto layout = new QFormLayout(&dlg); auto noteEdit = new QLineEdit(b->note()); noteEdit->setMinimumWidth(300); - auto lineNumberEdit = new QLineEdit(QString::number(b->lineNumber())); + auto lineNumberSpinbox = new QSpinBox; + lineNumberSpinbox->setRange(1, INT_MAX); + lineNumberSpinbox->setValue(b->lineNumber()); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(buttonBox, SIGNAL(accepted()), &dlg, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), &dlg, SLOT(reject())); - lineNumberEdit->setValidator(new QIntValidator(1, INT_MAX)); layout->addRow(tr("Note text:"), noteEdit); - layout->addRow(tr("Line number:"), lineNumberEdit); + layout->addRow(tr("Line number:"), lineNumberSpinbox); layout->addWidget(buttonBox); if (dlg.exec() == QDialog::Accepted) { - b->move(lineNumberEdit->text().toInt()); + b->move(lineNumberSpinbox->value()); b->updateNote(noteEdit->text().replace(QLatin1Char('\t'), QLatin1Char(' '))); emit dataChanged(current, current); saveBookmarks(); |