(self, format=None, autosave=None, getfocus=True, **kwargs)
Constructor. Call `initialize` and initialize the companion classes
        as well.
Constructor. Call `initialize` and initialize the companion classes
        as well.
Constructor . Call initialize and initialize the companion classes as well .
def __init__(self, format=None, autosave=None, getfocus=True, **kwargs):
        """Constructor. Call `initialize` and initialize the companion classes
        as well."""
        if format is not None:
            super(GalryWidget, self).__init__(format)
        else:
            super(GalryWidget, self).__init__()
        
        self.initialized = False
        self.just_initialized = False
        
        self.i = 0
        
        # background color as a 4-tuple (R,G,B,A)
        self.bgcolor = (0, 0, 0, 0)
        self.autosave = None
        
        # default window size
        # self.width, self.height = 600, 600
        
        # FPS counter, used for debugging
        self.fps_counter = FpsCounter()
        self.display_fps = DISPLAY_FPS
        self.activate3D = None

        # widget creation parameters
        self.bindings = None
        self.companion_classes_initialized = False
        
        # constrain width/height ratio when resizing of zooming
        self.constrain_ratio = False
        self.constrain_navigation = False
        self.momentum = False
        self.activate_help = True
        self.activate_grid = False
        self.block_refresh = False
        
        # Capture keyboard events.
        if getfocus:
            self.setFocusPolicy(Qt.WheelFocus)
        
        # Capture mouse events.
        self.setMouseTracking(True)
        
        # Capture touch events.
        self.setAcceptTouchEvents = True
        self.grabGesture(QtCore.Qt.PinchGesture)
        self.mouse_blocked = False  # True during a pinch gesture
        
        # Initialize the objects providing the core features of the widget.
        self.user_action_generator = UserActionGenerator()
        
        self.is_fullscreen = False
        
        self.events_to_signals = {}
        
        # keyword arguments without "_manager" => passed to initialize                  
        self.initialize(**kwargs)
        
        # initialize companion classes if it has not been done in initialize
        if not self.companion_classes_initialized:
            self.initialize_companion_classes()
        self.initialize_bindings()
        
        # update rendering options
        self.paint_manager.set_rendering_options(
                        activate3D=self.activate3D,
                        constrain_ratio=self.constrain_ratio,
                        )
        
        self.autosave = autosave
def __init__ ( self , format = None , autosave = None , getfocus = True , * * kwargs ) : if format is not None : super ( GalryWidget , self ) . __init__ ( format ) else : super ( GalryWidget , self ) . __init__ ( ) self . initialized = False self . just_initialized = False self . i = 0 # background color as a 4-tuple (R,G,B,A) self . bgcolor = ( 0 , 0 , 0 , 0 ) self . autosave = None # default window size # self.width, self.height = 600, 600 # FPS counter, used for debugging self . fps_counter = FpsCounter ( ) self . display_fps = DISPLAY_FPS self . activate3D = None # widget creation parameters self . bindings = None self . companion_classes_initialized = False # constrain width/height ratio when resizing of zooming self . constrain_ratio = False self . constrain_navigation = False self . momentum = False self . activate_help = True self . activate_grid = False self . block_refresh = False # Capture keyboard events. if getfocus : self . setFocusPolicy ( Qt . WheelFocus ) # Capture mouse events. self . setMouseTracking ( True ) # Capture touch events. self . setAcceptTouchEvents = True self . grabGesture ( QtCore . Qt . PinchGesture ) self . mouse_blocked = False # True during a pinch gesture # Initialize the objects providing the core features of the widget. self . user_action_generator = UserActionGenerator ( ) self . is_fullscreen = False self . events_to_signals = { } # keyword arguments without "_manager" => passed to initialize                   self . initialize ( * * kwargs ) # initialize companion classes if it has not been done in initialize if not self . companion_classes_initialized : self . initialize_companion_classes ( ) self . initialize_bindings ( ) # update rendering options self . paint_manager . set_rendering_options ( activate3D = self . activate3D , constrain_ratio = self . constrain_ratio , ) self . autosave = autosave