I'm encountering an odd widget sizing difference on Windows, namely if I have a 
QPushButton and a QComboBox together in a horizontal layout, and I set them 
both to have the same fixed height, the do not appear to have the same height - 
the combobox appears correct, but the push button is a couple pixels shorter:
[cid:image003.jpg@01D5792C.44563540]

The exact same code running on Linux produces what I'd expect - both widgets 
have the same height:
[cid:image004.jpg@01D5792C.44563540]

Sample code:
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QPushButton* pb = new QPushButton("Push Me");
    pb->setFixedHeight(35);

    QComboBox* cmb = new QComboBox();
    cmb->addItem("A");
    cmb->addItem("B");
    cmb->addItem("C");
    cmb->setFixedHeight(35);

    QTableWidget* table = new QTableWidget(3,2);

    QHBoxLayout* hbox = new QHBoxLayout();
    hbox->addWidget(pb);
    hbox->addWidget(cmb);
    hbox->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, 
QSizePolicy::Preferred));

    QVBoxLayout* vbox = new QVBoxLayout();
    vbox->addItem(hbox);
    vbox->addWidget(table);

    QWidget* w = new QWidget(this);
    w->setLayout(vbox);

    setCentralWidget(w);
}

Windows machine is running Windows 10 Pro.
Linux machine is Elementary OS 5.0
Both programs are Qt 5.12.3, 64 bit.



This message has been scanned for malware by Forcepoint. www.forcepoint.com
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to