Evgenii Legotckoi
Nov. 24, 2017, 2:27 p.m.

Are you ready for Qt Quick Controls 2.3?

With the release of Qt 5.10, Qt Quick Controls 2.3 will be available.

New functionality in Qt Quick Controls 2.3:

  • New styles
  • Menu and actions (Actions)
  • Palettes

New styles

Two new styles have been introduced: Fusion and Imagine . The Fusion style looks familiar to those using Qt Widgets. This is a QML based implementation with the same design.

The Imagine style is based on custom image objects, giving designers complete control over how the style looks. The style has a default set of image properties that are exported from Sketch.

Menus and actions

Menus and actions have taken a big step forward in their development. New QML types have been added called MenuBar , Action and ActionGroup , and Menu which support submenus. Nested menus are now possible, as on desktop platforms. Also added support for mnemonics and buttons.

The usage is identical to the previous generation of Qt Quick Controls:

  1. import QtQuick 2.10
  2. import QtQuick.Controls 2.3
  3.  
  4. ApplicationWindow {
  5. id: window
  6. width: 500
  7. height: 400
  8. visible: true
  9.  
  10. menuBar: MenuBar {
  11. Menu {
  12. title: qsTr("&File")
  13. Action { text: qsTr("&New...") }
  14. Action { text: qsTr("&Open...") }
  15. Action { text: qsTr("&Save") }
  16. Action { text: qsTr("Save &As...") }
  17. MenuSeparator { }
  18. Action { text: qsTr("&Quit") }
  19. }
  20. Menu {
  21. title: qsTr("&Edit")
  22. Action { text: qsTr("Cu&t") }
  23. Action { text: qsTr("&Copy") }
  24. Action { text: qsTr("&Paste") }
  25. MenuSeparator { }
  26. Menu {
  27. title: qsTr("&Find/Replace")
  28. Action { text: qsTr("Find &Next") }
  29. Action { text: qsTr("Find &Previous") }
  30. Action { text: qsTr("&Replace...") }
  31. }
  32. }
  33. Menu {
  34. title: qsTr("&Help")
  35. Action { text: qsTr("&About") }
  36. }
  37. }
  38. }

These are important steps to bring the menu functionality of Qt Quick Controls 2 to that of traditional menus on desktop platforms. This allows us to start looking at the next steps, integrating native platform menus as a backend for Qt Quick Controls 2 menus.

Palettes

Added support for custom palettes, which are currently supported by the Default, Fusion, Imagine themes. Other themes will get palette support later. The screenshot below shows the palette for the Default theme.

Questions and answers:

What about the TableView?

  • We've made great strides with the new TableView, which is based on the same Qt Quick item view framework that ListView and GridView are based on. The current implementation is already capable of managing the 2D set of visible elements for the current viewport. Performance is on par with ListView and GridView. A large number of columns does not kill performance, as in the ListView-based TableView in Qt Quick Controls 1. Follow the blog post on this issue.

When will the famous "Object destroyed during incubation" issue be fixed?

  • We believe that we have the necessary ingredients for a permanent solution to this problem. A patch has been prepared for the QML engine that allows inline delegates to be delayed in order to: a) replace them with custom delegates at construction time, which will not cause problems for asynchronous incubation and b) the performance (in terms of creation time) of a custom control is independent of built-in delegates. As soon as the necessary patch to the QML engine is ready, you can start using it in Qt Quick Controls 2.

Do you like it? Share on social networks!

BlinCT
  • Nov. 24, 2017, 3:05 p.m.

Интересные нововведения связанных с меню и его представления.

Comments

Only authorized users can post comments.
Please, Log in or Sign up
  • Last comments
  • Evgenii Legotckoi
    March 9, 2025, 9:02 p.m.
    К сожалению, я этого подсказать не могу, поскольку у меня нет необходимости в обходе блокировок и т.д. Поэтому я и не задавался решением этой проблемы. Ну выглядит так, что вам действитель…
  • VP
    March 9, 2025, 4:14 p.m.
    Здравствуйте! Я устанавливал Qt6 из исходников а также Qt Creator по отдельности. Все компоненты, связанные с разработкой для Android, установлены. Кроме одного... Когда пытаюсь скомпилиров…
  • ИМ
    Nov. 22, 2024, 9:51 p.m.
    Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
  • Evgenii Legotckoi
    Oct. 31, 2024, 11:37 p.m.
    Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
  • A
    Oct. 19, 2024, 5:19 p.m.
    Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html