QPrintDialog bug

Discuss anything related to product development
Post Reply
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

QPrintDialog bug

Post by seasoned_geek »

Code: Select all

QPrintDialog dialog(&printer, qApp->mainFormWidget());
When one executes that code compiled with any version of Qt, the dialog populates the printer combobox and if the user chooses a different printer, &printer has its information updated to match what the user chose.

Under CopperSpice the printer combobox is not populated when a default or custom printer object is passed.
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

Re: QPrintDialog bug

Post by seasoned_geek »

Further testing reveals QPrintDialog simply doesn't work at all on Ubuntu 20.04 LTS with the latest code from earlier this week. No matter how it is called it will not populate the printer combo box. Only displays PDF no matter what. I swear this used to work.
barbara
Posts: 446
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QPrintDialog bug

Post by barbara »

Can you put together a very small sample for us to test on other platforms. We have not seen this issue as of yet.

Barbara
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

Re: QPrintDialog bug

Post by seasoned_geek »

Well, the code is short, but the journey is long. I had a really long message in here with step-by-step instructions to produce and not produce. Spent the bulk of the afternoon on it. Here's the issue in a shot glass.

Every time we start a program from the command line on Ubuntu (and most Linux) we get this annoying message.

Code: Select all

Choosing xcb gl-integration based on following priority
 (xcb_glx, xcb_egl)
No OpenGL integration plugin was found, this is only required for programs which use OpenGL.
When your CMakeLists.txt has this

Code: Select all

if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   # copy required plugins to the bundle
   cs_copy_plugins(CsGui ../plugins)
   #cs_copy_plugins(CsPrinterDriver ../plugins)
else()
   # installs required plugins
   cs_copy_plugins(CsGui)
   #cs_copy_plugins(CsPrinterDriver)
endif()
instead of this

Code: Select all

if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   # copy required plugins to the bundle
   cs_copy_plugins(CsGui ../plugins)
   cs_copy_plugins(CsPrinterDriver ../plugins)
else()
   # installs required plugins
   cs_copy_plugins(CsGui)
   cs_copy_plugins(CsPrinterDriver)
endif()
We get no annoying messages what-so-ever. We just get a combobox in the QPrintDialog that only has PDF in it and not a single clue as to why.
barbara
Posts: 446
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QPrintDialog bug

Post by barbara »

(1) As stated in another reply, the current XCB platform plugin has no way to "know" if the application will call methods in the CsOpenGL library. This plugin does not query how the application was linked.

(2) In your modified CMake file you removed the installation for the PrinterDriver plugin. We ran a small test and confirmed that no message is produced on application start up, but then no printer drivers are installed. This makes sense. If you want to print you must have the CsPrinterDriver plugin available to the application.

So in the first case the XCB plugin is providing a warning, do not call OpenGL methods since the plug in was not found. In the second case CS did not warn anything about the missing printer driver plugin ( you did not install it ) and now you have no way to print.

The intent is to warn about missing plugins when it can cause a run time crash. We will look at adding a compile time option to turn these message on or off, at the developers discretion.
Post Reply