X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuisupport%2Fmultilineedit.cpp;h=c56b03cd91a18e7a52dd5ef4786afa8363fa275f;hb=99678e189313b168c410fa15cd10cb673b73c8a2;hp=aed4af79a38d132da42a6a003c3b8d6ef7ac1477;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49;p=quassel.git diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index aed4af79..c56b03cd 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -53,7 +53,7 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) #endif setMode(SingleLine); - setWordWrapEnabled(false); + setLineWrapEnabled(false); reset(); connect(this, SIGNAL(textChanged()), this, SLOT(on_textChanged())); @@ -98,6 +98,13 @@ void MultiLineEdit::setMode(Mode mode) } +void MultiLineEdit::setLineWrapEnabled(bool enable) +{ + setLineWrapMode(enable ? WidgetWidth : NoWrap); + updateSizeHint(); +} + + void MultiLineEdit::setMinHeight(int lines) { if (lines == _minHeight) @@ -207,13 +214,6 @@ void MultiLineEdit::setSpellCheckEnabled(bool enable) } -void MultiLineEdit::setWordWrapEnabled(bool enable) -{ - setLineWrapMode(enable ? WidgetWidth : NoWrap); - updateSizeHint(); -} - - void MultiLineEdit::setPasteProtectionEnabled(bool enable, QWidget *) { _pasteProtectionEnabled = enable; @@ -301,7 +301,7 @@ void MultiLineEdit::keyPressEvent(QKeyEvent *event) if (event == QKeySequence::InsertLineSeparator) { #else -# ifdef Q_WS_MAC +# ifdef Q_OS_MAC if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && event->modifiers() & Qt::META) { # else if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && event->modifiers() & Qt::SHIFT) { @@ -726,7 +726,7 @@ void MultiLineEdit::on_textChanged() msg += "...

"; QMessageBox question(QMessageBox::NoIcon, tr("Paste Protection"), msg, QMessageBox::Yes|QMessageBox::No); question.setDefaultButton(QMessageBox::No); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC question.setWindowFlags(question.windowFlags() | Qt::Sheet); #endif if (question.exec() != QMessageBox::Yes)