本文整理汇总了C++中QCheckBox::setMinimumHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setMinimumHeight方法的具体用法?C++ QCheckBox::setMinimumHeight怎么用?C++ QCheckBox::setMinimumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setMinimumHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNewItem
void MainWindow::addNewItem()
{
// copied from ui_itemFrame.h
QHBoxLayout *itemLayout = new QHBoxLayout();
itemLayout->setObjectName(QString::fromUtf8("itemLayout"));
itemLayout->setSizeConstraint(QLayout::SetFixedSize);
QCheckBox *haveFoundCheckBox = new QCheckBox();
haveFoundCheckBox->setObjectName(QString::fromUtf8("haveFoundCheckBox"));
haveFoundCheckBox->setMinimumHeight(30);
itemLayout->addWidget(haveFoundCheckBox);
QLineEdit *amountBox = new QLineEdit();
amountBox->setObjectName(QString::fromUtf8("amountBox"));
amountBox->setMaximumSize(QSize(80, 16777215));
amountBox->setMinimumHeight(38);
amountBox->setMinimumWidth(100);
itemLayout->addWidget(amountBox);
QLineEdit *itemName = new QLineEdit();
itemName->setObjectName(QString::fromUtf8("itemName"));
itemName->setMinimumHeight(38);
itemName->setMinimumWidth(300);
itemLayout->addWidget(itemName);
QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
itemLayout->addItem(horizontalSpacer);
QPushButton *deleteButton = new QPushButton();
deleteButton->setObjectName(QString::fromUtf8("deleteButton"));
deleteButton->setText("Remove");
deleteButton->setMinimumHeight(38);
//deleteButton->setCenterButtons(false);
itemLayout->addWidget(deleteButton);
// end of copied from ui_itemFrame.h
// Doesn't work atm?
//QObject::connect(deleteButton, SIGNAL(clicked(QAbstractButton*)), haveFoundCheckBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), amountBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), itemName, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), deleteButton, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), haveFoundCheckBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), itemLayout, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), this,SLOT(itemWasRemoved()));
ui->mainLayout->addLayout(itemLayout);
widgetsize+=80; // in principle should also reduce when removing item, need to create a slot...
ui->scrollAreaContents->setFixedHeight(widgetsize);
}
示例2: addCheck
// Create new checkbox widget
QtWidgetObject* AtenTreeGuiDialog::addCheck(TreeGuiWidget* widget, QString label)
{
QtWidgetObject* qtwo = widgetObjects_.add();
QCheckBox *check = new QCheckBox(this);
qtwo->set(widget, check);
check->setText(label);
check->setChecked(widget->valueI());
check->setEnabled(widget->enabled());
check->setVisible(widget->visible());
check->setMinimumHeight(WIDGETHEIGHT);
check->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
// Connect signal to master slot
QObject::connect(check, SIGNAL(clicked(bool)), this, SLOT(checkBoxWidget_clicked(bool)));
return qtwo;
}
示例3: init
void OpenDistant::init() {
idRecipeToOpen = -1;
ui->categoriesBox->setContentsMargins(0,10,0,0);
/*ui->categoriesBox->setMinimumHeight(70);*/
QVBoxLayout *catLay = new QVBoxLayout(ui->scrollCatsContent);
catLay->setMargin(0);
catLay->setContentsMargins(0,10,0,0);
catLay->setSpacing(2);
foreach (QString cat, namesCats) {
QCheckBox *catI = new QCheckBox(cat);
catI->setMaximumHeight(21);
catI->setMinimumHeight(21);
catLay->addWidget(catI);
cboxes.append(catI);
connect(catI, SIGNAL(stateChanged(int)), this, SLOT(stateChanged()));;
}
示例4: buildLayerBox
void OsgForm::buildLayerBox()
{
QGridLayout *grid = new QGridLayout(ui->layerFrame);
for (int row=0 ; row < numRowsOfLayerButtons ; row++) {
for (int col=0 ; col < numColsOfLayerButtons ; col++) {
QCheckBox * cb = new QCheckBox(ui->layerFrame);
cb->setCheckable(true);
cb->setChecked(false);
cb->setMinimumWidth(12);
cb->setMinimumHeight(16);
grid->addWidget(cb, row, (numColsOfLayerButtons-1)-col);
connect(cb, SIGNAL(stateChanged(int)),
this, SLOT(tweakCameraMaskBit(int)));
m_checkBoxes.append(cb);
}
}
grid->setHorizontalSpacing(0);
grid->setVerticalSpacing(0);
grid->setContentsMargins(0,0,0,0);
}