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
#include <QApplication>
#include <QComboBox>
int main(int argc, char *argv[])
{
w.resize(200, 200);
cb.setFixedSize(120, 60);
cb.addItems({"1", "2", "3", "4", "5"});
cb.setStyleSheet(R"(
QComboBox {
padding-top: 20;
}
)");
w.show();
return app.exec();
}
#include <QApplication>
#include <QComboBox>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget w;
w.resize(200, 200);
QComboBox cb(&w);
cb.setFixedSize(120, 60);
cb.addItems({"1", "2", "3", "4", "5"});
cb.setStyleSheet(R"(
QComboBox {
padding-top: 20;
}
)");
w.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks