Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QScrollArea aligning QScrollBar



  • 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


  • Lifetime Qt Champion

    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.



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


Log in to reply