Пример #1
0
void TiledCanvas::setTileSize(const QSize &v)
{
    if (v != m_tileSize) {
        m_tileSize = v;
        emit tileSizeChanged();
        update();
    }
}
Пример #2
0
void QQuickCanvasItem::setTileSize(const QSize & size)
{
    Q_D(QQuickCanvasItem);
    if (d->tileSize != size) {
        d->hasTileSize = true;
        d->tileSize = size;

        emit tileSizeChanged();

        if (d->context)
            polish();
    }
}
Пример #3
0
void MainWindow::UiSizeChanged() {
  QGraphicsObject *background = qml_Page_->rootObject();
  int a(background->property("width").toInt()),
      b(background->property("height").toInt());

  while (b != 0)
  {
    int t = b;
    b = a % b;
    a = t;
  }
  int new_size = (a > 150)? a : 150;

  qDebug() << "Current main window size is" << this->size();
  qDebug() << "Current tile size is" << new_size;
  background->setProperty("tile_size",new_size);
  emit (tileSizeChanged(new_size));
}