Qt: 自动调整到最合适的大小

Qt: 自动调整到最合适的大小
SortDialog::SortDialog(QWidget  * parent) :
    QDialog(parent) {
    setupUi(
this );

    groupBox_2
-> hide();
    groupBox_3
-> hide();

    layout()
-> setSizeConstraint(QLayout::SetFixedSize);

    setColumnRange(
' A ' ' Z ' );
}

SortDialog::
~ SortDialog() {
}

void  SortDialog::setColumnRange(QChar first, QChar last) {
    primaryColumnComboBox
-> clear();
    secondaryColumnComboBox
-> clear();
    tertiaryColumnComboBox
-> clear();
    secondaryColumnComboBox
-> addItem(tr( " None " ));
    tertiaryColumnComboBox
-> addItem(tr( " None " ));
    primaryColumnComboBox
-> setMinimumSize(secondaryColumnComboBox -> sizeHint());

    QChar ch 
=  first;
    
while  (ch  <=  last) {
        primaryColumnComboBox
-> addItem(QString(ch));
        secondaryColumnComboBox
-> addItem(QString(ch));
        tertiaryColumnComboBox
-> addItem(QString(ch));

        ch 
=  ch.unicode()  +   1 ;
    }
}

你可能感兴趣的:(Qt: 自动调整到最合适的大小)