Exemple #1
0
int QDeclarativeDrag::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 8)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 8;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QGraphicsObject**>(_v) = target(); break;
        case 1: *reinterpret_cast< Axis*>(_v) = axis(); break;
        case 2: *reinterpret_cast< qreal*>(_v) = xmin(); break;
        case 3: *reinterpret_cast< qreal*>(_v) = xmax(); break;
        case 4: *reinterpret_cast< qreal*>(_v) = ymin(); break;
        case 5: *reinterpret_cast< qreal*>(_v) = ymax(); break;
        case 6: *reinterpret_cast< bool*>(_v) = active(); break;
        case 7: *reinterpret_cast< bool*>(_v) = filterChildren(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setTarget(*reinterpret_cast< QGraphicsObject**>(_v)); break;
        case 1: setAxis(*reinterpret_cast< Axis*>(_v)); break;
        case 2: setXmin(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setXmax(*reinterpret_cast< qreal*>(_v)); break;
        case 4: setYmin(*reinterpret_cast< qreal*>(_v)); break;
        case 5: setYmax(*reinterpret_cast< qreal*>(_v)); break;
        case 7: setFilterChildren(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        switch (_id) {
        case 0: resetTarget(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemple #2
0
QslRectLabel::QslRectLabel(double x, double y,
                           const QString &text,
                           QObject *parent) :
    QslRectPlot(text,parent),
    m(new Private)
{
    setXmin(x);
    setXmax(x);
    setYmin(y);
    setYmax(y);
    m->text = text;
    #ifdef QSL_DARK_STYLE
    m->pen.setColor(Qt::white);
    #endif // QSL_DARK_STYLE
}
void CoefficientWidget::setupUi()
{
    QGridLayout * mainLayout = new QGridLayout; {
        mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
        QLabel * header = new QLabel(m_coefficeint->name()); {
            header->setAlignment(Qt::AlignCenter);
            header->setProperty("header", QVariant("true"));
        }

        QFormLayout * yLayout = new QFormLayout; {
            QLineEdit * minLineEdit = new QLineEdit; {
                minLineEdit->setText(QString::number(m_coefficeint->Ymin(), 'f', 3));
                connect(minLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setYmin(QString)) );
            }
            QLineEdit * maxLineEdit = new QLineEdit; {
                maxLineEdit->setText(QString::number(m_coefficeint->Ymax(), 'f', 3));
                connect(maxLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setYmax(QString)) );
            }
            QLineEdit * effLineEdit = new QLineEdit; {
                effLineEdit->setText(QString::number(m_coefficeint->Yeff(), 'f', 3));
                connect(effLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setYeff(QString)) );
            }

            yLayout->addRow("Минимум", minLineEdit);
            yLayout->addRow("Максимум", maxLineEdit);
            yLayout->addRow("Эффективный", effLineEdit);
        }

        QFormLayout * dLayout = new QFormLayout; {
            QLineEdit * minLineEdit = new QLineEdit; {
                minLineEdit->setText(QString::number(m_coefficeint->Dmin(), 'f', 3));
                connect(minLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setDmin(QString)) );
            }
            QLineEdit * maxLineEdit = new QLineEdit; {
                maxLineEdit->setText(QString::number(m_coefficeint->Dmax(), 'f', 3));
                connect(maxLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setDmax(QString)) );
            }
            QLineEdit * effLineEdit = new QLineEdit; {
                effLineEdit->setText(QString::number(m_coefficeint->Deff(), 'f', 3));
                connect(effLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setDeff(QString)) );
            }

            dLayout->addRow("Минимум", minLineEdit);
            dLayout->addRow("Максимум", maxLineEdit);
            dLayout->addRow("Эффективный", effLineEdit);
        }

        QFormLayout * aLayout = new QFormLayout; {
            QComboBox * comboBox = new QComboBox; {
                for(int i = 1; i <= 6; ++i) {
                    comboBox->addItem(QString("Кривая %1 типа").arg(i));
                }
                comboBox->setCurrentIndex(m_coefficeint->typeInt());
                connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setType(int)) );
            }
            QLineEdit * effLineEdit = new QLineEdit; {
                effLineEdit->setText(QString::number(m_coefficeint->pow(), 'f', 3));
                connect(effLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setAlfaCoef(QString)) );
            }

            aLayout->addRow("Вес коэффициента", effLineEdit);
            aLayout->addRow("Тип кривой", comboBox);
        }

        mainLayout->addWidget(header, 0, 0, 1, 3);
        mainLayout->addWidget(new QLabel("Y"), 1, 0);
        mainLayout->addWidget(new QLabel("d"), 1, 1);
        mainLayout->addLayout(yLayout, 2, 0);
        mainLayout->addLayout(dLayout, 2, 1);
        mainLayout->addLayout(aLayout, 2, 2);
    }

    this->setLayout(mainLayout);
}