X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fmultilineedit.cpp;h=31335d1fa651800e0a1d92281a91b7a42e0fb209;hb=dba66762993507168b1a3de25cfd2d7bff0ff969;hp=0a7204a8ca05d6c89183640ad9ac189c6aa48232;hpb=0a43227b8cd44625f4881cc1545d42c8c8a4876c;p=quassel.git diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index 0a7204a8..31335d1f 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -90,6 +90,14 @@ MultiLineEdit::~MultiLineEdit() { } +#if defined HAVE_KF5 || defined HAVE_KDE4 +void MultiLineEdit::createHighlighter() +{ + KTextEdit::createHighlighter(); + if (highlighter()) + highlighter()->setAutomatic(false); +} +#endif void MultiLineEdit::setCustomFont(const QFont &font) { @@ -177,13 +185,21 @@ 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(); opt.midLineWidth = midLineWidth(); opt.state |= QStyle::State_Sunken; - QSize s = style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(100, h).expandedTo(QApplication::globalStrut()), this); + QWidget *widget = this; +#ifdef Q_OS_MAC + widget = 0; +#endif + QSize s = style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(100, h).expandedTo(QApplication::globalStrut()), widget); if (s != _sizeHint) { _sizeHint = s; updateGeometry();