diff options
author | axis <qt-info@nokia.com> | 2010-03-16 08:47:16 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-03-16 08:47:16 (GMT) |
commit | 815af5a5e42f0d9eb7ee85e7e1bf1faae8d3a47c (patch) | |
tree | 5d5e3ebc84dd6866a060b0d5416b6db873905e4e /src/gui/dialogs | |
parent | 7ca339be57f1b8dbf9e289fae578c110813eb767 (diff) | |
parent | fdcb62d5d6a3e295273042555d2551eb491a5b2d (diff) | |
download | Qt-815af5a5e42f0d9eb7ee85e7e1bf1faae8d3a47c.zip Qt-815af5a5e42f0d9eb7ee85e7e1bf1faae8d3a47c.tar.gz Qt-815af5a5e42f0d9eb7ee85e7e1bf1faae8d3a47c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7-s60
Conflicts:
demos/embedded/anomaly/anomaly.pro
demos/embedded/flightinfo/flightinfo.pro
demos/embedded/lightmaps/lightmaps.pro
demos/embedded/weatherinfo/weatherinfo.pro
examples/network/fortuneclient/fortuneclient.pro
examples/network/fortuneserver/fortuneserver.pro
examples/network/network-chat/network-chat.pro
mkspecs/common/symbian/symbian.conf
mkspecs/features/symbian/platform_paths.prf
qmake/generators/symbian/symmake.cpp
qmake/generators/symbian/symmake.h
src/s60installs/s60installs.pro
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 11 | ||||
-rw-r--r-- | src/gui/dialogs/qprintdialog.h | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qprintdialog_unix.cpp | 38 |
3 files changed, 47 insertions, 4 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 2d75913..4faa193 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -415,8 +415,15 @@ bool QDialog::event(QEvent *e) result = true; } #else - if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) - adjustPosition(parentWidget()); + if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { + if (!testAttribute(Qt::WA_Moved)) { + Qt::WindowStates state = windowState(); + adjustPosition(parentWidget()); + setAttribute(Qt::WA_Moved, false); // not really an explicit position + if (state != windowState()) + setWindowState(state); + } + } #endif return result; } diff --git a/src/gui/dialogs/qprintdialog.h b/src/gui/dialogs/qprintdialog.h index ecd50c1..94177ea 100644 --- a/src/gui/dialogs/qprintdialog.h +++ b/src/gui/dialogs/qprintdialog.h @@ -56,7 +56,7 @@ class QPrintDialogPrivate; class QPushButton; class QPrinter; -#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) +#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) class QUnixPrintWidgetPrivate; class Q_GUI_EXPORT QUnixPrintWidget : public QWidget diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 0487f23..17283f5 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -152,6 +152,9 @@ public: bool checkFields(); void setupPrinter(); void setOptionsPane(QPrintDialogPrivate *pane); +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) + void setCupsProperties(); +#endif // slots void _q_printerChanged(int index); @@ -949,7 +952,7 @@ bool QUnixPrintWidgetPrivate::checkFields() void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked() { - if (propertiesDialog == 0) { + if (!propertiesDialog) { propertiesDialog = new QPrintPropertiesDialog(q); propertiesDialog->setResult(QDialog::Rejected); } @@ -969,6 +972,35 @@ void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked() propertiesDialog->exec(); } +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) +void QUnixPrintWidgetPrivate::setCupsProperties() +{ + if (cups && QCUPSSupport::isAvailable()) { + QPrintEngine *engine = printer->printEngine(); + const ppd_option_t* pageSizes = cups->pageSizes(); + QByteArray cupsPageSize; + for (int i = 0; i < pageSizes->num_choices; ++i) { + if (static_cast<int>(pageSizes->choices[i].marked) == 1) + cupsPageSize = pageSizes->choices[i].choice; + } + engine->setProperty(PPK_CupsStringPageSize, QString::fromLatin1(cupsPageSize)); + engine->setProperty(PPK_CupsOptions, cups->options()); + + QRect pageRect = cups->pageRect(cupsPageSize); + engine->setProperty(PPK_CupsPageRect, pageRect); + + QRect paperRect = cups->paperRect(cupsPageSize); + engine->setProperty(PPK_CupsPaperRect, paperRect); + + for (int ps = 0; ps < QPrinter::NPaperSize; ++ps) { + QPdf::PaperSize size = QPdf::paperSize(QPrinter::PaperSize(ps)); + if (size.width == paperRect.width() && size.height == paperRect.height()) + printer->setPaperSize(static_cast<QPrinter::PaperSize>(ps)); + } + } +} +#endif + void QUnixPrintWidgetPrivate::setupPrinter() { const int printerCount = widget.printers->count(); @@ -993,6 +1025,10 @@ void QUnixPrintWidgetPrivate::setupPrinter() if (propertiesDialog && propertiesDialog->result() == QDialog::Accepted) propertiesDialog->setupPrinter(); +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) + if (!propertiesDialog) + setCupsProperties(); +#endif } |