X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fmultilineedit.cpp;h=ac92235104057f846aed6c26b415ab4fbf76cf6c;hb=f9cd845a9119e0abf450a91d8802f5c1822dd638;hp=133a24338dd3e4b95ef7e83cba7e46fe8478b01d;hpb=488f17a85739983b6357a53bd9158d81b6ac2114;p=quassel.git diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index 133a2433..ac922351 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -31,17 +31,7 @@ const int leftMargin = 3; MultiLineEdit::MultiLineEdit(QWidget *parent) - : MultiLineEditParent(parent), - _idx(0), - _mode(SingleLine), - _singleLine(true), - _minHeight(1), - _maxHeight(5), - _scrollBarsEnabled(true), - _pasteProtectionEnabled(true), - _emacsMode(false), - _completionSpace(0), - _lastDocumentHeight(-1) + : MultiLineEditParent(parent) { document()->setDocumentMargin(0); @@ -83,11 +73,6 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) } -MultiLineEdit::~MultiLineEdit() -{ -} - - #if defined HAVE_SONNET && !defined HAVE_KDE Sonnet::Highlighter *MultiLineEdit::highlighter() const { @@ -206,11 +191,8 @@ void MultiLineEdit::updateSizeHint() // use the style to determine a decent size int h = qMin(qMax((int)document()->size().height() + scrollBarHeight, minPixelHeight), maxPixelHeight) + 2 * frameWidth(); -#if QT_VERSION < 0x050000 - QStyleOptionFrameV2 opt; -#else + QStyleOptionFrame opt; -#endif opt.initFrom(this); opt.rect = QRect(0, 0, 100, h); opt.lineWidth = lineWidth(); @@ -231,7 +213,7 @@ void MultiLineEdit::updateSizeHint() QSize MultiLineEdit::sizeHint() const { if (!_sizeHint.isValid()) { - MultiLineEdit *that = const_cast(this); + auto *that = const_cast(this); that->updateSizeHint(); } return _sizeHint; @@ -316,7 +298,7 @@ bool MultiLineEdit::event(QEvent *e) { // We need to make sure that global shortcuts aren't eaten if (e->type() == QEvent::ShortcutOverride) { - QKeyEvent *event = static_cast(e); + auto *event = static_cast(e); QKeySequence key = QKeySequence(event->key() | event->modifiers()); foreach(QAction *action, GraphicalUi::actionCollection()->actions()) { if (action->shortcuts().contains(key)) { @@ -745,11 +727,7 @@ void MultiLineEdit::on_textChanged() QString msg = tr("Do you really want to paste %n line(s)?", "", lines.count()); msg += "

"; for (int i = 0; i < 4; i++) { -#if QT_VERSION < 0x050000 - msg += Qt::escape(lines[i].left(40)); -#else msg += lines[i].left(40).toHtmlEscaped(); -#endif if (lines[i].count() > 40) msg += "..."; msg += "
";