Results 1 to 6 of 6

Thread: QComboBox padding bug

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2018
    Posts
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Exclamation QComboBox padding bug

    Hello.

    I walking into a strange behaviour of QComboBox.

    When padding-top is applied to QComboBox its popup gains equal value top and bottom paddings somehow.
    Any other padding set for the ComboBox does not affect paddings inside its popup.
    You can see them on attached image.

    I haven't found any solution to remove those paddings from popup.

    The question is how to removed them or if it is a bug is there any known workaround?

    Here is minimal example to reproduce this.

    OS Ubuntu 16.03, Qt 5.5.1

    Qt Code:
    1. #include <QApplication>
    2. #include <QComboBox>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7.  
    8. w.resize(200, 200);
    9. QComboBox cb(&w);
    10.  
    11. cb.setFixedSize(120, 60);
    12. cb.addItems({"1", "2", "3", "4", "5"});
    13. cb.setStyleSheet(R"(
    14. QComboBox {
    15. padding-top: 20;
    16. }
    17. )");
    18.  
    19. w.show();
    20.  
    21. return app.exec();
    22. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. Replies: 3
    Last Post: 17th October 2019, 14:35
  2. QwtText background padding
    By Maximus2 in forum Qwt
    Replies: 9
    Last Post: 6th December 2018, 07:36
  3. Qwt: curve with padding
    By alperyazir in forum Qwt
    Replies: 1
    Last Post: 11th November 2014, 10:19
  4. QLineEdit padding
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 17th September 2008, 22:43
  5. QString:: Padding Zeros?
    By Harvey West in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2007, 18:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.