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()));
|
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(closeClicked()));
|
||||||
hLayout->addWidget(closeButton);
|
hLayout->addWidget(closeButton);
|
||||||
|
|
||||||
QProgressBar *progressBar = new QProgressBar();
|
progressBar = new QProgressBar();
|
||||||
connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int)));
|
connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int)));
|
||||||
progressBar->setMinimum(0);
|
progressBar->setMinimum(0);
|
||||||
progressBar->setMaximum(100);
|
progressBar->setMaximum(100);
|
||||||
|
@ -64,6 +64,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
|
||||||
|
|
||||||
void PrintDialog::runDialog()
|
void PrintDialog::runDialog()
|
||||||
{
|
{
|
||||||
|
progressBar->setValue(0);
|
||||||
exec();
|
exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
#include "../display.h"
|
#include "../display.h"
|
||||||
|
|
||||||
|
class QProgressBar;
|
||||||
class PrintOptions;
|
class PrintOptions;
|
||||||
class PrintLayout;
|
class PrintLayout;
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ private:
|
||||||
explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||||
PrintOptions *optionsWidget;
|
PrintOptions *optionsWidget;
|
||||||
PrintLayout *printLayout;
|
PrintLayout *printLayout;
|
||||||
|
QProgressBar *progressBar;
|
||||||
QPrinter printer;
|
QPrinter printer;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue