本文整理汇总了C++中QCheckBox::setMaximumWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setMaximumWidth方法的具体用法?C++ QCheckBox::setMaximumWidth怎么用?C++ QCheckBox::setMaximumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setMaximumWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void KisWdgIndexColors::setup(QStringList shadesLabels, int ramps)
{
int rows = shadesLabels.length();
int collumns = ramps;
m_colorSelectors.resize(rows);
m_stepSpinners.resize(rows-1);
// Labels for the shades
for(int row = 0; row < rows; ++row)
{
QLabel* l = new QLabel(shadesLabels[row], ui->colorsBox);
ui->layoutColors->addWidget(l, row+1, 0);
m_colorSelectors[row].resize(collumns);
}
// Labels for the ramps
/*for(int col = 0; col < collumns; ++col)
{
QLabel* l = new QLabel(rampsLabels[col], ui->colorsBox);
l->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
ui->layoutColors->addWidget(l, 0, col+1);
}*/
// Step selectors for the shade gradients
for(int row = 0; row < (rows-1); ++row)
{
QLabel* l0 = new QLabel(shadesLabels[row+1]);
QLabel* l1 = new QLabel(QString::fromUtf8("↔"));
QLabel* l2 = new QLabel(shadesLabels[row]);
QSpinBox* s = new KisIntParseSpinBox();
s->setMinimum(0);
s->setMaximum(32);
s->setValue(2);
connect(s, SIGNAL(valueChanged(int)), this, SIGNAL(sigConfigurationItemChanged()));
m_stepSpinners[row] = s;
ui->layoutRowSteps->addWidget(l0, row, 0);
ui->layoutRowSteps->addWidget(l1, row, 1);
ui->layoutRowSteps->addWidget(l2, row, 2);
ui->layoutRowSteps->addWidget(s, row, 3);
}
// Color selectors
for(int y = 0; y < rows; ++y)
for(int x = 0; x < collumns; ++x)
{
KisColorButton* b = new KisColorButton;
QCheckBox* c = new QCheckBox;
c->setChecked(false);
b->setEnabled(false);
b->setMaximumWidth(50);
c->setMaximumWidth(21); // Ugh. I hope this won't be causing any issues. Trying to get rid of the unnecessary spacing after it.
connect(c, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
connect(c, SIGNAL(toggled(bool)), this, SIGNAL(sigConfigurationItemChanged()));
connect(b, SIGNAL(changed(KoColor)), this, SIGNAL(sigConfigurationItemChanged()));
QHBoxLayout* cell = new QHBoxLayout();
cell->setSpacing(0);
cell->setContentsMargins(0, 0, 0, 0);
cell->addWidget(c);
cell->addWidget(b);
ui->layoutColors->addLayout(cell, 1+y, 1+x);
m_colorSelectors[y][x].button = b;
m_colorSelectors[y][x].checkbox = c;
}
}