Creating an HTML-based online help system using QTextBrowser or QDesk-topServices.openUrl() is straightforward, whereas creating a system that uses Qt Assistant is trickier to set up. But no matter which approach we take to providing access to online help, the real challenge is the design and content of the online help documentation itself.

Setting up an application for translation is quite straightforward. A .pro file is normally used to list the .ts file and the .ui, .py, and .pyw files that have user-visible strings in them, and we must use pylupdate4 and lrelease to keep the .ts file up-to-date and to produce the .qm file. We can avoid using a .pro file by generating the initial .ts file and then using either or Make PyQt.

In terms of coding we must make sure that every user-visible string uses or QApplication.translate(). Strings that have replaceable arguments should always use QString.arg() with its numbered %n arguments rather than the Python % operator.

For numbers we may need to use %Ln to get the correct thousands and decimal separators. One trick we can use for currency symbols is to do something like this:

currency = QApplication.translate("Currency", "$")

and translate "$" as "€", "£", "¥", or whatever else is appropriate. For dates we can use QDate.toString(Qt.SystemLocaleDate) or QDate.toString(Qt.ISODate). For units of measurement it is probably best either to provide a sensible default that the user can change through a configuration dialog, or have a "first run" dialog that asks the user to choose their units, default paper size, and so on.

Was this article helpful?

0 0


The main focus of this report is to show how to get involved in video marketing on the run, how to rank quickly on YouTube and Google using FREE semi-automatic tools and services. QUICKLY AND FREE. I will show methods and techniques I use to rank my videos, as well as free resources and tools to make video clips, to get backlinks and free traffic.

Get My Free Ebook

Post a comment