diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-10-28 14:08:45 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-10-29 11:02:40 +0100 |
commit | 0470de6c2529856518efa809edf3ad475eaad6bc (patch) | |
tree | 803985e04c60d911199b026b815399614985d716 /src/imports | |
parent | ce11c70fbbb46505d52541f7bfddec81cdcf9432 (diff) |
Native style/Button: Avoid that the label gets elided
This was observed on Button on Windows style, where the labels size
hint was a fractional number (e.g. 38.26). This got truncated by
QQuickStyleItem::contentSize(), which caused the content item to get
less space than it actually needed
It was only observed on Button, but it was likely to also happen
with other control types.
Change-Id: I50b98fa7d54e5be2cedeeaf60018367689f168cf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/nativestyle/items/qquickstyleitem.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/imports/nativestyle/items/qquickstyleitem.h b/src/imports/nativestyle/items/qquickstyleitem.h index 237744fd..7fde3de9 100644 --- a/src/imports/nativestyle/items/qquickstyleitem.h +++ b/src/imports/nativestyle/items/qquickstyleitem.h @@ -244,7 +244,7 @@ protected: static QStyle::State controlSize(QQuickItem *item); void initStyleOptionBase(QStyleOption &styleOption); - inline QSize contentSize() { return m_contentSize.toSize(); } + inline QSize contentSize() { return QSize(qCeil(m_contentSize.width()), qCeil(m_contentSize.height())); } inline static QStyle *style() { return QQuickNativeStyle::style(); } template <class T> inline const T* control() const { |