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 aligning QScrollBar
Forum Updated to NodeBB v4.3 + New Features

QScrollArea aligning QScrollBar

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 668 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.
  • T Offline
    T Offline
    Tannz0rz
    wrote on last edited by Tannz0rz
    #1

    I have a simple setup along these lines displaying a QHBoxLayout:

    QHBoxLayout *hbox = new QHBoxLayout();
    
    for(int i = 0; i < 50; ++i)
        hbox->addWidget(createLabel("test"));
    
    QWidget *hboxw = new QWidget();
    
    hboxw->setLayout(hbox);
    
    QScrollArea *scrollarea = new QScrollArea();
    
    scrollarea->setWidget(hboxw);
    

    How can I set the QScrollBar to align above the QHBoxLayout, rather than on the bottom?

    Thanks,
    Tannz0rz

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

      Hi,

      AFAIK, it's not possible without you reimplementing that part in Qt's source code. Note that you'll go against most platforms UI guidelines doing that.

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

      T 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        AFAIK, it's not possible without you reimplementing that part in Qt's source code. Note that you'll go against most platforms UI guidelines doing that.

        T Offline
        T Offline
        Tannz0rz
        wrote on last edited by
        #3

        @SGaist That's a shame. Thanks for the reply.

        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