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. QHBoxLayout and QTreeWidgetItem

QHBoxLayout and QTreeWidgetItem

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k 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
    tomas.soltys
    wrote on last edited by
    #1

    Hi all,

    I have encountered this behavior which I do not understand.

    @
    QWidget *layoutWidget = new QWidget;

    QHBoxLayout *layout = new QHBoxLayout;
    layoutWidget->setLayout(layout);

    QPushButton *cancelButton = new QPushButton("Cancel");
    layout->addWidget(cancelButton);

    QPushButton *okButton = new QPushButton("Ok");
    layout->addWidget(okButton);

    QTreeWidgetItem *item = new QTreeWidgetItem(parent);
    this->setItemWidget(item,0,layoutWidget);
    @

    And the result is that the height of the row which contains two buttons is too small and buttons are not fully visible.

    Can anyone explain me what is wrong with the code above?

    Thanks,

    Tomas

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      This is a total shot in the dark, but perhaps check if your QTreeWidget has the "uniformRowHeights" flag set?

      http://www.goblincoding.com

      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