コード例 #1
0
void Variometer::createSettings(QGridLayout *layout) {
    QLabel *unitsLabel = new QLabel("Unit", layout->parentWidget());
    layout->addWidget(unitsLabel, layout->rowCount(), 0);
    VelocityUnitComboBox *unitsCombo = new VelocityUnitComboBox(layout->parentWidget(), units);
    connect(unitsCombo, SIGNAL(unitSelected(VelocityUnit)), this, SLOT(setUnit(VelocityUnit)));
    layout->addWidget(unitsCombo);

    QLabel *maxLabel = new QLabel("Maximum value", layout->parentWidget());
    layout->addWidget(maxLabel);
    NumberInputLineEdit *maxValueEdit = new NumberInputLineEdit(layout->parentWidget());
    maxValueEdit->setText(QString::number(maxValue));
    layout->addWidget(maxValueEdit);
    connect(maxValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMaxValue(float)));

    QLabel *scaleLabel = new QLabel("Scale numbers", layout->parentWidget());
    layout->addWidget(scaleLabel);
    NumberInputLineEdit *scaleValueEdit = new NumberInputLineEdit(layout->parentWidget());
    scaleValueEdit->setText(QString::number(numberScale));
    layout->addWidget(scaleValueEdit);
    connect(scaleValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setNumberScale(float)));
    
    
    QCheckBox *totalCheckbox = new QCheckBox("Total energy", layout->parentWidget());
    totalCheckbox->setChecked(isTotalEnergy);
    layout->addWidget(totalCheckbox);
    connect(totalCheckbox, SIGNAL(clicked(bool)), this, SLOT(setIsTotalEnergy(bool)));
}
コード例 #2
0
void TankLeveler::createSettings(QGridLayout *layout){
    QLabel *label1 = new QLabel("tank number [0-9] ", layout->parentWidget());
    layout->addWidget(label1);
    NumberInputLineEdit *tankNumberEdit = new NumberInputLineEdit(layout->parentWidget());
    tankNumberEdit->setText(QString::number(_tankNumber));
    layout->addWidget(tankNumberEdit);
    connect(tankNumberEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setTankNumber(float)));

    QLabel *label2 = new QLabel("Short designation to draw", layout->parentWidget());
    layout->addWidget(label2);
    QLineEdit *ShortDesEdit = new QLineEdit(layout->parentWidget());
    ShortDesEdit->setText(tankShortDesignation);
    layout->addWidget(ShortDesEdit);
    connect(ShortDesEdit, SIGNAL(textChanged(QString)), this, SLOT(setShortDesignation(QString)));

    QLabel *label3 = new QLabel("full capacity (kg)", layout->parentWidget());
    layout->addWidget(label3);
    NumberInputLineEdit *maxValueEdit = new NumberInputLineEdit(layout->parentWidget());
    maxValueEdit->setText(QString::number(valueMax));
    layout->addWidget(maxValueEdit);
    connect(maxValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMaxValue(float)));

}
コード例 #3
0
ファイル: altimeter.cpp プロジェクト: Nicolou/ExtPlane-Panel
void Altimeter::createSettings(QGridLayout *layout) {
    QLabel *unitsLabel = new QLabel("Unit", layout->parentWidget());
    layout->addWidget(unitsLabel, layout->rowCount(), 0);
    DistanceUnitComboBox *unitsCombo = new DistanceUnitComboBox(layout->parentWidget(), units);
    connect(unitsCombo, SIGNAL(unitSelected(DistanceUnit)), this, SLOT(setUnit(DistanceUnit)));
    layout->addWidget(unitsCombo);
    QLabel *range1Label = new QLabel("Range", layout->parentWidget());
    layout->addWidget(range1Label);
    NumberInputLineEdit *range1Edit = new NumberInputLineEdit(layout->parentWidget());
    range1Edit->setText(QString::number(_range1));
    layout->addWidget(range1Edit);
    connect(range1Edit, SIGNAL(valueChangedFloat(float)), this, SLOT(setRange1(float)));

    QLabel *range2Label = new QLabel("Range 2", layout->parentWidget());
    layout->addWidget(range2Label);
    NumberInputLineEdit *range2Edit = new NumberInputLineEdit(layout->parentWidget());
    range2Edit->setText(QString::number(_range2));
    layout->addWidget(range2Edit);
    connect(range2Edit, SIGNAL(valueChangedFloat(float)), this, SLOT(setRange2(float)));

    QLabel *thinBarsLabel = new QLabel("Thin bars every", layout->parentWidget());
    layout->addWidget(thinBarsLabel);
    NumberInputLineEdit *thinBarsEdit = new NumberInputLineEdit(layout->parentWidget());
    thinBarsEdit->setText(QString::number(_thinBars));
    layout->addWidget(thinBarsEdit);
    connect(thinBarsEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setThinBars(float)));

    QLabel *thickBarsLabel = new QLabel("Thick bars every", layout->parentWidget());
    layout->addWidget(thickBarsLabel);
    NumberInputLineEdit *thickBarsEdit = new NumberInputLineEdit(layout->parentWidget());
    thickBarsEdit->setText(QString::number(_thickBars));
    layout->addWidget(thickBarsEdit);
    connect(thickBarsEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setThickBars(float)));

    layout->addWidget(new QLabel("Numbers every", layout->parentWidget()));
    NumberInputLineEdit *numbersEdit = new NumberInputLineEdit(layout->parentWidget());
    numbersEdit->setText(QString::number(_numbers));
    layout->addWidget(numbersEdit);
    connect(numbersEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setNumbers(float)));

    layout->addWidget(new QLabel("Number scale", layout->parentWidget()));
    NumberInputLineEdit *numbersScaleEdit = new NumberInputLineEdit(layout->parentWidget());
    numbersScaleEdit->setText(QString::number(_numbersScale));
    layout->addWidget(numbersScaleEdit);
    connect(numbersScaleEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setNumbersScale(float)));
}
コード例 #4
0
void EngineBattery::createSettings(QGridLayout *layout){
    QLabel *label1 = new QLabel("battery number [0-9] ", layout->parentWidget());
    layout->addWidget(label1);
    NumberInputLineEdit *batteryNumberEdit = new NumberInputLineEdit(layout->parentWidget());
    batteryNumberEdit->setText(QString::number(_batteryNumber));
    layout->addWidget(batteryNumberEdit);
    connect(batteryNumberEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setBatteryNumber(float)));

    QLabel *label2 = new QLabel("max negative Amperage on discharge", layout->parentWidget());
    layout->addWidget(label2);
    NumberInputLineEdit *minEdit = new NumberInputLineEdit(layout->parentWidget());
    minEdit->setText(QString::number(valueMin));
    layout->addWidget(minEdit);
    connect(minEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMinValue(float)));

    QLabel *label3 = new QLabel("max Amperage on charge", layout->parentWidget());
    layout->addWidget(label3);
    NumberInputLineEdit *maxValueEdit = new NumberInputLineEdit(layout->parentWidget());
    maxValueEdit->setText(QString::number(valueMax));
    layout->addWidget(maxValueEdit);
    connect(maxValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMaxValue(float)));

}
コード例 #5
0
void AirspeedIndicator::createSettings(QGridLayout *layout) {
    QLabel *unitsLabel = new QLabel("Unit", layout->parentWidget());
    layout->addWidget(unitsLabel, layout->rowCount(), 0);
    VelocityUnitComboBox *unitsCombo = new VelocityUnitComboBox(layout->parentWidget(), units);
    connect(unitsCombo, SIGNAL(unitSelected(VelocityUnit)), this, SLOT(setUnit(VelocityUnit)));
    layout->addWidget(unitsCombo);
    QLabel *maxLabel = new QLabel("Maximum value", layout->parentWidget());
    layout->addWidget(maxLabel);
    NumberInputLineEdit *maxValueEdit = new NumberInputLineEdit(layout->parentWidget());
    maxValueEdit->setText(QString::number(maxValue));
    layout->addWidget(maxValueEdit);
    connect(maxValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMaxValue(float)));
    QLabel *vsoLabel = new QLabel("White arc start (Vso)", layout->parentWidget());
    layout->addWidget(vsoLabel);
    NumberInputLineEdit *vsoEdit = new NumberInputLineEdit(layout->parentWidget());
    vsoEdit->setText(QString::number(vso));
    layout->addWidget(vsoEdit);
    connect(vsoEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setVso(float)));
    QLabel *vsLabel = new QLabel("Green arc start (Vs)", layout->parentWidget());
    layout->addWidget(vsLabel);
    NumberInputLineEdit *vsEdit = new NumberInputLineEdit(layout->parentWidget());
    vsEdit->setText(QString::number(vs));
    layout->addWidget(vsEdit);
    connect(vsEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setVs(float)));
    QLabel *vfeLabel = new QLabel("White arc end (Vfe)", layout->parentWidget());
    layout->addWidget(vfeLabel);
    NumberInputLineEdit *vfeEdit = new NumberInputLineEdit(layout->parentWidget());
    vfeEdit->setText(QString::number(vfe));
    layout->addWidget(vfeEdit);
    connect(vfeEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setVfe(float)));
    QLabel *vnoLabel = new QLabel("Green arc end (Vno)", layout->parentWidget());
    layout->addWidget(vnoLabel);
    NumberInputLineEdit *vnoEdit = new NumberInputLineEdit(layout->parentWidget());
    vnoEdit->setText(QString::number(vno));
    layout->addWidget(vnoEdit);
    connect(vnoEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setVno(float)));
    QLabel *vneLabel = new QLabel("Maximum speed (Vne)", layout->parentWidget());
    layout->addWidget(vneLabel);
    NumberInputLineEdit *vneEdit = new NumberInputLineEdit(layout->parentWidget());
    vneEdit->setText(QString::number(vne));
    layout->addWidget(vneEdit);
    connect(vneEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setVne(float)));
}