Skip to Main Content
Qt5 Python GUI Programming Cookbook
book

Qt5 Python GUI Programming Cookbook

by B. M. Harwani
July 2018
Intermediate to advanced content levelIntermediate to advanced
462 pages
12h 2m
English
Packt Publishing
Content preview from Qt5 Python GUI Programming Cookbook

How to do it...

The QPainter class is the focus of this recipe. The setFont() and drawText() methods of the QPainter class will be used in this recipe. The setFont() method will be invoked to set the font style and font size chosen by the user and the drawText() method will draw the text written by the user in the Text Edit widget in the specified font style and size. Here is the step-by-step procedure to learn how these methods are used:

  1. Let's create an application based on the Dialog without Buttons template.
  1. Add the QLabel, QTextEdit, QListWidget, QComboBox, and QPushButton widgets to the form by dragging and dropping a Label widget, a Text Edit widget, a List Widget box, a Combo Box widget, and a Push Button widget on the form.
  2. Set ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming Cookbook - Third Edition

Python GUI Programming Cookbook - Third Edition

Burkhard Meier

Publisher Resources

ISBN: 9781788831000Supplemental Content