Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to make QQuickView scrollable?
Forum Updated to NodeBB v4.3 + New Features

How to make QQuickView scrollable?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fant
    wrote on last edited by
    #1

    Hello,

    I add a QQuickView instance to QWidget and want to add a scrollbar, too. So I could have a large area of QQuickView in a smaller widget, where I could scrolling. But I does not really know, how I can make it. I try it with ScrollArea, but this is not successful:

    @
    QQuickView *view = new QQuickView(this);
    view.setMinimumSize(1600, 1000);

    QScrollArea *area = new QScrollArea(this);
    QWidget container = new QWidget(qobject_cast<QWidget>(area));
    container->setMinimumSize(view->minimumWidth(), view->minimumHeight());
    area->setWidget(container->createWindowContainer(view, container->parentWidget()));
    area->setWidgetResizable(true);
    area->setMinimumSize(600, 500);
    area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    area->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    @

    Hopefully, anyone can help me?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Torgeir
      wrote on last edited by
      #2

      I haven't tried what you are attempting, but I would recommend to put the scrollbars inside the QtQuick code by using a ScrollView from QtQuick.Controls.

      This would save quite a bit of resources since the framebuffer of the QQuickView will be limited to what is shown on screen.

      You can have arbitrarily large ScrollView this way, but with your approach you will be limited by the maximum size of an OpenGL window.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fant
        wrote on last edited by
        #3

        Ok, thank you for answer. Meanwhile I decide to use QGraphicsScene and set QQuickView aside, in spite of advantages like QML 2.0.

        I set this thread not as solved, in case somebody else still searching another answer to this question or somebody else knows another answer, too.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved