In the previous series of articles, I only gave the Native Quick Widget a two-star evaluation. Now, it seems that this is a very superficial understanding. Without in-depth source code and specific functions, it is silly to rely solely on the interface to judge the behavior.
This also reminds me that every open-source project has its merits. The open-source project can create better software and provide better code logic because it is selfless to share it.
This Native Quick Widgets is also a set of Native Quick Widgets. Its value does not provide the interface of the United States, but provides several important functions that are missing in the current QtQuick.
As mobile device development of touch screens, these functions do not have any value, but once QML is applied to desktop development, it shows a huge impact.
Obviously, the Native Quick Widgets author should have used QML for desktop software development or attempts in this regard. Therefore, the emergence of this set of components was realized due to these shortcomings.
First, perform the most basic analysis on this QML component. by reading the source code, we can find that it provides seven custom QML elements:
1. Button Element
2. CheckBox Element
3. CursorArea Element
4. LineEdit Element
5. MenuAction Element
6. Menu Element
7. ProgressBar Element
8. ScrollBar Element
In addition to these elements, seven QML components are provided:
1. Button. qml
2. ContextMenu. qml
3. ProgressBar. qml
4. ScrollBar. qml
5. CheckBox. qml
6. LineEdit. qml
7. ScrollArea. qml
By analyzing these components one by one, we can find that the functions provided by these components are important for desktop development. These functions can be extracted from the QML components and QML elements listed above:
1. The most basic button for user event triggering
2. Enter the edit box for user input.
3. Progress bar. The user displays the processing progress of an event.
4. menu and menu action, used for regional user event triggering
5. the scroll bar and scroll area are used to view the interface outside the visible range.
6. The mouse display area is used to change the shape of the mouse display.
The first three features are not particularly required or important, because native QML can also be used to complete these features and write brilliant results, but the following three points are different.
First, we should understand the applicability of the QML and QtQuick technologies. This is different from the traditional UI mode, and is designed more like a mobile device such as a touch screen, rather than a desktop application. Compare the differences between mobile devices and desktop development based on these three features.
Differences between menu functions:
1. menus on the desktop are indispensable. shortcut menus, or buttons attached, provide shortcuts for user operations. In addition, menus are usually multilevel, level 2, level 3, or even Level 4 menus, in Touch screen devices, most of the screen size restrictions are level-1 menus or no menus. Most of them are triggered by buttons;
2. on the desktop, right-click the menu to trigger the menu. On the touch screen, the operation is to click or open it. This is an important reason why the menu is not necessary. Even if it is multi-touch, since it can be multi-touch, why do we still need to trigger the menu event? It makes gesture operations more convenient;
From these two points, we can see the major difference between the two. More importantly, for QML itself, because of the metadata-based DirectUI, although self-drawing menus can be implemented, however, for a tight development cycle, the implementation time is no doubt squandering.
The difference between the two Rolling functions:
This is also an essential function on the desktop. Touch screen devices also have the same features, but it is also limited by the size of touch screen devices. It is impossible for users to scroll their hands on a tiny scroll bar, but in a rolling area, this operation can be reflected on the ipad. However, despite the inertia of rolling on the desktop, the current desktop users cannot accept the same operation;
The basic elements of QML provide scrolling, but it is not applicable to traditional desktop forms. Although there are, it can be directly applied to desktops in the mouse era, instead, it provides a poor user experience.
Finally, differences in the mouse area:
On the desktop, because of the different operations, the mouse will change the shape and prompt the user's current operation status. However, on the touch screen device, it is just superfluous, which is very detailed, however, the more detailed it is, the more different desktop software and mobile device software can be written.
Through these simple analyses, we should realize the meaning of Native Quick Widgets, although it simply references the Native components of Qt, however, this implementation helps QML developers to save their time to implement these features.
Again, I would like to express my respect for the open-source. It is just the code that is close to the infinite open-source that has created ios, android, and meego. If it is not open-source, these systems that provide great help and happiness for people's lives will not appear.
At the same time, due to the existence of Qt, we have saved the wheel building process, in order to quickly compile the software to meet the changing needs of users.