本文整理汇总了C++中QCheckBox::setMaximumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setMaximumSize方法的具体用法?C++ QCheckBox::setMaximumSize怎么用?C++ QCheckBox::setMaximumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setMaximumSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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)));
}
}