ThumbnailItem.cpp 771 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <GraphModel/Integration/ThumbnailItem.h>
  9. namespace GraphModelIntegration
  10. {
  11. ThumbnailItem::ThumbnailItem(QGraphicsItem* parent)
  12. : QGraphicsLayoutItem()
  13. , QGraphicsItem(parent)
  14. {
  15. setGraphicsItem(this);
  16. }
  17. void ThumbnailItem::setGeometry(const QRectF &geom)
  18. {
  19. prepareGeometryChange();
  20. QGraphicsLayoutItem::setGeometry(geom);
  21. setPos(geom.topLeft());
  22. }
  23. QRectF ThumbnailItem::boundingRect() const
  24. {
  25. return QRectF(QPointF(0, 0), geometry().size());
  26. }
  27. }