Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets vs. Qt Quick / QML #153

Open
imsanjoykb opened this issue Dec 26, 2021 · 0 comments
Open

Widgets vs. Qt Quick / QML #153

imsanjoykb opened this issue Dec 26, 2021 · 0 comments

Comments

@imsanjoykb
Copy link
Owner

Qt offers two broad technologies for creating user interfaces: The first, referred
to as Widgets, is the old core of Qt. It renders desktop GUIs typical for operating
systems such as Windows or macOS. A somewhat more recent technology is
Qt Quick: It offers highly customizable graphics, fluid animations and is more
targeted at mobile devices and touch displays.

Qt Quick uses a markup language called QML for laying out UIs. It is function-
ally similar to HTML, CSS and JavaScript. In fact, it supports JavaScript as a

scripting language. Its overall syntax is similar to JSON. Qt Quick applications
often use QML for the UI and C++ or Python for the business logic.
Widgets on the other hand are often laid out directly in code. That is, there are
C++ or Python statements that say "draw a button here". This can be avoided
by using Qt Designer (see Section 3.6), a visual editor that outputs special XML
files describing a UI. But it lacks the dynamic features of JavaScript.
In general, you should use Widgets if you want a pretty standard desktop GUI.

Otherwise, if you want highly customizable graphics and / or support for mo-
bile devices and touch displays, use Qt Quick.

Because Qt Quick already supports JavaScript, a dynamic scripting language,
combining it with Python yields fewer benefits than doing so for Widgets. For
this reason, this book is mostly about Widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant