Пример #1
0
void QDeclarativeFlipable::setFront(QGraphicsObject *front)
{
    Q_D(QDeclarativeFlipable);
    if (d->front) {
        qmlInfo(this) << tr("front is a write-once property");
        return;
    }
    d->front = front;
    d->front->setParentItem(this);
    if (Back == d->current)
        d->front->setOpacity(0.);
    emit frontChanged();
}
Пример #2
0
void ColorsSelecter::setColor(TC::Color c) {
    if (lastButton == Qt::LeftButton) {
        front = c;
        emit frontChanged(c);
    }
    else if (lastButton == Qt::RightButton) {
        back = c;
        emit backChanged(c);
    }
    reprintImage();

    setPixmap(QPixmap::fromImage(image->scaled(34, 26, Qt::KeepAspectRatio/*, Qt::SmoothTransformation*/)));
}