diff --git a/profiler_gui/round_progress_widget.cpp b/profiler_gui/round_progress_widget.cpp index 1ad0838..12c3946 100644 --- a/profiler_gui/round_progress_widget.cpp +++ b/profiler_gui/round_progress_widget.cpp @@ -625,6 +625,8 @@ RoundProgressWidget::RoundProgressWidget(const QString& title, QWidget* parent) setAttribute(Qt::WA_TranslucentBackground); setAutoFillBackground(false); + m_title->setAlignment(Qt::AlignCenter); + auto wlay = new QHBoxLayout(m_indicatorWrapper); wlay->setContentsMargins(0, 0, 0, 0); wlay->addWidget(m_indicator, 0, Qt::AlignCenter); @@ -647,6 +649,7 @@ RoundProgressWidget::~RoundProgressWidget() void RoundProgressWidget::setTitle(const QString& title) { m_title->setText(title); + adjustSize(); } int RoundProgressWidget::value() const @@ -852,6 +855,13 @@ void RoundProgressDialog::setStyle(RoundProgressStyle style) m_progress->setStyle(style); } +void RoundProgressDialog::setTitle(const QString& title) +{ + m_progress->setTitle(title); + adjustSize(); + update(); +} + QDialog::DialogCode RoundProgressDialog::buttonRole() const { return m_progress->buttonRole(); diff --git a/profiler_gui/round_progress_widget.h b/profiler_gui/round_progress_widget.h index 4762e08..0e1ea54 100644 --- a/profiler_gui/round_progress_widget.h +++ b/profiler_gui/round_progress_widget.h @@ -266,6 +266,8 @@ public: RoundProgressStyle style() const; void setStyle(RoundProgressStyle style); + void setTitle(const QString& title); + protected: void showEvent(QShowEvent* event) override;