本文整理汇总了C++中QCheckBox::x方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::x方法的具体用法?C++ QCheckBox::x怎么用?C++ QCheckBox::x使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::x方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container)
{
setWidget(w, container);
// m_container = container;
if(classname == "KLineEdit")
{
KLineEdit *lineedit = static_cast<KLineEdit*>(w);
createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true);
return true;
}
else if(classname == "QLabel")
{
QLabel *label = static_cast<QLabel*>(w);
if(label->textFormat() == RichText)
{
//m_widget = w;
// setWidget(w, container);
editText();
}
else
createEditor(classname, label->text(), label, container, label->geometry(), label->alignment());
return true;
}
else if(classname == "KPushButton")
{
KPushButton *push = static_cast<KPushButton*>(w);
QRect r = w->style().subRect(QStyle::SR_PushButtonContents, w);
QRect editorRect = QRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height());
//r.setX(r.x() + 5);
//r.setY(r.y() + 5);
//r.setWidth(r.width()-10);
//r.setHeight(r.height() - 10);
createEditor(classname, push->text(), push, container, editorRect, Qt::AlignCenter, false, false, Qt::PaletteButton);
return true;
}
else if(classname == "QRadioButton")
{
QRadioButton *radio = static_cast<QRadioButton*>(w);
QRect r = w->style().subRect(QStyle::SR_RadioButtonContents, w);
QRect editorRect = QRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height());
createEditor(classname, radio->text(), radio, container, editorRect, Qt::AlignAuto);
return true;
}
else if(classname == "QCheckBox")
{
QCheckBox *check = static_cast<QCheckBox*>(w);
//QRect r(check->geometry());
//r.setX(r.x() + 20);
QRect r = w->style().subRect(QStyle::SR_CheckBoxContents, w);
QRect editorRect = QRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height());
createEditor(classname, check->text(), check, container, editorRect, Qt::AlignAuto);
return true;
}
else if((classname == "KComboBox") || (classname == "KListBox"))
{
QStringList list;
if(classname == "KListBox")
{
KListBox *listbox = (KListBox*)w;
for(uint i=0; i < listbox->count(); i++)
list.append(listbox->text(i));
}
else if(classname == "KComboBox")
{
KComboBox *combo = (KComboBox*)w;
for(int i=0; i < combo->count(); i++)
list.append(combo->text(i));
}
if(editList(w, list))
{
if(classname == "KListBox")
{
((KListBox*)w)->clear();
((KListBox*)w)->insertStringList(list);
}
else if(classname == "KComboBox")
{
((KComboBox*)w)->clear();
((KComboBox*)w)->insertStringList(list);
}
}
return true;
}
else if((classname == "KTextEdit") || (classname == "KDateTimeWidget") || (classname == "KTimeWidget") ||
(classname == "KDateWidget") || (classname == "KIntSpinBox")) {
disableFilter(w, container);
return true;
}
return false;
}