diff options
Diffstat (limited to 'src/kitemviews/private')
| -rw-r--r-- | src/kitemviews/private/kitemlistroleeditor.cpp | 1 | ||||
| -rw-r--r-- | src/kitemviews/private/kitemlistroleeditor.h | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/kitemviews/private/kitemlistroleeditor.cpp b/src/kitemviews/private/kitemlistroleeditor.cpp index f305fadac..ea03dfa38 100644 --- a/src/kitemviews/private/kitemlistroleeditor.cpp +++ b/src/kitemviews/private/kitemlistroleeditor.cpp @@ -139,6 +139,7 @@ void KItemListRoleEditor::autoAdjustSize() { const qreal frameBorder = 2 * frameWidth(); + document()->adjustSize(); const qreal requiredWidth = document()->size().width(); const qreal availableWidth = size().width() - frameBorder; if (requiredWidth > availableWidth) { diff --git a/src/kitemviews/private/kitemlistroleeditor.h b/src/kitemviews/private/kitemlistroleeditor.h index 18304374d..eb8a9cb5e 100644 --- a/src/kitemviews/private/kitemlistroleeditor.h +++ b/src/kitemviews/private/kitemlistroleeditor.h @@ -51,17 +51,17 @@ Q_SIGNALS: void roleEditingFinished(const QByteArray &role, const QVariant &value); void roleEditingCanceled(const QByteArray &role, const QVariant &value); -protected: - bool event(QEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - -private Q_SLOTS: +public Q_SLOTS: /** * Increases the size of the editor in case if there is not * enough room for the text. */ void autoAdjustSize(); +protected: + bool event(QEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + private: /** * Emits the signal roleEditingFinished if m_blockFinishedSignal |
