Your message dated Sun, 14 Sep 2025 11:03:39 +0200
with message-id <[email protected]>
and subject line Qt4 has been superseded by Qt5 and Qt6
has caused the Debian Bug report #757363,
regarding libqtgui4: Qt print dialog's duplex setting not inferred from CUPS 
properties
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
757363: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757363
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libqtgui4
Version: 4:4.8.2+dfsg-11
Severity: normal
Tags: upstream patch

Qt's printing dialog (as used, for example, by Iceweasel) does not infer the 
duplex setting from CUPS's printer options.
This is a known bug in Qt, see https://bugs.kde.org/180051.
A patch is available at http://bugsfiles.kde.org/attachment.cgi?id=41187.
We've been using this pÃatch for ages, I include a revised version for 4.8.2.

-- System Information:
Debian Release: 7.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10.42.wap (SMP w/2 CPU cores)
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash

Versions of packages libqtgui4 depends on:
ii  fontconfig         2.9.0-7.1
ii  libaudio2          1.9.3-5wheezy1
ii  libc6              2.13-38+deb7u3
ii  libfontconfig1     2.9.0-7.1
ii  libfreetype6       2.4.9-1.1
ii  libgcc1            1:4.7.2-5
ii  libglib2.0-0       2.33.12+really2.32.4-5
ii  libice6            2:1.0.8-2
ii  libjpeg8           8d-1+deb7u1
ii  libmng1            1.0.10-3
ii  libpng12-0         1.2.49-1
ii  libqtcore4         4:4.8.2+dfsg-11
ii  libsm6             2:1.2.1-2
ii  libstdc++6         4.7.2-5
ii  libtiff4           3.9.6-11
ii  libx11-6           2:1.5.0-1+deb7u1
ii  libxext6           2:1.3.1-2+deb7u1
ii  libxrender1        1:0.9.7-1+deb7u1
ii  multiarch-support  2.13-38+deb7u3
ii  zlib1g             1:1.2.7.dfsg-13

Versions of packages libqtgui4 recommends:
ii  libcups2  1.5.3-5+deb7u4

Versions of packages libqtgui4 suggests:
pn  qt4-qtconfig  <none>

-- no debconf information
Index: src/gui/dialogs/qprintdialog_unix.cpp
===================================================================
--- src/gui/dialogs/qprintdialog_unix.cpp       (revision 3625)
+++ src/gui/dialogs/qprintdialog_unix.cpp       (revision 3626)
@@ -579,6 +579,32 @@
 void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
 {
     options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
+
+    if (cups) {
+        const ppd_option_t* duplex = cups->ppdOption("Duplex");
+        if (duplex) {
+            // copy default ppd duplex to qt dialog
+            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
+                options.duplexShort->setChecked(true);
+            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
+                options.duplexLong->setChecked(true);
+            else
+                options.noDuplex->setChecked(true);
+        }
+
+        if (cups->currentPPD()) {
+            // set default color
+            if (cups->currentPPD()->color_device)
+                options.color->setChecked(true);
+            else
+                options.grayscale->setChecked(true);
+        }
+
+        // set collation
+        const ppd_option_t *collate = cups->ppdOption("Collate");
+        if (collate)
+            options.collate->setChecked(qstrcmp(collate->defchoice, 
"True")==0);
+    }
 }
 #endif
 
Index: src/gui/painting/qprinter.cpp
===================================================================
--- src/gui/painting/qprinter.cpp       (revision 3625)
+++ src/gui/painting/qprinter.cpp       (revision 3626)
@@ -609,6 +609,44 @@
                && d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) {
         setOutputFormat(QPrinter::PdfFormat);
     }
+
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+    // fill in defaults from ppd file
+    QCUPSSupport cups;
+
+    int printernum = -1;
+    for (int i = 0; i < cups.availablePrintersCount(); i++) {
+        if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name)
+            printernum = i;
+    }
+    if (printernum >= 0) {
+        cups.setCurrentPrinter(printernum);
+
+        const ppd_option_t* duplex = cups.ppdOption("Duplex");
+        if (duplex) {
+            // copy default ppd duplex to qt dialog
+            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
+                setDuplex(DuplexShortSide);
+            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
+                setDuplex(DuplexLongSide);
+            else
+                setDuplex(DuplexNone);
+        }
+
+        if (cups.currentPPD()) {
+            // set default color
+            if (cups.currentPPD()->color_device)
+                setColorMode(Color);
+            else
+                setColorMode(GrayScale);
+        }
+
+        // set collation
+        const ppd_option_t *collate = cups.ppdOption("Collate");
+        if (collate)
+            setCollateCopies(qstrcmp(collate->defchoice, "True")==0);
+    }
+#endif
 }
 
 /*!

--- End Message ---
--- Begin Message ---
Version: 4:4.8.7+dfsg-20+rm

src:qt4-x11 was last released with Debian 10 (buster)
in July 2019 and has been removed from the Debian archive afterwards.
It has been superseded by newer versions.
See https://bugs.debian.org/953294 for details on the removal.
After regular security support for buster ended in August 2022 and LTS
support ended in June 2024, I'm closing the remaining bug reports now.

Andreas

--- End Message ---

Reply via email to