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. How to adjust QComboBox view max height?
Forum Updated to NodeBB v4.3 + New Features

How to adjust QComboBox view max height?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.2k 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
    Tapsa
    wrote on last edited by
    #1

    The anemic 132 pixel default max height is too small. I want the height to vary between 0 and 400 pixels depending on the amount of items.

    AComboBox::AComboBox(QWidget *papa, size_t length)
        : QComboBox(papa)
    {
        setFixedWidth(length);
        view()->setMinimumWidth(ALineEdit::GIANT);
        view()->setMaximumHeight(400);
    }
    

    Above code has no effect and if I use min height instead then there is lots of blank space if too few items exist.

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

      Hi
      Not a direct answer but have you looked at
      http://doc.qt.io/qt-5.5/qcombobox.html#maxVisibleItems-prop

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved