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. QScrollArea Not Expanding QCreate
Forum Updated to NodeBB v4.3 + New Features

QScrollArea Not Expanding QCreate

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 500 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.
  • C Offline
    C Offline
    cdecde57
    wrote on last edited by cdecde57
    #1

    Hello! I have a Scroll Area that I have filled with some random widgets. The QScrollArea has a grid layout and when I resize the application these are my results:
    Screen Shot 2021-03-06 at 11.54.57 AM.png

    (When Enlarged)

    Screen Shot 2021-03-06 at 11.55.07 AM.png

    (When Squished Side ways)
    Screen Shot 2021-03-06 at 11.57.41 AM.png

    I am using QCreator and am unsure as to why the QScrollArea is not operating like it should, it operates like it should when squished sideways, but not vertically?

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

      Hi,

      @cdecde57 said in QScrollArea Not Expanding QCreate:

      QScrollArea has a grid layout

      That's your issue, that layout should be on a widget that you set on your QScrollArea.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • C Offline
        C Offline
        cdecde57
        wrote on last edited by cdecde57
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • C Offline
          C Offline
          cdecde57
          wrote on last edited by cdecde57
          #4

          @SGaist I got it almost working and I thought it was working but it wasn't

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            You're welcome !

            Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cdecde57
              wrote on last edited by cdecde57
              #6

              I went and added a handful of buttons that are inside of a layout. I placed this layout into the scroll area, but it does not scroll. Screen Shot 2021-03-06 at 12.40.16 PM.png

              Ive already tried looking it up and I think I am doing what they want, but it does not work some reason?

              @SGaist

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                As I already wrote, do not put a layout on the QScrollArea. That's not the way to use it.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  cdecde57
                  wrote on last edited by cdecde57
                  #8

                  Do you know any resource where I could better understand the QScrollArea using UI editor in QCreate?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Sorry I do not. I usually build my interfaces through code which might be easier in your case if you have to add lots of widgets to your area.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    C 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Sorry I do not. I usually build my interfaces through code which might be easier in your case if you have to add lots of widgets to your area.

                      C Offline
                      C Offline
                      cdecde57
                      wrote on last edited by cdecde57
                      #10

                      @SGaist Sorry for the long reply, I was afk. What you said worked! Really need to watch those layouts, gotta set the QScrollArea to have a QWidget in it, that widget gets the main layout you want and it expands as you need.Thank you for your help and time!

                      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