本文整理汇总了C++中QCheckBox::setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setMinimumSize方法的具体用法?C++ QCheckBox::setMinimumSize怎么用?C++ QCheckBox::setMinimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setMinimumSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
FieldSelect::FieldSelect(Procview *pv, Proc *proc)
: QDialog(0, "select fields"),
nbuttons(proc->cats.size()),
disp_fields(nbuttons),
procview(pv)
{
QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
updating = FALSE;
setCaption("qps: select fields");
buts = new QCheckBox*[nbuttons];
QGridLayout *l1 = new QGridLayout((nbuttons + 1) / 2, 5, 0);
tl->addLayout(l1, 1);
l1->addColSpacing(2, 15);
int half = (nbuttons + 1) / 2;
for(int i = 0; i < nbuttons; i++) {
QCheckBox *but = new QCheckBox(proc->cats[i]->name, this);
QLabel *desc = new QLabel(proc->cats[i]->help, this);
but->setMinimumSize(but->sizeHint());
desc->setMinimumSize(desc->sizeHint());
if(i < half) {
l1->addWidget(but, i, 0);
l1->addWidget(desc, i, 1);
} else {
l1->addWidget(but, i-half, 3);
l1->addWidget(desc, i-half, 4);
}
buts[i] = but;
connect(but, SIGNAL(toggled(bool)), this, SLOT(field_toggled(bool)));
}
update_boxes();
KButtonBox *bbox = new KButtonBox(this);
bbox->addStretch(1);
QPushButton *closebut = bbox->addButton(i18n("Close"));
closebut->setDefault(TRUE);
closebut->setFocus();
closebut->setFixedSize(closebut->sizeHint());
bbox->layout();
tl->addWidget(bbox);
connect(closebut, SIGNAL(clicked()), SLOT(closed()));
QAccel *acc = new QAccel(this);
acc->connectItem(acc->insertItem(CTRL + Key_W),
this, SLOT(closed()));
tl->freeze();
}
示例2: init
void StartDlg::init(QStringList partsName)
{
FlowLayout *layout = new FlowLayout(ui->groupBox);
for(int i=0;i<partsName.count();i++)
{
QCheckBox *check = new QCheckBox(partsName.at(i),ui->groupBox);
check->setChecked(true);
check->setMinimumSize(QSize(100, check->height()));
layout->addWidget(check);
checkList.append(check);
}
adjustSize();
ui->groupBox->setLayout(layout);
}
示例3: setItemList
void toDo::setItemList(QList<ToDoItem> current)
{
ui->addnew->setStyleSheet("#addnew{background-color: #ddd; color: #23121C; border: 1px solid #bbb;}"
"#addnew:hover{color: #000; border: 1px solid #446CB3;}");
ui->addnew->setMinimumSize(QSize(30, 30));
ui->addnew->setMaximumSize(QSize(30, 30));
this->toItems = current;
qDebug() << toItems.length();
for(int i=0;i<toItems.length();i++)
{
qDebug() << "Aufgabe: " << toItems[i].getDescription();
QSignalMapper* checkedMapper = new QSignalMapper(this);
QSignalMapper* deleteMapper = new QSignalMapper(this);
QWidget *fixedWidget = new QWidget;
QHBoxLayout *horizontalLayout = new QHBoxLayout(fixedWidget);
horizontalLayout->setSpacing(7);
fixedWidget->setFixedHeight(35);
QFont font1;
font1.setPointSize(9);
QLabel *label_date = new QLabel(toItems[i].getDeadline().toString("dd.MM.yyyy hh:mm"));
qDebug() << "QDateTime: "<< toItems[i].getDeadline().date();
qDebug() << "Date: " << toItems[i].getDeadline().toString(Qt::TextDate);
label_date->setMinimumSize(QSize(120, 25));
label_date->setMaximumSize(QSize(120 , 25));
label_date->setFont(font1);
horizontalLayout->addWidget(label_date, 0, Qt::AlignTop);
QLabel *label_desc = new QLabel(toItems[i].getDescription());
label_desc->setMinimumSize(QSize(270, 25));
label_desc->setMaximumSize(QSize(16777215, 25));
label_desc->setFont(font1);
horizontalLayout->addWidget(label_desc, 0, Qt::AlignTop);
int a = toItems[i].getSubjectID();
qDebug() << "Name of Subject: " << pDBh->select("name", "SchoolSubject", "pk_id=" + QString::number(a));
//QLabel *label_subj = new QLabel(pDBh->select("subject_name", "SchoolSubject", "id='" + toItems[i].getSubjectID() + "'"));
QLabel *label_subj = new QLabel(pDBh->select("name", "SchoolSubject", "pk_id=" + QString::number(a)));
label_subj->setMinimumSize(QSize(150, 25));
label_subj->setMaximumSize(QSize(150, 25));
label_subj->setFont(font1);
label_subj->setObjectName(QStringLiteral("labelSub"));
horizontalLayout->addWidget(label_subj, 0, Qt::AlignTop);
QCheckBox *checkBox = new QCheckBox();
checkBox->setMinimumSize(QSize(25, 25));
checkBox->setMaximumSize(QSize(25, 25));
qDebug() << "Done: " << toItems[i].getDone();
checkBox->setChecked(toItems[i].getDone());
horizontalLayout->addWidget(checkBox, 0, Qt::AlignTop);
QPushButton *pButton = new QPushButton();
QPixmap pixmap = QPixmap (":/images/icons/icon_waste_white.png");
pButton->setIcon(QIcon(pixmap));
pButton->setIconSize(QSize(20, 20));
pButton->setObjectName(QStringLiteral("deleteButton"));
pButton->setMinimumSize(QSize(25, 25));
pButton->setMaximumSize(QSize(25, 25));
pButton->setStyleSheet("#deleteButton{background-color: #F22613; color: #23121C; border: 1px solid #000; border-radius: 2px;}"
"#deleteButton:hover{color: #000; border: 1px solid #888;}");
horizontalLayout->addWidget(pButton, 0, Qt::AlignTop);
ui->verticalLayout_2->addWidget(fixedWidget, 0, Qt::AlignTop);
QFrame *line_2 = new QFrame();
line_2->setObjectName(QStringLiteral("line_2"));
line_2->setFrameShape(QFrame::HLine);
line_2->setFrameShadow(QFrame::Sunken);
ui->verticalLayout_2->addWidget(line_2, Qt::AlignTop);
connect(checkBox, SIGNAL(clicked()), checkedMapper, SLOT(map()));
checkedMapper->setMapping(checkBox, i);
connect(checkedMapper, SIGNAL(mapped(int)), this, SLOT(check(int)));
connect(pButton, SIGNAL(clicked()), deleteMapper, SLOT(map()));
deleteMapper->setMapping(pButton, i);
connect(deleteMapper, SIGNAL(mapped(int)), this, SLOT(deleteToDo(int)));
}
}