Added SpellCheckUnderlineStyle theme hint.
Task-number: QTBUG-25115 Change-Id: I70abbed426ad8bebca51823ed5ce16f2f300b5cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
d728bfe793
commit
1f9ae50457
@ -86,7 +86,8 @@ public:
|
|||||||
DialogButtonBoxButtonsHaveIcons,
|
DialogButtonBoxButtonsHaveIcons,
|
||||||
UseFullScreenForPopupMenu,
|
UseFullScreenForPopupMenu,
|
||||||
KeyboardScheme,
|
KeyboardScheme,
|
||||||
UiEffects
|
UiEffects,
|
||||||
|
SpellCheckUnderlineStyle
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DialogType {
|
enum DialogType {
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
#include <qpalette.h>
|
#include <qpalette.h>
|
||||||
|
#include <qtextformat.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -101,6 +102,9 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
\value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations.
|
\value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations.
|
||||||
|
|
||||||
|
\value SpellCheckUnderlineStyle (int) A QTextCharFormat::UnderlineStyle specifying
|
||||||
|
the underline style used misspelled words when spell checking.
|
||||||
|
|
||||||
\sa themeHint(), QStyle::pixelMetric()
|
\sa themeHint(), QStyle::pixelMetric()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -167,6 +171,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const
|
|||||||
return QVariant(int(WindowsKeyboardScheme));
|
return QVariant(int(WindowsKeyboardScheme));
|
||||||
case UiEffects:
|
case UiEffects:
|
||||||
return QVariant(int(0));
|
return QVariant(int(0));
|
||||||
|
case SpellCheckUnderlineStyle:
|
||||||
|
return QVariant(int(QTextCharFormat::SpellCheckUnderline));
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@
|
|||||||
#include "qstatictext.h"
|
#include "qstatictext.h"
|
||||||
#include "qglyphrun.h"
|
#include "qglyphrun.h"
|
||||||
|
|
||||||
|
#include <qpa/qplatformtheme.h>
|
||||||
|
|
||||||
#include <private/qfontengine_p.h>
|
#include <private/qfontengine_p.h>
|
||||||
#include <private/qpaintengine_p.h>
|
#include <private/qpaintengine_p.h>
|
||||||
#include <private/qemulationpaintengine_p.h>
|
#include <private/qemulationpaintengine_p.h>
|
||||||
@ -6180,7 +6182,9 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
|
|||||||
const qreal underlinePos = pos.y() + qCeil(underlineOffset);
|
const qreal underlinePos = pos.y() + qCeil(underlineOffset);
|
||||||
|
|
||||||
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
|
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
|
||||||
underlineStyle = QTextCharFormat::SpellCheckUnderline; // ### Qt5 QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));
|
QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
|
||||||
|
if (theme)
|
||||||
|
underlineStyle = QTextCharFormat::UnderlineStyle(theme->themeHint(QPlatformTheme::SpellCheckUnderlineStyle).toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (underlineStyle == QTextCharFormat::WaveUnderline) {
|
if (underlineStyle == QTextCharFormat::WaveUnderline) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user