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. QScrollArea in Qml: Flickable + QQuickPaintedItem
Forum Updated to NodeBB v4.3 + New Features

QScrollArea in Qml: Flickable + QQuickPaintedItem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlquickflickableqscrollarea
1 Posts 1 Posters 1.1k Views
  • 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.
  • A Offline
    A Offline
    alan73
    wrote on 17 Feb 2016, 15:02 last edited by
    #1

    I'm trying to realize something similiar to QScrollArea (in widgets world) with the help of Qml.
    I decided to probe Flickable plus QQuickPaintedItem based item (named Drawer in my case):

    Flickable {
      ...
      onContentXChanged(): {
      drawer.update()
      }
    
    Drawer {
      id: drawer
      ...
    }
    

    Drawer's render target is set to FrameBufferObject. Its paint function looks like this:

    void Drawer::paint(QPainter *painter)
    {
       // Some function to compute rect which is needed to be redrawn
       QRect updateRect = computeUpdateRect();
    
       // How to shift contents of Frame buffer, e.g. to right, and draw only updateRect in this space?
    }
    

    Imagine how we do scrolling in QScrollArea widget, e.g. to left: all entry of viewport is shifted to right and the only small rect in left is redrawn.
    I want to do the same with Flickable+QQuickPaintedItem. But I can't understand some things:

    1. How can I manipulate Frame Buffer object inside QQuickPaintedItem?
    2. Maybe there is some more right way to implement QScrollArea in QML?

    By the way, is double buffering enabled by default in QQuickPaintedItem?

    1 Reply Last reply
    0

    1/1

    17 Feb 2016, 15:02

    • Login

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