GraphicalDouble::GraphicalDouble(Real value, QWidget * parent)
  : GraphicalValue(parent)
{
  m_line_edit = new QLineEdit(this);
  m_validator = new QDoubleValidator(this);

  m_validator->setNotation(QDoubleValidator::ScientificNotation);
  m_line_edit->setValidator(m_validator);

  m_layout->addWidget(m_line_edit);

  this->set_value(value);

  connect(m_line_edit, SIGNAL(textChanged(QString)), this, SLOT(text_updated(QString)));
}
Exemple #2
0
        add_contact_dialog::add_contact_dialog(QTabWidget* parent) : QDialog{parent}
        {
            auto layout = new QVBoxLayout{this};
            setLayout(layout);

            _label = new QLabel{tr(PASTE_IDENTITY.c_str())};
            _iden = new QTextEdit;

            _add = new QPushButton;
            make_add_contact(*_add);
            _add->setEnabled(false);
            _add->setToolTip(tr("Add Contact"));

            _cancel = new QPushButton;
            _cancel->setToolTip(tr("Cancel"));
            make_cancel(*_cancel);

            layout->addWidget(_label);
            layout->addWidget(_iden);

            auto bw = new QWidget;
            auto bl = new QHBoxLayout{bw};
            bl->addWidget(_cancel);
            bl->addWidget(_add);
            layout->addWidget(bw);

            connect(_iden, SIGNAL(textChanged()), this, SLOT(text_updated()));
            connect(_add, SIGNAL(clicked()), this, SLOT(add()));
            connect(_cancel, SIGNAL(clicked()), this, SLOT(cancel()));

            setWindowTitle(tr("Add Contact"));

            INVARIANT(_label);
            INVARIANT(_add);
            INVARIANT(_cancel);
            INVARIANT(_iden);
        }