mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:13:24 +00:00
PrintDialog small improvements.
* Remove closeClicked() slot, and use QDialogs accept() slot * Simplify QObject::connect call by removing the QObject scope. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
aeaa050306
commit
7c4c0802dc
2 changed files with 2 additions and 8 deletions
|
@ -38,7 +38,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
|
||||||
hLayout->addWidget(printButton);
|
hLayout->addWidget(printButton);
|
||||||
|
|
||||||
QPushButton *closeButton = new QPushButton(tr("&Close"));
|
QPushButton *closeButton = new QPushButton(tr("&Close"));
|
||||||
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(closeClicked()));
|
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
|
||||||
hLayout->addWidget(closeButton);
|
hLayout->addWidget(closeButton);
|
||||||
|
|
||||||
progressBar = new QProgressBar();
|
progressBar = new QProgressBar();
|
||||||
|
@ -59,7 +59,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
|
||||||
void PrintDialog::previewClicked(void)
|
void PrintDialog::previewClicked(void)
|
||||||
{
|
{
|
||||||
QPrintPreviewDialog previewDialog(&printer, this);
|
QPrintPreviewDialog previewDialog(&printer, this);
|
||||||
QObject::connect(&previewDialog, SIGNAL(paintRequested(QPrinter *)), this, SLOT(onPaintRequested(QPrinter *)));
|
connect(&previewDialog, SIGNAL(paintRequested(QPrinter *)), this, SLOT(onPaintRequested(QPrinter *)));
|
||||||
previewDialog.exec();
|
previewDialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,11 +70,6 @@ void PrintDialog::printClicked(void)
|
||||||
printLayout->print();
|
printLayout->print();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintDialog::closeClicked(void)
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrintDialog::onPaintRequested(QPrinter *printerPtr)
|
void PrintDialog::onPaintRequested(QPrinter *printerPtr)
|
||||||
{
|
{
|
||||||
printLayout->print();
|
printLayout->print();
|
||||||
|
|
|
@ -26,7 +26,6 @@ private:
|
||||||
private slots:
|
private slots:
|
||||||
void previewClicked();
|
void previewClicked();
|
||||||
void printClicked();
|
void printClicked();
|
||||||
void closeClicked();
|
|
||||||
void onPaintRequested(QPrinter *);
|
void onPaintRequested(QPrinter *);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue