Пример #1
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*/)));
}
Пример #2
0
void QDeclarativeFlipable::setBack(QGraphicsObject *back)
{
    Q_D(QDeclarativeFlipable);
    if (d->back) {
        qmlInfo(this) << tr("back is a write-once property");
        return;
    }
    d->back = back;
    d->back->setParentItem(this);
    if (Front == d->current)
        d->back->setOpacity(0.);
    connect(back, SIGNAL(widthChanged()),
            this, SLOT(retransformBack()));
    connect(back, SIGNAL(heightChanged()),
            this, SLOT(retransformBack()));
    emit backChanged();
}