View on GitHub

dryairship's GSoC 2020 Project

Work Product submission for the Common Print Dialog Backends (CPDB) Qt Implementation Project, done by Priydarshi Singh (@dryairship) in Google Summer of Code 2020.

Common Print Dialog Backends (CPDB) Qt Implementation

About me

I am Priydarshi Singh. I worked with Open Printing (under The Linux Foundation) for Google Summer of Code 2020. My project was titled Common Print Dialog Backends (CPDB) Qt Implementation.

About the project

Common Print Dialog Backends

CPDB is one of the main projects of Open Printing. It aims to separate the development of print dialogs and the support for different print technologies. I idea is to have a unified library (cpdb-libs) which the applications can use to check available printers, check the various options supported by those printers, and send print jobs with specified settings. This way, when new printing technologies are developed, all the applications won’t have to be updated to use those technologies. Only the CPDB libraries need to be updated, and all the applications that use CPDB will automatically support the new technologies. Currently, the cpdb-libs has backends to support printing to a file, on CUPS and on Google Cloud Print.

Qt Print Support

Qt is a popular cross-platform application development framework. Applications built using Qt can support cros platform printing through Qt Print Support. However, on Linux, Qt Print Support can only print to CUPS and to a file. Further, to support any new features, Qt Print Support would need to be updated.

My job

My job was to make Qt Print Support use the Common Print Dialog Backends. This would not change anything for the developer building an application - they would use the existing QPrintDialog API. However, the end user would see the difference. If the Common Print Dialog Backends are not installed on the user’s system, the Qt Print Support would fall back to its original implementation. But if the beckends are installed, the user would see the new print dialog, perhaps with more printers (from non-CUPS backends) and more supported options.

Work Done

My commits can be found here. You can compare the changes here. A unified diff is available here.

Description of the work done

Other minor tasks

Work left

The only task remaining is to get the code merged in Qt’s official repo. I’d also need to do any changes suggested by Qt’s reviewers.

Build instructions

You can see the instructions here on how to build Qt from source.

For this project, you need the following libraries installed on your system:

Once you have obtained the source code of Qt, create a new shadow build folder. The following commands must be executed in the shadow build folder, assuming that the source code of Qt is available in /path/to/qt5:

Normal build (with CPDB enabled)

/path/to/qt5/configure -developer-build -opensource -confirm-license -nomake examples -nomake tests
make -j$(nproc)

Build with CPDB disabled

You can just add the -no-cpdb configuration flag to disable CPDB.

/path/to/qt5/configure -developer-build -opensource -confirm-license -nomake examples -nomake tests -no-cpdb
make -j$(nproc)

Acknowledgements

I am thankful to my mentors Dongxu and Till for their guidance throughout the project. The interactions with them and working on this project were together a great learning experience and I gained a lot of knowledge into the working of printing systems as well as how a large library like Qt is maintained.

I would also like to thank Rithvik, who worked on this project before, for being available for guidance.

It was a great experience working on this project!