首页 > 代码库 > 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;
}
}
http://www.cppblog.com/biao/archive/2008/03/17/44720.html
Qt: 自动调整到最合适的大小(不是很明白)