mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
PrintDialog: reset the progress bar each time the dialog opens
This requires us to expose the progressBar as a private class member. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
e4f35fb51a
commit
fc06a69c43
2 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
|
|||
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(closeClicked()));
|
||||
hLayout->addWidget(closeButton);
|
||||
|
||||
QProgressBar *progressBar = new QProgressBar();
|
||||
progressBar = new QProgressBar();
|
||||
connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int)));
|
||||
progressBar->setMinimum(0);
|
||||
progressBar->setMaximum(100);
|
||||
|
@ -64,6 +64,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
|
|||
|
||||
void PrintDialog::runDialog()
|
||||
{
|
||||
progressBar->setValue(0);
|
||||
exec();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QPrinter>
|
||||
#include "../display.h"
|
||||
|
||||
class QProgressBar;
|
||||
class PrintOptions;
|
||||
class PrintLayout;
|
||||
|
||||
|
@ -21,6 +22,7 @@ private:
|
|||
explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PrintOptions *optionsWidget;
|
||||
PrintLayout *printLayout;
|
||||
QProgressBar *progressBar;
|
||||
QPrinter printer;
|
||||
|
||||
private slots:
|
||||
|
|
Loading…
Add table
Reference in a new issue