I have it ....
the solution is only repaint on mouseMoveEvent && define each DRAG_MODE
on widged....
typedef enum
{
DRAW_SELECTION,
SCALE_SELECTION,
DRAW_LINE,
DRAW_START,
NO_EFFECT
} DRAG_MODE;
{
currentDragMode = DRAW_LINE;
mouseRELEASEPoint = e->pos();
if (display.isNull()) {
return;
}
/* remove draw lines */
Load_Actual_Desktop(); /* widget size setting e resolution X11 */
int hi_now = widgetSize.height();
int wi_now = widgetSize.width();
QPoint bottomRight
( widgetSize.
width() , widgetSize.
height() );
QRect areanow
( topLeft, bottomRight
);
repaint(areanow);
}
if ( currentDragMode == DRAW_SELECTION || currentDragMode == DRAW_LINE ) {
OneWorkImage = selectionIMAGE;
pen.setWidth( bordershade );
pen.setColor( shapepicture );
painter.setPen( pen);
painter.drawRect(selectionOutIMAGE);
/* ................... draw rectangle or only image display on the Zoom Widged && resizable ....*/
typedef enum
{
DRAW_SELECTION,
SCALE_SELECTION,
DRAW_LINE,
DRAW_START,
NO_EFFECT
} DRAG_MODE;
void Image_Operator::mouseMoveEvent(QMouseEvent *e)
{
currentDragMode = DRAW_LINE;
mouseRELEASEPoint = e->pos();
if (display.isNull()) {
return;
}
/* remove draw lines */
Load_Actual_Desktop(); /* widget size setting e resolution X11 */
int hi_now = widgetSize.height();
int wi_now = widgetSize.width();
QPoint topLeft( 0 , 0 );
QPoint bottomRight( widgetSize.width() , widgetSize.height() );
QRect areanow( topLeft, bottomRight );
repaint(areanow);
}
if ( currentDragMode == DRAW_SELECTION || currentDragMode == DRAW_LINE ) {
OneWorkImage = selectionIMAGE;
pen.setWidth( bordershade );
pen.setColor( shapepicture );
painter.setPen( pen);
painter.drawRect(selectionOutIMAGE);
/* ................... draw rectangle or only image display on the Zoom Widged && resizable ....*/
To copy to clipboard, switch view to plain text mode
source & PrtScn avaiable....
http://www.qtforum.de/forum/viewtopic.php?t=3885
Bookmarks