码迷,mamicode.com
首页 > 其他好文 > 详细

Qt: 自动调整到最合适的大小(不是很明白)

时间:2016-10-20 00:09:22      阅读:371      评论:0      收藏:0      [点我收藏+]

标签:

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: 自动调整到最合适的大小(不是很明白)

标签:

原文地址:http://www.cnblogs.com/findumars/p/5979187.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!