本文整理汇总了C++中QCheckBox::setFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setFocus方法的具体用法?C++ QCheckBox::setFocus怎么用?C++ QCheckBox::setFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setFocus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCheckBox
auto_ptr<IInputWidgetProxy> EntityEditor::create_boolean_input_widgets(const Dictionary& metadata)
{
QCheckBox* checkbox = new QCheckBox(m_parent);
if (should_be_focused(metadata))
checkbox->setFocus();
m_form_layout->addRow(create_label(metadata), checkbox);
auto_ptr<IInputWidgetProxy> widget_proxy(new CheckBoxProxy(checkbox));
widget_proxy->set(metadata.strings().get<string>("value"));
return widget_proxy;
}
示例2: QWidget
OptionsPopup::OptionsPopup(QWidget *parent)
: QWidget(parent, Qt::Popup)
{
setAttribute(Qt::WA_DeleteOnClose);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(2, 2, 2, 2);
layout->setSpacing(2);
setLayout(layout);
QCheckBox *firstCheckBox = createCheckboxForCommand(Constants::CASE_SENSITIVE);
layout->addWidget(firstCheckBox);
layout->addWidget(createCheckboxForCommand(Constants::WHOLE_WORDS));
layout->addWidget(createCheckboxForCommand(Constants::REGULAR_EXPRESSIONS));
layout->addWidget(createCheckboxForCommand(Constants::PRESERVE_CASE));
firstCheckBox->setFocus();
move(parent->mapToGlobal(QPoint(0, -sizeHint().height())));
}
示例3: createDialog
void KCheckAccelerators::createDialog(QWidget *actWin, bool automatic)
{
if ( drklash )
return;
drklash = new QDialog( actWin, "kapp_accel_check_dlg", false, Qt::WDestructiveClose);
drklash->setCaption( i18n( "Dr. Klash' Accelerator Diagnosis" ));
drklash->resize( 500, 460 );
QVBoxLayout* layout = new QVBoxLayout( drklash, 11, 6 );
layout->setAutoAdd( true );
drklash_view = new QTextView( drklash );
QCheckBox* disableAutoCheck = NULL;
if( automatic ) {
disableAutoCheck = new QCheckBox( i18n( "&Disable automatic checking" ), drklash );
connect(disableAutoCheck, SIGNAL(toggled(bool)), SLOT(slotDisableCheck(bool)));
}
QPushButton* btnClose = new QPushButton( i18n( "&Close" ), drklash );
btnClose->setDefault( true );
connect( btnClose, SIGNAL( clicked() ), drklash, SLOT( close() ) );
if (disableAutoCheck)
disableAutoCheck->setFocus();
else
drklash_view->setFocus();
}