Exemplo n.º 1
0
void Q3DataBrowser::del()
{
    QSqlRecord* buf = d->frm.record();
    Q3SqlCursor* cur = d->cur.cursor();
    if (!buf || !cur)
        return;
    QSql::Confirm conf = QSql::Yes;
    switch (d->dat.mode()){
    case QSql::Insert:
        if (confirmCancels())
            conf = confirmCancel(QSql::Insert);
        if (conf == QSql::Yes) {
            cur->editBuffer(true); /* restore from cursor */
            readFields();
            d->dat.setMode(QSql::Update);
        } else
            d->dat.setMode(QSql::Insert);
        break;
    default:
        if (confirmDelete())
            conf = confirmEdit(QSql::Delete);
        switch (conf) {
        case QSql::Yes:
            emit primeDelete(buf);
            deleteCurrent();
            break;
        case QSql::No:
        case QSql::Cancel:
            break;
        }
        d->dat.setMode(QSql::Update);
        break;
    }
}
Exemplo n.º 2
0
int Q3DataBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 24)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 24;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = boundaryChecking(); break;
        case 1: *reinterpret_cast< QString*>(_v) = filter(); break;
        case 2: *reinterpret_cast< QStringList*>(_v) = sort(); break;
        case 3: *reinterpret_cast< bool*>(_v) = confirmEdits(); break;
        case 4: *reinterpret_cast< bool*>(_v) = confirmInsert(); break;
        case 5: *reinterpret_cast< bool*>(_v) = confirmUpdate(); break;
        case 6: *reinterpret_cast< bool*>(_v) = confirmDelete(); break;
        case 7: *reinterpret_cast< bool*>(_v) = confirmCancels(); break;
        case 8: *reinterpret_cast< bool*>(_v) = isReadOnly(); break;
        case 9: *reinterpret_cast< bool*>(_v) = autoEdit(); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setBoundaryChecking(*reinterpret_cast< bool*>(_v)); break;
        case 1: setFilter(*reinterpret_cast< QString*>(_v)); break;
        case 2: setSort(*reinterpret_cast< QStringList*>(_v)); break;
        case 3: setConfirmEdits(*reinterpret_cast< bool*>(_v)); break;
        case 4: setConfirmInsert(*reinterpret_cast< bool*>(_v)); break;
        case 5: setConfirmUpdate(*reinterpret_cast< bool*>(_v)); break;
        case 6: setConfirmDelete(*reinterpret_cast< bool*>(_v)); break;
        case 7: setConfirmCancels(*reinterpret_cast< bool*>(_v)); break;
        case 8: setReadOnly(*reinterpret_cast< bool*>(_v)); break;
        case 9: setAutoEdit(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 10;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}