本文整理汇总了C++中QCheckBox::setFocusPolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setFocusPolicy方法的具体用法?C++ QCheckBox::setFocusPolicy怎么用?C++ QCheckBox::setFocusPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setFocusPolicy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCheckBox
/*! Makes a new check box with the given [text], adds it to [layout] if it is
non-NULL, and sets it for no focus. [layout] can be a QHBoxLayout or a
QVBoxLayout. */
QCheckBox *diaCheckBox(const char *text, QWidget *parent, QBoxLayout *layout)
{
QCheckBox *button = new QCheckBox(text, parent);
button->setFocusPolicy(Qt::NoFocus);
if (layout)
layout->addWidget(button);
return button;
}
示例2: memorizingChanged
QWidget *ImageItemPopup::initMemorizationPicker()
{
QCheckBox *box = new QCheckBox(this);
mMemorizationPicker = box;
box->setIcon(QIcon(":/icons/2d_save.png"));
updateMemorizationToolTip();
box->setFocusPolicy(Qt::NoFocus);
connect(mMemorizationPicker, &QAbstractButton::toggled, this, &ImageItemPopup::updateMemorizationToolTip);
connect(mMemorizationPicker, &QAbstractButton::toggled, this, [=](bool memorized){
setPropertyMassively("memorize", memorized);
if (mLastIsMemorized != memorized) {
mLastIsMemorized = memorized;
emit memorizingChanged(memorized);
}
});
return box;
}
示例3: initWidget
void MusicSoundKMicroSettingPopWidget::initWidget()
{
setFixedSize(54, 24);
setTranslucentBackground();
m_recordCore = nullptr;
m_containWidget->setFixedSize(310, 190);
m_containWidget->setStyleSheet(MusicUIObject::MBackgroundStyle08 + MusicUIObject::MColorStyle03);
QCheckBox *checkBox = new QCheckBox(tr("Hear Yourself Singing"), m_containWidget);
checkBox->setGeometry(10, 20, 280, 25);
checkBox->setStyleSheet(MusicUIObject::MCheckBoxStyle05);
QCheckBox *checkBox2 = new QCheckBox(tr("Noise Elimination"), m_containWidget);
checkBox2->setGeometry(10, 50, 280, 25);
checkBox2->setStyleSheet(MusicUIObject::MCheckBoxStyle05);
#ifdef Q_OS_UNIX
checkBox->setFocusPolicy(Qt::NoFocus);
checkBox2->setFocusPolicy(Qt::NoFocus);
#endif
QLabel *microIconLabel = new QLabel(m_containWidget);
microIconLabel->setGeometry(10, 92, 26, 18);
QSlider *slider = new QSlider(Qt::Horizontal, m_containWidget);
slider->setGeometry(36, 90, 150, 25);
slider->setStyleSheet(QString("QSlider{%1}").arg(MusicUIObject::MBackgroundStyle01) + MusicUIObject::MSliderStyle01);
slider->setRange(0, 100);
slider->setValue(100);
connect(slider, SIGNAL(valueChanged(int)), SLOT(volumeChanged(int)));
QLabel *inputLabel = new QLabel(tr("Input"), m_containWidget);
inputLabel->setGeometry(10, 120, 50, 25);
inputLabel->setStyleSheet(MusicUIObject::MBackgroundStyle01);
m_inputComboBox = new QComboBox(m_containWidget);
m_inputComboBox->setGeometry(60, 120, 230, 25);
m_inputComboBox->setStyleSheet(MusicUIObject::MBorderStyle04);
m_inputComboBox->setItemDelegate(new QStyledItemDelegate(m_inputComboBox));
m_inputComboBox->view()->setStyleSheet(MusicUIObject::MScrollBarStyle01);
foreach(const QAudioDeviceInfo &info, QAudioDeviceInfo::availableDevices(QAudio::AudioInput))
{
m_inputComboBox->addItem(info.deviceName());
}
示例4: QDialog
PPreview::PPreview( QWidget* parent, ScribusView *vin, ScribusDoc *docu, QString printer, PrintEngine engine ) : QDialog( parent )
{
setModal(true);
setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
Q_ASSERT(!docu->masterPageMode());
prefsManager=PrefsManager::instance();
QString tmp;
postscriptPreview = usePostscriptPreview(printer, engine);
QString caption = tr("Print Preview");
#ifdef _WIN32
if (postscriptPreview)
caption += " (PostScript)";
else
caption += " (GDI)";
#endif
setWindowTitle( caption );
doc = docu;
view = vin;
HavePngAlpha = ScCore->havePNGAlpha();
HaveTiffSep = postscriptPreview ? ScCore->haveTIFFSep() : false;
APage = -1;
CMode = false;
GsAl = false;
Trans = false;
GMode = true;
mHor = false;
mVer = false;
fClip = false;
fSpot = true;
fGray = false;
fICC = false;
scaleFactor = 1.0;
SMode = 1;
getNumericGSVersion(GsMajor, GsMinor);
PLayout = new QVBoxLayout(this);
PLayout->setMargin(0);
PLayout->setSpacing(0);
int tbWidth = 0;
Layout5 = new QHBoxLayout;
Layout5->setSpacing(3);
Layout5->setMargin(0);
Anzeige = new QScrollArea(this);
Anzeige->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
Layout5->addWidget(Anzeige);
settingsBarLayout = new QVBoxLayout;
settingsBarLayout->setSpacing(3);
settingsBarLayout->setMargin(0);
devTitle = new QGroupBox( this );
devTitle->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
devTitle->setTitle( tr( "Display Settings" ) );
Layout2 = new QVBoxLayout( devTitle );
Layout2->setSpacing(5);
Layout2->setMargin(5);
Layout2->setAlignment( Qt::AlignTop );
AntiAlias = new QCheckBox(devTitle);
AntiAlias->setText( tr("Enable &Antialiasing"));
AntiAlias->setChecked( postscriptPreview ? prefsManager->appPrefs.PrPr_AntiAliasing : false);
AntiAlias->setEnabled( postscriptPreview );
Layout2->addWidget(AntiAlias);
AliasTr = new QCheckBox(devTitle);
AliasTr->setText( tr("Display Trans&parency"));
AliasTr->setChecked(prefsManager->appPrefs.PrPr_Transparency);
AliasTr->setEnabled( postscriptPreview );
Layout2->addWidget(AliasTr);
EnableCMYK = new QCheckBox(devTitle);
EnableCMYK->setText( tr("&Display CMYK"));
EnableCMYK->setChecked( postscriptPreview ? prefsManager->appPrefs.PrPr_Mode : false);
EnableCMYK->setEnabled( postscriptPreview );
Layout2->addWidget(EnableCMYK);
if (HaveTiffSep)
{
ColorList usedSpots;
doc->getUsedColors(usedSpots, true);
QStringList spots = usedSpots.keys();
Table = new QTableWidget(spots.count()+4, 2, devTitle );
inkMax = (spots.count()+4) * 255;
Table->setHorizontalHeaderItem(0, new QTableWidgetItem(QIcon(loadIcon("16/show-object.png")), ""));
Table->setHorizontalHeaderItem(1, new QTableWidgetItem( tr("Separation Name")));
QHeaderView *header = Table->horizontalHeader();
header->setStretchLastSection(true);
header->setMovable(false);
// header->setClickable(false);
header->setResizeMode(QHeaderView::Fixed);
Table->setColumnWidth(0, 24);
Table->verticalHeader()->hide();
Table->setSelectionMode( QAbstractItemView::NoSelection );
Table->setEditTriggers(QAbstractItemView::NoEditTriggers);
Table->setFocusPolicy(Qt::NoFocus);
flagsVisible.clear();
Table->setItem(0, 1, new QTableWidgetItem( tr("Cyan")));
QCheckBox *cp = new QCheckBox(this);
cp->setFocusPolicy(Qt::NoFocus);
connect(cp, SIGNAL(clicked()), this, SLOT(ToggleCMYK_Colour()));
Table->setCellWidget(0, 0, cp);
cp->setChecked(prefsManager->appPrefs.PrPr_C);
flagsVisible.insert("Cyan", cp);
Table->setItem(1, 1, new QTableWidgetItem( tr("Magenta")));
cp = new QCheckBox(this);
cp->setFocusPolicy(Qt::NoFocus);
//.........这里部分代码省略.........