QWidget *FileEditorFactory::createEditor(PathPropertyManager *manager, QtProperty *property,
        QWidget *parent)
{
    GenericPropertyPathEditor *editor = new GenericPropertyPathEditor(manager->propertyType(property),parent);
    if (!editor)
        return 0;

    editor->setItemFilter(manager->fileNameFilter(property));
    editor->setEditable(!manager->contextDependent(property) && manager->editable(property));
    editor->setDefaultOpenPath(manager->defaultStartPath(property));
    editor->setPropertyName(manager->propertyName(property));
    if (manager->propertyType(property) == GenericProperty::TypeFile || manager->propertyType(property) == GenericProperty::TypePath)
        editor->setText(manager->value(property));
    else if (manager->propertyType(property) == GenericProperty::TypeFileList || manager->propertyType(property) == GenericProperty::TypePathList) {
        editor->setCurrentValues(manager->listValues(property));
        editor->setListSeperatorBackend(manager->listSeperatorBackend(property));
    }

    connect(editor,SIGNAL(valueChanged(QString)),SLOT(slotSetValue(QString)));
    connect(editor,SIGNAL(destroyed(QObject*)),SLOT(slotEditorDestroyed(QObject*)));

    createdEditors[property].append(editor);
    editorToProperty[editor] = property;

    return editor;
}
Пример #2
0
/*!
 * \brief GUI::ChangeDeleteUserDialog::connects
 * Verbindet alle Signale und Slots die in dieser Klasse verwendet werden.
 */
void GUI::ChangeDeleteUserDialog::connects()
{
    connect(ui->closePushButton, SIGNAL(clicked()), this, SLOT(slotClose()));
    connect(ui->confirmPasswordLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotCheckIfSamePassword()));
    connect(ui->confirmAgainPasswordLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotCheckIfSamePassword()));
    connect(ui->addUserPushButton, SIGNAL(clicked()), this, SLOT(slotInsertUser()));
    connect(ui->emailLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotCheckEmailValidity(QString)));
    connect(ui->balanceLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSetValue(QString)));
    connect(this, SIGNAL(signalUpdateUserList()), this, SLOT(slotUpdateUserList()));
    connect(ui->emailListView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotSelectedEmail(QModelIndex)));
    connect(this, SIGNAL(signalUpdateUserData()), this, SLOT(slotUpdateUserData()));
    connect(ui->deletePushButton, SIGNAL(clicked()), this, SLOT(slotDeleteUser()));
    connect(ui->changePushButton, SIGNAL(clicked()),this,SLOT(slotChangeUser()));
}
Пример #3
0
/*!
    \internal

    Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtLineEditFactory::createEditor(QtStringPropertyManager *manager,
        QtProperty *property, QWidget *parent)
{

    QLineEdit *editor = this->createEditorImpl(property, parent);
    QRegExp regExp = manager->regExp(property);
    if (regExp.isValid()) {
        QValidator *validator = new QRegExpValidator(regExp, editor);
        editor->setValidator(validator);
    }
    editor->setText(manager->value(property));

    connect(editor, SIGNAL(textEdited(QString)),
                this, SLOT(slotSetValue(QString)));
    connect(editor, SIGNAL(destroyed(QObject*)),
                this, SLOT(slotEditorDestroyed(QObject*)));
    return editor;
}