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);
// 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";
}
-MultiLineEdit::~MultiLineEdit()
-{
-}
-
#if defined HAVE_SONNET && !defined HAVE_KDE
Sonnet::Highlighter *MultiLineEdit::highlighter() const
{
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;
QSize MultiLineEdit::sizeHint() const
{
if (!_sizeHint.isValid()) {
- MultiLineEdit *that = const_cast<MultiLineEdit *>(this);
+ auto *that = const_cast<MultiLineEdit *>(this);
that->updateSizeHint();
}
return _sizeHint;
{
// We need to make sure that global shortcuts aren't eaten
if (e->type() == QEvent::ShortcutOverride) {
- QKeyEvent *event = static_cast<QKeyEvent *>(e);
+ auto *event = static_cast<QKeyEvent *>(e);
QKeySequence key = QKeySequence(event->key() | event->modifiers());
foreach(QAction *action, GraphicalUi::actionCollection()->actions()) {
if (action->shortcuts().contains(key)) {