From 1d357f6b33a7a062e6272c0afea8dfa0bcde78ec Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 8 Nov 2019 21:07:29 +0100 Subject: [PATCH] TextEditor: Make TextEditorLinkLabel elideable And use that in the Include and Type Hierarchy panels to allow resizing the panels smaller. Fixes: QTCREATORBUG-23197 Change-Id: Ia4b39e610c7a4be4df564dc69573f4748d7634a5 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 3 ++- src/plugins/texteditor/texteditor.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 84b947f4009..2d349cecb70 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8438,8 +8438,9 @@ void TextEditorWidget::setupGenericHighlighter() // TextEditorLinkLabel // TextEditorLinkLabel::TextEditorLinkLabel(QWidget *parent) - : QLabel(parent) + : Utils::ElidingLabel(parent) { + setElideMode(Qt::ElideMiddle); } void TextEditorLinkLabel::setLink(Utils::Link link) diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index d5a9a68ead1..dddfa54868a 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -35,10 +35,10 @@ #include #include +#include #include #include -#include #include #include #include @@ -611,7 +611,7 @@ private: friend class RefactorOverlay; }; -class TEXTEDITOR_EXPORT TextEditorLinkLabel : public QLabel +class TEXTEDITOR_EXPORT TextEditorLinkLabel : public Utils::ElidingLabel { public: TextEditorLinkLabel(QWidget *parent = nullptr);