コード例 #1
0
 def update_editor(self):
     """ Updates the editor when the object trait changes externally to the
         editor.
     """
     if self.factory.image is None:
         value = self.value
         if isinstance(value, ImageResource):
             self.control.setPixmap(convert_bitmap(value))
     self.control.setScaledContents(self.factory.scale)
     self.control.setAllowUpscaling(self.factory.allow_upscaling)
     self.control.setPreserveAspectRatio(self.factory.preserve_aspect_ratio)
     self.control.setAllowClipping(self.factory.allow_clipping)
コード例 #2
0
ファイル: image_editor.py プロジェクト: enthought/traitsui
 def update_editor(self):
     """ Updates the editor when the object trait changes externally to the
         editor.
     """
     if self.factory.image is None:
         value = self.value
         if isinstance(value, ImageResource):
             self.control.setPixmap(convert_bitmap(value))
     self.control.setScaledContents(self.factory.scale)
     self.control.setAllowUpscaling(self.factory.allow_upscaling)
     self.control.setPreserveAspectRatio(self.factory.preserve_aspect_ratio)
     self.control.setAllowClipping(self.factory.allow_clipping)
コード例 #3
0
    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        image = self.factory.image
        if image is None:
            image = self.value

        self.control = QImageView()
        self.control.setPixmap(convert_bitmap(image))
        self.control.setScaledContents(self.factory.scale)
        self.control.setAllowUpscaling(self.factory.allow_upscaling)
        self.control.setPreserveAspectRatio(self.factory.preserve_aspect_ratio)
        self.control.setAllowClipping(self.factory.allow_clipping)

        self.set_tooltip()
コード例 #4
0
ファイル: image_editor.py プロジェクト: enthought/traitsui
    def init(self, parent):
        """ Finishes initializing the editor by creating the underlying toolkit
            widget.
        """
        image = self.factory.image
        if image is None:
            image = self.value

        self.control = QImageView()
        self.control.setPixmap(convert_bitmap(image))
        self.control.setScaledContents(self.factory.scale)
        self.control.setAllowUpscaling(self.factory.allow_upscaling)
        self.control.setPreserveAspectRatio(self.factory.preserve_aspect_ratio)
        self.control.setAllowClipping(self.factory.allow_clipping)

        self.set_tooltip()