本文整理汇总了C++中QSpinBox::setButtonSymbols方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setButtonSymbols方法的具体用法?C++ QSpinBox::setButtonSymbols怎么用?C++ QSpinBox::setButtonSymbols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::setButtonSymbols方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSpinBox *spinBox = new QSpinBox;
spinBox->setRange(1,100); //set range of spinBox's values
spinBox->setSuffix(" MB"); // set suffix after our values
spinBox->setButtonSymbols(QSpinBox::PlusMinus);
spinBox->setWrapping(true); // loop mode activating
spinBox->setFixedHeight(100);
spinBox->setFixedWidth(100);
spinBox->move(430,340);
spinBox->show();
return a.exec();
}
示例2: main
int main(int argc, char** argv) {
QApplication app(argc, argv);
QWidget wgt;
wgt.setWindowTitle("Spin Boxes");
QLabel* plblCount = new QLabel("Megabytes:");
QLabel* plblDate = new QLabel("Date and Time:");
QLabel* plblValid = new QLabel("Name:");
QSpinBox spb;
spb.setRange(1, 100);
spb.setSuffix(" MB");
spb.setButtonSymbols(QSpinBox::PlusMinus);
spb.setWrapping(true);
spb.resize(100, 30);
plblCount->setBuddy(&spb);
QObject::connect(&spb, SIGNAL(valueChanged(const QString&)), plblCount, SLOT(setText(const QString&)));
QDateTimeEdit dateTimeEdit(QDateTime::currentDateTime());
QLineEdit* ptxt = new QLineEdit;
NameValidator* pnameValidator = new NameValidator(ptxt);
ptxt->setValidator(pnameValidator);
plblValid->setBuddy(ptxt);
QVBoxLayout* pvbxLayout = new QVBoxLayout;
pvbxLayout->addWidget(plblCount);
pvbxLayout->addWidget(&spb);
pvbxLayout->addWidget(plblDate);
pvbxLayout->addWidget(&dateTimeEdit);
pvbxLayout->addWidget(plblValid);
pvbxLayout->addWidget(ptxt);
wgt.setLayout(pvbxLayout);
wgt.resize(230, 180);
wgt.show();
return app.exec();
}
示例3: createBottomBar
void Window::createBottomBar() {
bottomBar = new QToolBar();
bottomBar->setOrientation(Qt::Horizontal);
bottomBar->setFloatable(false);
bottomBar->setMovable(false);
//QLabel* linhaColorLabel = new QLabel("Linha");
//bottomBar->addWidget(linhaColorLabel);
linhaColorButton = new QToolButton();
linhaColorButton->setToolTip("Cor de linha");
linhaColorButton->setAutoRaise(true);
updateLinhaButton();
bottomBar->addWidget(linhaColorButton);
QObject::connect(linhaColorButton, SIGNAL(clicked()), this, SLOT(setLinhaColor()));
//QLabel* fillColorLabel = new QLabel("Fill");
//bottomBar->addWidget(fillColorLabel);
fillColorButton = new QToolButton();
updateFillButton();
fillColorButton->setAutoRaise(true);
fillColorButton->setToolTip("Cor de preenchimento");
fillColorButton->setAutoRaise(true);
bottomBar->addWidget(fillColorButton);
QObject::connect(fillColorButton, SIGNAL(clicked()), this, SLOT(setFillColor()));
bottomBar->addSeparator();
QLabel* espessuraLinhaLabel = new QLabel("Espessura");
QSpinBox* espessuraLinhaSpinBox = new QSpinBox();
espessuraLinhaSpinBox->setSuffix(" px");
espessuraLinhaSpinBox->setMinimum(1);
espessuraLinhaSpinBox->setMaximum(50);
espessuraLinhaSpinBox->setSingleStep(1);
espessuraLinhaSpinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
bottomBar->addWidget(espessuraLinhaLabel);
bottomBar->addWidget(espessuraLinhaSpinBox);
QObject::connect(espessuraLinhaSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setEspessuraLinha(int)));
bottomBar->addSeparator();
QLabel* estiloLinhaLabel = new QLabel("Estilo");
estiloLinhaField = new QLineEdit();
estiloLinhaField->setMaximumWidth(150);
estiloLinhaField->setText("-");
QRegExp expr("[-][-,.]+");
QRegExpValidator *v = new QRegExpValidator(expr, 0);
estiloLinhaField->setValidator(v);
bottomBar->addWidget(estiloLinhaLabel);
bottomBar->addWidget(estiloLinhaField);
QObject::connect(estiloLinhaField, SIGNAL(textChanged(QString)), this, SLOT(setEstiloLinha(QString)));
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
bottomBar->addWidget(spacer);
toggleGradeButton = new QToolButton();
toggleGradeButton->setIcon(QIcon(":/images/grade.png"));
toggleGradeButton->setCheckable(true);
toggleGradeButton->setToolTip("Mostrar/ocultar grade");
bottomBar->addWidget(toggleGradeButton);
QObject::connect(toggleGradeButton, SIGNAL(clicked()), this, SLOT(toggleGrade()));
QSpinBox* zoomSpinBox = new QSpinBox();
zoomSpinBox->setSuffix("%");
zoomSpinBox->setMinimum(25);
zoomSpinBox->setMaximum(1000);
zoomSpinBox->setValue(100);
zoomSpinBox->setSingleStep(5);
bottomBar->addWidget(zoomSpinBox);
}
示例4: 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());
}
}
}