mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-27 00:21:11 +08:00
[ui] round progress indicator: added setTitle method
This commit is contained in:
parent
7d0c04bd73
commit
00ee2d0e18
@ -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();
|
||||
|
@ -266,6 +266,8 @@ public:
|
||||
RoundProgressStyle style() const;
|
||||
void setStyle(RoundProgressStyle style);
|
||||
|
||||
void setTitle(const QString& title);
|
||||
|
||||
protected:
|
||||
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user