Hi Thomas,

On Fri, 31 Dec 2010 18:00:21 +0100
Thomas Paviot <tpav...@gmail.com> wrote:

> I committed changes so that multi selection is possible (
> http://code.google.com/p/pythonocc/source/detail?r=1116) and the zoom area
> (Shift+RMB)/multiselection(Shift+LMB) with qt backend (
> http://code.google.com/p/pythonocc/source/detail?r=1117)

Thank You for this.

> (note that I moved the drawing stuff to the paintEvent method of the QtWidget 
> class).

This is good idea that You moved the drawing stuff to the paintEvent method of 
the QtWidget class. If I understand correctly Qt docu, MacOS X and Windows can 
only draw stuff inside a paintEvent() function.

> I don't manage to get the rectangle displayed while moving the mouse pointer
> (although zoom and multi selection are ok). Is it a MacOS specific bug or is
> it the same for you under Debian?

Regarding drawing rectangle problem, I changed following:
###
def mouseReleaseEvent( self, event )
        pt = point(event.pos())
        if event.button() == QtCore.Qt.LeftButton:
            pt = point(event.pos())
            #self.repaint() # remove it!!!
            if self._select_area:
                [Xmin, Ymin, dx, dy] = self._drawbox
                #selected_shapes = 
self._display.SelectArea(Xmin,Ymin,Xmin+dx,Ymin+dy)
                selected_shapes = 
self._display.SelectArea(Xmin,Ymin,Xmin+dx,Ymin+dy)
                self._select_area = False
                
            elif self._display.Select(pt.x,pt.y):
                    selected_shape = self._display.GetSelectedShape()
                    print selected_shape,selected_shape.ShapeType()
      
        elif event.button() == QtCore.Qt.RightButton:
            if self._zoom_area:
                [Xmin, Ymin, dx, dy] = self._drawbox
                self._display.ZoomArea(Xmin, Ymin, Xmin+dx, Ymin+dy)
                self._zoom_area = False                   
###
def DrawBox( self , event):
        tolerance = 2
        pt = point( event.pos() )
        dx = pt.x - self.dragStartPos.x
        dy = pt.y - self.dragStartPos.y
        if abs( dx ) <= tolerance and abs( dy ) <= tolerance:
            return 
        self.repaint() # add this hier!
        self._drawbox = [self.dragStartPos.x, self.dragStartPos.y , dx, dy]
###

I can confirm now that everything works fine for me
under Debian GNU/Linux.

-- 
Goran Lukic <goranl...@gmail.com>

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to