From c9977e2a9cd582a347b7882a6c71c10ce71b376e Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 15 May 2020 14:37:14 +0100 Subject: [PATCH] Fix the minimum size of help text windows to the content size This could make help text windows bigger than the screen, if we want to go there then using a QLabel sub-class will need to change, probably by using a read-only QTextEdit instead as that provides scroll bars. Maybe consider a multi-column table for the contents as an alternative to scroll bars. --- widgets/HelpTextWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/HelpTextWindow.cpp b/widgets/HelpTextWindow.cpp index d24a87a51..51bfc89f9 100644 --- a/widgets/HelpTextWindow.cpp +++ b/widgets/HelpTextWindow.cpp @@ -22,10 +22,11 @@ HelpTextWindow::HelpTextWindow (QString const& title, QString const& file_name, , tr ("Error: %1").arg (source.errorString ())); return; } - setText (QTextStream {&source}.readAll ()); setWindowTitle(QApplication::applicationName () + " - " + title); setMargin (10); setBackgroundRole (QPalette::Base); setAutoFillBackground (true); setStyleSheet (font_as_stylesheet (font)); + setText (QTextStream {&source}.readAll ()); + setMinimumSize (sizeHint ()); }