本文整理汇总了C++中QSpinBox::setReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setReadOnly方法的具体用法?C++ QSpinBox::setReadOnly怎么用?C++ QSpinBox::setReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::setReadOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QtnPropertyIntSpinBoxHandler
QtnPropertyIntSpinBoxHandler(QtnPropertyIntBase& property, QSpinBox& editor)
: QtnPropertyEditorHandlerType(property, editor)
{
if (!property.isEditableByUser())
editor.setReadOnly(true);
editor.setRange(property.minValue(), property.maxValue());
editor.setSingleStep(property.stepValue());
updateEditor();
QObject::connect( &editor, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
, this, &QtnPropertyIntSpinBoxHandler::onValueChanged);
}
示例2: readPacket
void PrimaryGPSStatusTab::readPacket(std::shared_ptr<Packet> packet) {
if (packet->instanceOfGroup()) {
const Group& group = packet->groupCast();
if (group.instanceOf<PrimaryGPSStatus>()) {
enableFields(true);
const PrimaryGPSStatus& msg = group.typeCast<PrimaryGPSStatus>();
mUi->navPrimGPSText->setText(
mStatusMsg[msg.mNavigationSolutionStatus].c_str());
mUi->satPrimGPSSpinBox->setValue(msg.mNumberOfSVTracked);
mUi->primGPSTypeText->setText(mGPSTypeMsg[msg.mGPSReceiverType].c_str());
mUi->geoidalPrimGPSSpinBox->setValue(msg.mGeoidalSeparation);
mUi->hdopSpinBox->setValue(msg.mHDOP);
mUi->vdopSpinBox->setValue(msg.mVDOP);
mUi->dgpsIDSpinBox->setValue(msg.mDGPSReferenceID);
mUi->corrLatencySpinBox->setValue(msg.mDGPSCorrectionLatency);
mUi->navLatencySpinBox->setValue(msg.mGPSNavigationMessageLatency);
mUi->weekSpinBox->setValue(msg.mGPSUTCWeekNumber);
mUi->offsetSpinBox->setValue(msg.mGPSUTCTimeOffset);
while (mUi->channelsTable->rowCount())
mUi->channelsTable->removeRow(mUi->channelsTable->rowCount() - 1);
for (size_t i = 0; i < msg.mChannelNumber; ++i) {
mUi->channelsTable->insertRow(mUi->channelsTable->rowCount());
QSpinBox* PRN = new QSpinBox;
PRN->setReadOnly(true);
PRN->setValue(msg.mChannelStatusData[i].mSVPRN);
PRN->setButtonSymbols(QAbstractSpinBox::NoButtons);
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 0,
PRN);
QLineEdit* status = new QLineEdit;
status->setReadOnly(true);
status->setText(mChannelStatusMsg[
msg.mChannelStatusData[i].mChannelTrackingStatus].c_str());
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 1,
status);
QDoubleSpinBox* azimuth = new QDoubleSpinBox;
azimuth->setReadOnly(true);
azimuth->setValue(msg.mChannelStatusData[i].mSVAzimuth);
azimuth->setButtonSymbols(QAbstractSpinBox::NoButtons);
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 2,
azimuth);
QDoubleSpinBox* elevation = new QDoubleSpinBox;
elevation->setReadOnly(true);
elevation->setValue(msg.mChannelStatusData[i].mSVElevation);
elevation->setButtonSymbols(QAbstractSpinBox::NoButtons);
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 3,
elevation);
QDoubleSpinBox* l1snr = new QDoubleSpinBox;
l1snr->setReadOnly(true);
l1snr->setValue(msg.mChannelStatusData[i].mSVL1SNR);
l1snr->setButtonSymbols(QAbstractSpinBox::NoButtons);
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 4,
l1snr);
QDoubleSpinBox* l2snr = new QDoubleSpinBox;
l2snr->setReadOnly(true);
l2snr->setValue(msg.mChannelStatusData[i].mSVL2SNR);
l2snr->setButtonSymbols(QAbstractSpinBox::NoButtons);
mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 5,
l2snr);
}
}
if (group.instanceOf<PPSTimeRecoveryStatus>()) {
const PPSTimeRecoveryStatus& msg =
group.typeCast<PPSTimeRecoveryStatus>();
mUi->ppsSpinBox->setValue(msg.mPPSCount);
mUi->timeStatusText->setText(
mTimeSyncMsg[msg.mTimeSynchroStatus].c_str());
}
}
}