def resizeEvent(self, event): """Resize the widget. Reimplemented from `QGraphicsView`. Resize the `MapGraphicsScene`. Args: event(QResizeEvent): Resize event. """ QGraphicsView.resizeEvent(self, event) size = event.size() self.scene().setSize(size.width(), size.height())
def resizeEvent(self, *args, **kwargs): """ allow widget to resize with the rectangle... """ # there has to be a better way to set this... # ======================================================================= # resize widget # ======================================================================= rect = self.geometry() self.scene().setSceneRect( rect.topLeft().x(), rect.topLeft().y(), rect.width(), rect.height() ) # update gradient self.scene().drawGradient() # update crosshair # RGBA Crosshair self.__updateRGBACrosshairOnResize() # Linear crosshair # main_widget = getWidgetAncestorByName(self, "ColorInputWidget") # direction = main_widget.getLinearCrosshairDirection() # self.__updateLinearCrosshairOnResize(direction) self.scene().linear_crosshair_item.updateGeometry(self.width(), self.height()) self.setPreviousSize(rect) return QGraphicsView.resizeEvent(self, *args, **kwargs)