本文整理汇总了C++中QCheckBox::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::resize方法的具体用法?C++ QCheckBox::resize怎么用?C++ QCheckBox::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::resize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addComponent
void CGTabPage::addComponent(QString name, QString prop, QString var, quint16 x, quint16 y, quint16 w, quint16 h) {
//RPGComponent *comp;
QLineEdit *tb;
QCheckBox *cb;
// If comp's property value is empty, then it is a checkbox, otherwise textbox.
if(prop.isEmpty()) {
//comp = new RGCheckBox(panel, page(), QPoint(x, y), QPoint(w, h));
cb = new QCheckBox(this);
cb->move(x, y);
cb->resize(w, h);
} else {
//comp = new RGTextBox(panel, page(), QPoint(x, y), QPoint(w, h));
tb = new QLineEdit(this);
tb->move(x, y);
tb->resize(w, h);
// Add Text to TextBox
//RGTextBox *tb = (RGTextBox *)comp;
if(var.isEmpty()) // Is it a character trait?
tb->setText(name + ":" + prop);
else
tb->setText(name + ":" + var + ":" + prop);
tb->show();
}
/* comp->setDataName(name);
comp->setDataProperty(prop);
comp->setDataVariable(var);
components.append(comp);
RPGRulebook::Instance()->addComponent(comp); */
}
示例2: egx_checkbox_create_
egx_wnd_t egx_checkbox_create_(int res_id,char *name,egx_uint32_t style,int x,int y,int width,int height,egx_wnd_t parent)
{
QCheckBox *button = new QCheckBox((QWidget*)(parent));
button->setText(QString::fromLocal8Bit(name));
if(x == 0 || y == 0){
button->resize(width,height);
}else{
button->setGeometry(x,y,width,height);
}
return HWND_TO_GUIWND(button);
}
示例3: onClick
/*
class QSlotStorage : public QObject {
public:
QSlotStorage() { }
void onClick() {
printf("QSlotStorage::onClicked()\n");
fflush(stdout);
}
};
*/
int main() {
BApplication *app = new BApplication("application/x.vnd-Lemon-Nirvana");
TestWindow *test = new TestWindow( BRect(30,30,700,500), "test1" );
QWidget *widget = test->RootWidget();
QCheckBox *check = new QCheckBox( widget );
check->resize(100,200);
QSlotStorage *storage = new QSlotStorage();
QObject::connect(check, SIGNAL(clicked()), new QSlot(storage, SLOT(onClick())));
KWQSignal *signal = check->findSignal(SIGNAL(clicked()));
//printf("%s\n",signal->_name);
signal->call();
check->setText("Label sd fsd fsd fsd fsd fsd fsd fsd fsd fsd fsd fsd fs dfs df sd fsd fs fd");
check->move(100,100);
test->Show();
app->Run();
return 0;
}
示例4: updateItemWidgets
void ServiceItemDelegate::updateItemWidgets(const QList<QWidget*> widgets,
const QStyleOptionViewItem& option,
const QPersistentModelIndex& index) const
{
QCheckBox* checkBox = static_cast<QCheckBox*>(widgets[0]);
KPushButton *configureButton = static_cast<KPushButton*>(widgets[1]);
const int itemHeight = sizeHint(option, index).height();
// Update the checkbox showing the service name and icon
const QAbstractItemModel* model = index.model();
checkBox->setText(model->data(index).toString());
const QString iconName = model->data(index, Qt::DecorationRole).toString();
if (!iconName.isEmpty()) {
checkBox->setIcon(KIcon(iconName));
}
checkBox->setChecked(model->data(index, Qt::CheckStateRole).toBool());
const bool configurable = model->data(index, ServiceModel::ConfigurableRole).toBool();
int checkBoxWidth = option.rect.width();
if (configurable) {
checkBoxWidth -= configureButton->sizeHint().width();
}
checkBox->resize(checkBoxWidth, checkBox->sizeHint().height());
checkBox->move(0, (itemHeight - checkBox->height()) / 2);
// Update the configuration button
if (configurable) {
configureButton->setEnabled(checkBox->isChecked());
configureButton->setIcon(KIcon("configure"));
configureButton->resize(configureButton->sizeHint());
configureButton->move(option.rect.right() - configureButton->width(),
(itemHeight - configureButton->height()) / 2);
}
configureButton->setVisible(configurable);
}