本文整理汇总了C++中QCheckBox::setFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setFixedWidth方法的具体用法?C++ QCheckBox::setFixedWidth怎么用?C++ QCheckBox::setFixedWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setFixedWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QComboBox
void koregui::FrameBufferEditor::addNewAttachment(void) {
if(!_currentbuffer) return;
ui.tableWidget->setRowCount(ui.tableWidget->rowCount() + 1);
//ui.tableWidget
// Attachments
QComboBox* combo = new QComboBox();
combo->addItem("COLOR", QVariant(GL_COLOR_ATTACHMENT0));
combo->addItem("DEPTH", QVariant(GL_DEPTH_ATTACHMENT));
combo->addItem("STENCIL", QVariant(GL_STENCIL_ATTACHMENT));
combo->addItem("DEPTH/STENCIL", QVariant(GL_DEPTH_STENCIL_ATTACHMENT));
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 0, combo);
// Resolution
QWidget* reswidget = new QWidget();
QHBoxLayout* hlay = new QHBoxLayout();
QLineEdit* lineedit = new QLineEdit("512");
lineedit->setValidator(new QIntValidator());
hlay->addWidget(lineedit);
QLabel* label = new QLabel("x");
hlay->addWidget(label);
lineedit = new QLineEdit("512");
lineedit->setValidator(new QIntValidator());
hlay->addWidget(lineedit);
QCheckBox* cbox = new QCheckBox("auto");
cbox->setFixedWidth(50);
hlay->addWidget(cbox);
hlay->setContentsMargins(QMargins(0,0,0,0));
reswidget->setLayout(hlay);
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 1, reswidget);
// Format
combo = new QComboBox();
combo->addItem("RGBA", QVariant(GL_RGBA));
combo->addItem("RGB", QVariant(GL_RGB));
combo->addItem("RG", QVariant(GL_RG));
combo->addItem("R", QVariant(GL_RED));
combo->addItem("DEPTH", QVariant(GL_DEPTH_COMPONENT));
combo->addItem("DEPTH_STENCIL", QVariant(GL_DEPTH_STENCIL));
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 2, combo);
// Internal format
combo = new QComboBox();
this->setInternalFormatCombo(GL_RGBA, combo);
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 3, combo);
// Pixel type
combo = new QComboBox();
combo->addItem("UNSIGNED_BYTE", QVariant(GL_UNSIGNED_BYTE));
combo->addItem("BYTE", QVariant(GL_BYTE));
combo->addItem("UNSIGNED_SHORT", QVariant(GL_UNSIGNED_SHORT));
combo->addItem("SHORT", QVariant(GL_SHORT));
combo->addItem("UNSIGNED_INT", QVariant(GL_UNSIGNED_INT));
combo->addItem("INT", QVariant(GL_INT));
combo->addItem("FLOAT", QVariant(GL_FLOAT));
combo->addItem("UNSIGNED_BYTE_3_3_2",
QVariant(GL_UNSIGNED_BYTE_3_3_2));
combo->addItem("UNSIGNED_BYTE_2_3_3_REV",
QVariant(GL_UNSIGNED_BYTE_2_3_3_REV));
combo->addItem("UNSIGNED_SHORT_5_6_5",
QVariant(GL_UNSIGNED_SHORT_5_6_5));
combo->addItem("UNSIGNED_SHORT_5_6_5_REV",
QVariant(GL_UNSIGNED_SHORT_5_6_5_REV));
combo->addItem("UNSIGNED_SHORT_4_4_4_4",
QVariant(GL_UNSIGNED_SHORT_4_4_4_4));
combo->addItem("UNSIGNED_SHORT_5_5_5_1",
QVariant(GL_UNSIGNED_SHORT_5_5_5_1));
combo->addItem("UNSIGNED_SHORT_1_5_5_5_REV",
QVariant(GL_UNSIGNED_SHORT_1_5_5_5_REV));
combo->addItem("UNSIGNED_INT_8_8_8_8",
QVariant(GL_UNSIGNED_INT_8_8_8_8));
combo->addItem("UNSIGNED_INT_8_8_8_8_REV",
QVariant(GL_UNSIGNED_INT_8_8_8_8_REV));
combo->addItem("UNSIGNED_INT_10_10_10_2",
QVariant(GL_UNSIGNED_INT_10_10_10_2));
combo->addItem("UNSIGNED_INT_2_10_10_10_REV",
QVariant(GL_UNSIGNED_INT_2_10_10_10_REV));
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 4, combo);
}