Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAbstractScrollArea
Forum Updated to NodeBB v4.3 + New Features

QAbstractScrollArea

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 518 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.
  • I Offline
    I Offline
    ikuris
    wrote on last edited by
    #1

    Hello,

    How can I put QAbstractScrollArea in ui. I am trying to draw shapes in it but I couldnt find any example and if you provide me with project or any usage of it it would be great.

    Thanks a lot.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Why do you want to use QAbstractScrollArea ?

      There is QScrollArea you can use directly.

      If you want to have a scrollable paint area, you can simply use a custom widget as a content widget
      https://doc.qt.io/qt-6/qscrollarea.html#setWidget

      I 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        Why do you want to use QAbstractScrollArea ?

        There is QScrollArea you can use directly.

        If you want to have a scrollable paint area, you can simply use a custom widget as a content widget
        https://doc.qt.io/qt-6/qscrollarea.html#setWidget

        I Offline
        I Offline
        ikuris
        wrote on last edited by
        #3

        @mrjj
        I do need a lower version of qscrollarea and I am curious about its usage.
        I will compare their usability afterwards.

        JonBJ 1 Reply Last reply
        0
        • I ikuris

          @mrjj
          I do need a lower version of qscrollarea and I am curious about its usage.
          I will compare their usability afterwards.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @ikuris
          I don't think you can put a QAbstractScrollArea in with Designer, else there would be an icon widget for it.

          1 Reply Last reply
          1
          • I Offline
            I Offline
            ikuris
            wrote on last edited by
            #5

            You can just add it to the layout with addWidget() but I couldnt override paintEvent of QAbstractScrollArea.
            I tried drawing some rectangles in it but it didn't work.

            mrjjM 1 Reply Last reply
            0
            • I ikuris

              You can just add it to the layout with addWidget() but I couldnt override paintEvent of QAbstractScrollArea.
              I tried drawing some rectangles in it but it didn't work.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @ikuris
              Hi
              Im not sure using QAbstractScrollArea is the correct way for a canvas that can scroll.
              In QScrollArea the actual paint of the QScrollArea would be covered up by the content widget.
              Not sure if same dont apply to QAbstractScrollArea :)

              1 Reply Last reply
              2

              • Login

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