- QPageSetupDialog has had the PageSetupDialogOption enum and the api to
set and get the enum removed as none of the Options are used any more.
+- QAbstractPageSetupDialog has been removed.
+
****************************************************************************
* General *
****************************************************************************
HEADERS += \
dialogs/qabstractprintdialog.h \
dialogs/qabstractprintdialog_p.h \
- dialogs/qabstractpagesetupdialog.h \
- dialogs/qabstractpagesetupdialog_p.h \
+ dialogs/qpagesetupdialog_p.h \
dialogs/qpagesetupdialog.h \
dialogs/qprintdialog.h \
dialogs/qprintpreviewdialog.h
SOURCES += \
dialogs/qabstractprintdialog.cpp \
- dialogs/qabstractpagesetupdialog.cpp \
dialogs/qpagesetupdialog.cpp \
dialogs/qprintpreviewdialog.cpp
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qabstractpagesetupdialog.h"
-#include "qabstractpagesetupdialog_p.h"
-
-#ifndef QT_NO_PRINTDIALOG
-
-#include <QtGui/qguiapplication.h>
-#include <QtPrintSupport/qprinter.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- \class QAbstractPageSetupDialog
-
- \brief The QAbstractPageSetupDialog class provides a base for
- implementations of page setup dialogs.
-*/
-
-/*!
- Constructs the page setup dialog for the printer \a printer with
- \a parent as parent widget.
-*/
-QAbstractPageSetupDialog::QAbstractPageSetupDialog(QPrinter *printer, QWidget *parent)
- : QDialog(*(new QAbstractPageSetupDialogPrivate), parent)
-{
- Q_D(QAbstractPageSetupDialog);
- setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
- d->setPrinter(printer);
-}
-
-/*!
- \internal
-*/
-QAbstractPageSetupDialog::QAbstractPageSetupDialog(QAbstractPageSetupDialogPrivate &ptr,
- QPrinter *printer, QWidget *parent)
- : QDialog(ptr, parent)
-{
- Q_D(QAbstractPageSetupDialog);
- setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
- d->setPrinter(printer);
-}
-
-QAbstractPageSetupDialog::~QAbstractPageSetupDialog()
-{
- Q_D(QAbstractPageSetupDialog);
- if (d->ownsPrinter)
- delete d->printer;
-}
-
-/*!
- Returns the printer that this page setup dialog is operating on.
-*/
-QPrinter *QAbstractPageSetupDialog::printer()
-{
- Q_D(QAbstractPageSetupDialog);
- return d->printer;
-}
-
-void QAbstractPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter)
-{
- if (newPrinter) {
- printer = newPrinter;
- ownsPrinter = false;
- } else {
- printer = new QPrinter;
- ownsPrinter = true;
- }
- if (printer->outputFormat() != QPrinter::NativeFormat && QGuiApplication::platformName() == QLatin1String("xcb"))
- qWarning("QPageSetupDialog: Cannot be used on non-native printers");
-}
-
-/*!
- \fn int QAbstractPageSetupDialog::exec()
-
- This virtual function is called to pop up the dialog. It must be
- reimplemented in subclasses.
-*/
-
-/*!
- \reimp
-*/
-void QAbstractPageSetupDialog::done(int result)
-{
- Q_D(QAbstractPageSetupDialog);
- QDialog::done(result);
- if (d->receiverToDisconnectOnClose) {
- disconnect(this, SIGNAL(accepted()),
- d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose);
- d->receiverToDisconnectOnClose = 0;
- }
- d->memberToDisconnectOnClose.clear();
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_PRINTDIALOG
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QABSTRACTPAGESETUPDIALOG_H
-#define QABSTRACTPAGESETUPDIALOG_H
-
-#include <QtWidgets/qdialog.h>
-#include <QtPrintSupport/qtprintsupportglobal.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-
-#ifndef QT_NO_PRINTDIALOG
-
-class QAbstractPageSetupDialogPrivate;
-class QPrinter;
-
-// ### QtPrintNG: merge this class with QPageSetupDialog
-class Q_PRINTSUPPORT_EXPORT QAbstractPageSetupDialog : public QDialog
-{
- Q_DECLARE_PRIVATE(QAbstractPageSetupDialog)
- Q_OBJECT
-
-public:
- explicit QAbstractPageSetupDialog(QPrinter *printer, QWidget *parent = 0);
- QAbstractPageSetupDialog(QAbstractPageSetupDialogPrivate &ptr,
- QPrinter *printer, QWidget *parent = 0);
- ~QAbstractPageSetupDialog();
-
- virtual int exec() = 0;
- void done(int result);
-
- QPrinter *printer();
-};
-
-#endif // QT_NO_PRINTDIALOG
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QABSTRACTPAGESETUPDIALOG_H
**
****************************************************************************/
-#include <private/qabstractpagesetupdialog_p.h>
+#include "qpagesetupdialog.h"
+#include <private/qpagesetupdialog_p.h>
+
+#include <QtPrintSupport/qprinter.h>
#ifndef QT_NO_PRINTDIALOG
*/
/*!
+ \fn QPageSetupDialog::~QPageSetupDialog()
+
+ Destroys the page setup dialog.
+*/
+
+/*!
\since 4.5
\fn QPageSetupDialog::QPageSetupDialog(QWidget *parent)
constructor.
*/
-// hack
-class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate
+QPageSetupDialogPrivate::QPageSetupDialogPrivate(QPrinter *prntr) : printer(0), ownsPrinter(false)
{
-};
+ setPrinter(prntr);
+ init();
+}
+
+void QPageSetupDialogPrivate::init()
+{
+}
+
+void QPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter)
+{
+ if (printer && ownsPrinter)
+ delete printer;
+
+ if (newPrinter) {
+ printer = newPrinter;
+ ownsPrinter = false;
+ } else {
+ printer = new QPrinter;
+ ownsPrinter = true;
+ }
+#ifndef Q_WS_X11
+ if (printer->outputFormat() != QPrinter::NativeFormat)
+ qWarning("QPageSetupDialog: Cannot be used on non-native printers");
+#endif
+}
/*!
\overload
*/
#endif
+QPageSetupDialog::~QPageSetupDialog()
+{
+ Q_D(QPageSetupDialog);
+ if (d->ownsPrinter)
+ delete d->printer;
+}
+
+QPrinter *QPageSetupDialog::printer()
+{
+ Q_D(QPageSetupDialog);
+ return d->printer;
+}
+
+/*!
+ \fn int QPageSetupDialog::exec()
+
+ This virtual function is called to pop up the dialog. It must be
+ reimplemented in subclasses.
+*/
+
+/*!
+ \reimp
+*/
+void QPageSetupDialog::done(int result)
+{
+ Q_D(QPageSetupDialog);
+ QDialog::done(result);
+ if (d->receiverToDisconnectOnClose) {
+ disconnect(this, SIGNAL(accepted()),
+ d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose);
+ d->receiverToDisconnectOnClose = 0;
+ }
+ d->memberToDisconnectOnClose.clear();
+
+}
+
QT_END_NAMESPACE
#endif
#ifndef QPAGESETUPDIALOG_H
#define QPAGESETUPDIALOG_H
-#include <QtPrintSupport/qabstractpagesetupdialog.h>
+#include <QtWidgets/qdialog.h>
+#include <QtPrintSupport/qtprintsupportglobal.h>
QT_BEGIN_HEADER
#ifndef QT_NO_PRINTDIALOG
+class QPrinter;
class QPageSetupDialogPrivate;
-class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QAbstractPageSetupDialog
+class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPageSetupDialog)
public:
explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = 0);
explicit QPageSetupDialog(QWidget *parent = 0);
+ virtual ~QPageSetupDialog();
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
virtual void setVisible(bool visible);
#endif
void open(QObject *receiver, const char *member);
-#ifdef qdoc
+ void done(int result);
+
QPrinter *printer();
-#endif
};
#endif // QT_NO_PRINTDIALOG
#include <Cocoa/Cocoa.h>
#include "qpagesetupdialog.h"
-#include "qabstractpagesetupdialog_p.h"
+#include "qpagesetupdialog_p.h"
#include <qpa/qplatformnativeinterface.h>
#include <QtPrintSupport/qprintengine.h>
QT_BEGIN_NAMESPACE
-class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate
+class QMacPageSetupDialogPrivate : public QPageSetupDialogPrivate
{
Q_DECLARE_PUBLIC(QPageSetupDialog)
public:
- QPageSetupDialogPrivate()
- : printInfo(0), pageLayout(0)
+ QMacPageSetupDialogPrivate(QPrinter *printer)
+ : QPageSetupDialogPrivate(printer), printInfo(0), pageLayout(0)
{ }
- ~QPageSetupDialogPrivate() {
+ ~QMacPageSetupDialogPrivate() {
}
void openCocoaPageLayout(Qt::WindowModality modality);
NSPageLayout *pageLayout;
};
-void QPageSetupDialogPrivate::openCocoaPageLayout(Qt::WindowModality modality)
+void QMacPageSetupDialogPrivate::openCocoaPageLayout(Qt::WindowModality modality)
{
Q_Q(QPageSetupDialog);
}
}
-void QPageSetupDialogPrivate::closeCocoaPageLayout()
+void QMacPageSetupDialogPrivate::closeCocoaPageLayout()
{
[printInfo release];
printInfo = 0;
}
QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), printer, parent)
+ : QDialog(*(new QMacPageSetupDialogPrivate(printer)), parent)
{
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
setAttribute(Qt::WA_DontShowOnScreen);
}
QPageSetupDialog::QPageSetupDialog(QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), 0, parent)
+ : QDialog(*(new QMacPageSetupDialogPrivate(0)), parent)
{
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
setAttribute(Qt::WA_DontShowOnScreen);
}
if (d->printer->outputFormat() != QPrinter::NativeFormat)
return;
- bool isCurrentlyVisible = (d->pageLayout != 0);
+ bool isCurrentlyVisible = (static_cast <QMacPageSetupDialogPrivate*>(d)->pageLayout != 0);
if (!visible == !isCurrentlyVisible)
return;
// NSPrintPanels can only be modal, so we must pick a type
modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal;
}
- d->openCocoaPageLayout(modality);
+ static_cast <QMacPageSetupDialogPrivate*>(d)->openCocoaPageLayout(modality);
return;
} else {
- if (d->pageLayout) {
- d->closeCocoaPageLayout();
+ if (static_cast <QMacPageSetupDialogPrivate*>(d)->pageLayout) {
+ static_cast <QMacPageSetupDialogPrivate*>(d)->closeCocoaPageLayout();
return;
}
}
QDialog::setVisible(true);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- d->openCocoaPageLayout(Qt::ApplicationModal);
- d->closeCocoaPageLayout();
+ static_cast <QMacPageSetupDialogPrivate*>(d)->openCocoaPageLayout(Qt::ApplicationModal);
+ static_cast <QMacPageSetupDialogPrivate*>(d)->closeCocoaPageLayout();
[pool release];
QDialog::setVisible(false);
**
****************************************************************************/
-#ifndef QABSTRACTPAGESETUPDIALOG_P_H
-#define QABSTRACTPAGESETUPDIALOG_P_H
+#ifndef QPAGESETUPDIALOG_P_H
+#define QPAGESETUPDIALOG_P_H
//
// W A R N I N G
class QPrinter;
-class QAbstractPageSetupDialogPrivate : public QDialogPrivate
+class QPageSetupDialogPrivate : public QDialogPrivate
{
- Q_DECLARE_PUBLIC(QAbstractPageSetupDialog)
+ Q_DECLARE_PUBLIC(QPageSetupDialog)
public:
- QAbstractPageSetupDialogPrivate() : printer(0), ownsPrinter(false) {}
+ QPageSetupDialogPrivate(QPrinter *printer);
+ virtual void init();
void setPrinter(QPrinter *newPrinter);
QPrinter *printer;
#endif // QT_NO_PRINTDIALOG
-#endif // QABSTRACTPAGESETUPDIALOG_P_H
+#endif // QPAGESETUPDIALOG_P_H
#include <ui_qpagesetupwidget.h>
#include <QtPrintSupport/qprinter.h>
-#include <private/qabstractpagesetupdialog_p.h>
+#include <private/qpagesetupdialog_p.h>
#include <private/qprinter_p.h>
#include <private/qprintengine_pdf_p.h>
};
-class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate
+class QUnixPageSetupDialogPrivate : public QPageSetupDialogPrivate
{
Q_DECLARE_PUBLIC(QPageSetupDialog)
public:
- ~QPageSetupDialogPrivate();
+ QUnixPageSetupDialogPrivate(QPrinter *printer);
+ ~QUnixPageSetupDialogPrivate();
void init();
QPageSetupWidget *widget;
#endif
};
-QPageSetupDialogPrivate::~QPageSetupDialogPrivate()
+QUnixPageSetupDialogPrivate::QUnixPageSetupDialogPrivate(QPrinter *printer) : QPageSetupDialogPrivate(printer)
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ , cups(0)
+#endif
+{
+}
+
+QUnixPageSetupDialogPrivate::~QUnixPageSetupDialogPrivate()
{
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
- delete cups;
+ if (cups) {
+ delete cups;
+ cups = 0;
+ }
#endif
}
-void QPageSetupDialogPrivate::init()
+void QUnixPageSetupDialogPrivate::init()
{
Q_Q(QPageSetupDialog);
QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), printer, parent)
+ : QDialog(*(new QUnixPageSetupDialogPrivate(printer)), parent)
{
- Q_D(QPageSetupDialog);
- d->init();
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
}
QPageSetupDialog::QPageSetupDialog(QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), 0, parent)
+ : QDialog(*(new QUnixPageSetupDialogPrivate(0)), parent)
{
- Q_D(QPageSetupDialog);
- d->init();
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
}
-/*!
- \internal
-*/
int QPageSetupDialog::exec()
{
Q_D(QPageSetupDialog);
int ret = QDialog::exec();
if (ret == Accepted)
- d->widget->setupPrinter();
+ static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->setupPrinter();
return ret;
}
#include <qapplication.h>
#include "../kernel/qprintengine_win_p.h"
-#include "qabstractpagesetupdialog_p.h"
+#include "qpagesetupdialog_p.h"
#include "qprinter.h"
#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
-class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate
-{
-};
-
QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), printer, parent)
+ : QDialog(*(new QPageSetupDialogPrivate(printer)), parent)
{
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
setAttribute(Qt::WA_DontShowOnScreen);
}
QPageSetupDialog::QPageSetupDialog(QWidget *parent)
- : QAbstractPageSetupDialog(*(new QPageSetupDialogPrivate), 0, parent)
+ : QDialog(*(new QPageSetupDialogPrivate(0)), parent)
{
+ setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
setAttribute(Qt::WA_DontShowOnScreen);
}
QT_CLASS_LIB(QAccessiblePlugin, QtWidgets, qaccessibleplugin.h)
QT_CLASS_LIB(QAccessibleWidget, QtWidgets, qaccessiblewidget.h)
QT_CLASS_LIB(QAccessibleWidgetEx, QtWidgets, qaccessiblewidget.h)
-QT_CLASS_LIB(QAbstractPageSetupDialog, QtWidgets, qabstractpagesetupdialog.h)
QT_CLASS_LIB(QAbstractPrintDialog, QtWidgets, qabstractprintdialog.h)
QT_CLASS_LIB(QColorDialog, QtWidgets, qcolordialog.h)
QT_CLASS_LIB(QDialog, QtWidgets, qdialog.h)