Ejemplo n.º 1
0
void TagProperties::setProperty(const QString& key, const QString& value)
{
    if (d->properties.contains(key, value) && d->properties.count(key) == 1)
    {
        return;
    }

    // for single entries in db, this can of course be optimized using a single UPDATE WHERE
    removeProperties(key);
    d->properties.insert(key, value);
    DatabaseAccess().db()->addTagProperty(d->tagId, key, value);
}
Ejemplo n.º 2
0
void PropertiesDock::keyPressEvent(QKeyEvent *event)
{
    if (event->matches(QKeySequence::Delete) || event->key() == Qt::Key_Backspace) {
        removeProperties();
    } else if (event->matches(QKeySequence::Cut)) {
        cutProperties();
    } else if (event->matches(QKeySequence::Copy)) {
        copyProperties();
    } else if (event->matches(QKeySequence::Paste)) {
        pasteProperties();
    } else {
        QDockWidget::keyPressEvent(event);
    }
}
Ejemplo n.º 3
0
void PropertiesDock::cutProperties()
{
    if (copyProperties())
        removeProperties();
}