Ryou
Ryou

Reputation: 285

What's the different between QWidget and Qml in the processing of touch screen?

I am going to develop a system on a touch screen. I try to use Qwidget. But i found this in QT docs.

It said, "Qt Widgets often require a mouse cursor for good interaction, whereas Qt Quick only provides primitive building blocks that were designed with touch interaction in mind. "

What's that mean? What is the different between a mouse cursor and primitive building blocks?

Upvotes: 3

Views: 2257

Answers (1)

j123b567
j123b567

Reputation: 3439

Application based on Qt Widgets can work properly with a touchscreen. I have made many applications for touchscreen written in Qt Widgets and they work well.

Problem is, that some widgets are so small so it is hard to use them on touchscreen e.g. QSpinBox, QDateTimeEdit. Some widgets are hardly usable e.g. QComboBox does not work well if drop down items don't fit to the screen. Same problem is with QScrollArea and all components using it, because of scroll bars. You can stil use Style sheets to modify all components and make them more usable for touch screen.

Imagine this dialog using Qt Widgets. It is also impossible to use it on capacitive touch screen with fingers. It requires a mouse cursor for good interaction.

enter image description here

On the other hand QML is touch screen first. There are some componets in Qt Quick Controls but you can easilly define your own components usinig primitive building blocks like Rectangle. There is some built-in designer but it never worked for me properly with more complex designs. I have ever ended with manual coding of QML. For me, QML is harder to learn and the final code teds to be full of hacks to reach some goal. This is my personal view.

Imagine this time picker using QML. It can be implemented just but some text elements and rectangles on your own (Using just primitive building blocks). It is also perfectly usable by touch screen. Implementing this component will be much harder using Qt Widgets then using QML.

enter image description here

Upvotes: 7

Related Questions