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. Adding ScrollArea to the flowLayout
Forum Updated to NodeBB v4.3 + New Features

Adding ScrollArea to the flowLayout

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 240 Views
  • 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.
  • Swati777999S Offline
    Swati777999S Offline
    Swati777999
    wrote on last edited by Swati777999
    #1

    Hi All ,

    I have got an array of buttons as below :

    {
    FlowLayout *flowLayout = new FlowLayout(this);
    int n=20;
    QVector <QPushButton *> buttons(n);
    
    for (int ii=0;ii<n;ii++)
    {
        QPushButton * pb = new QPushButton(); // creating buttons
    
           pb->setMinimumSize(200,200);
           buttons.push_back(pb); // adding buttons to qvector
    
           flowLayout->addWidget(pb);
    }
    this->show();
    }
    

    How can I add scrollArea to this view as the bottom of some of the buttons are clipped off?

    “ In order to be irreplaceable, one must always be different” – Coco Chanel

    jsulmJ 1 Reply Last reply
    0
    • Swati777999S Swati777999

      Hi All ,

      I have got an array of buttons as below :

      {
      FlowLayout *flowLayout = new FlowLayout(this);
      int n=20;
      QVector <QPushButton *> buttons(n);
      
      for (int ii=0;ii<n;ii++)
      {
          QPushButton * pb = new QPushButton(); // creating buttons
      
             pb->setMinimumSize(200,200);
             buttons.push_back(pb); // adding buttons to qvector
      
             flowLayout->addWidget(pb);
      }
      this->show();
      }
      

      How can I add scrollArea to this view as the bottom of some of the buttons are clipped off?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Swati777999 Isn't this already discussed here: https://forum.qt.io/topic/132782/syntax-for-vector-of-qpushbuttons-added-to-flowlayout ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Swati777999S 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Swati777999 Isn't this already discussed here: https://forum.qt.io/topic/132782/syntax-for-vector-of-qpushbuttons-added-to-flowlayout ?

        Swati777999S Offline
        Swati777999S Offline
        Swati777999
        wrote on last edited by
        #3

        @jsulm said in Adding ScrollArea to the flowLayout:

        @Swati777999 Isn't this already discussed here: https://forum.qt.io/topic/132782/syntax-for-vector-of-qpushbuttons-added-to-flowlayout ?

        Yes, but since the above question has taken a different turn, so I thought of asking it from a different solution, different from my design.

        “ In order to be irreplaceable, one must always be different” – Coco Chanel

        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