当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckBox::setMinimumHeight方法代码示例

本文整理汇总了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);
}
开发者ID:Eothred,项目名称:shoppinglist,代码行数:51,代码来源:mainwindow.cpp

示例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;
}
开发者ID:alinelena,项目名称:aten,代码行数:16,代码来源:treegui_funcs.cpp

示例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()));;
    }
开发者ID:FloArt,项目名称:qrecipewriter,代码行数:16,代码来源:opendistant.cpp

示例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);
}
开发者ID:iraytrace,项目名称:osgTreeWidget,代码行数:20,代码来源:OsgForm.cpp


注:本文中的QCheckBox::setMinimumHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。