X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fmultilineedit.cpp;h=19c222fecb9cec78a562d67992087f61c56244ba;hb=2c8434f74c68194d56f2084f637419123e61d18b;hp=2c9d5947691131682441efae0055aa946b134d40;hpb=ab7ef4d24f62b5848b628482b7762ebfc0b53e1a;p=quassel.git diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index 2c9d5947..19c222fe 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); @@ -62,7 +52,7 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) // Prevent QTextHtmlImporter::appendNodeText from eating whitespace document()->setDefaultStyleSheet("span { white-space: pre-wrap; }"); - connect(this, SIGNAL(textChanged()), this, SLOT(on_textChanged())); + connect(this, &QTextEdit::textChanged, this, &MultiLineEdit::on_textChanged); _mircColorMap["00"] = "#ffffff"; _mircColorMap["01"] = "#000000"; @@ -83,10 +73,6 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) } -MultiLineEdit::~MultiLineEdit() -{ -} - #if defined HAVE_SONNET && !defined HAVE_KDE Sonnet::Highlighter *MultiLineEdit::highlighter() const { @@ -110,7 +96,7 @@ void MultiLineEdit::contextMenuEvent(QContextMenuEvent *event) auto action = menu->addAction(tr("Auto Spell Check")); action->setCheckable(true); action->setChecked(highlighter()->isActive()); - connect(action, SIGNAL(toggled(bool)), this, SLOT(setSpellCheckEnabled(bool))); + connect(action, &QAction::toggled, this, &MultiLineEdit::setSpellCheckEnabled); menu->exec(event->globalPos()); delete menu; @@ -227,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; @@ -312,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)) {