Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QScrollArea aligning QScrollBar

    General and Desktop
    2
    3
    507
    Loading More Posts
    • 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
      Tannz0rz last edited by Tannz0rz

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 1
        • T
          Tannz0rz @SGaist last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post