Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Is it possible use QML Drawer and SwipeView types as QWidgets?



  • I create Qt apps using widgets since 1997. The QML is not useful for me. As I understand it was built over QWidgets and uses them under cover. Therefore QWidget based app I prefer as more economical and compact. Now I want create Android app with swipe based interface controls like Drawer and SwipeView QML types. But I do not see widget-based implementation of them both. I would expect QDrawer::QWidget class and something like QStackedWidget for SimpleView implementation. But they are not exist. May be it is implemented in some other manner, is it?

    If it is not possible use them both as widgets - then I will ask another question. How properly add these QML types to already designed and working widget-based application?


  • Qt Champions 2017

    QML is no more above the QWidgets. Now it is completely different and OpenGL based. You can use QML type and put widget wrapper using QWidget::createWindowContainer(..) function. There is NO widget based Swipe and drawer.


  • Lifetime Qt Champion

    Hi,

    QtQuick 1 was not on top of QWidget but used the graphics view framework. There never was a QWidget based drawer for QtQuick.

    Your best bet in this case as @dheerendra suggests is to go the other way around and use QtQuick stuff in your widget based application.



  • @dheerendra said in Is it possible use QML Drawer and SwipeView types as QWidgets?:

    QML is no more above the QWidgets. Not is completely different and OpenGL based. You can use QML type and put widget wrapper using QWidget::createWindowContainer(..) function.

    Ok, thanx, I read about this and looks like it is possible solution. But:

    There are widget based Swipe and drawer.

    If you are talking about Qt::Drawer then AFIAK this works only in MacOSX. But I create app for Android. If there is any other widget based drawer - then how to use it in Android?



  • And what if I need another widget inside QML Drawer? I just describe - There will be QListWidget on screen and I need another QListWidget on drawer dragable from screen side. QML In this drawer list items will be able to reorder by drag-n-drop. Drawer usage looks too much complex, quite redundantly.

    I am frustrating. Why there is no just QDrawer class working in all supported platforms?


  • Lifetime Qt Champion

    Because drawer as you see them is a pretty recent GUI addition that is pretty much exclusive to the mobile OS window management with the exception of macOS for some of their dialogs.

    You already have the QtQuick Controls 2 for desktop like controls in QML.



  • @SGaist this could be very good addition for other desktop OSes not having this feature. Without this it is not possible create truly multiplatform software.


Log in to reply