[Marble-devel] Suggested Patch for Bug 232098 - JJ: Please add fast adding messurment points by ctrl+click

Thomas Lenarz tommesml at netcologne.de
Sun Sep 19 20:51:12 CEST 2010


Hello,

I tried to find a solution for the JJ described in Bug 232098 recently:

I am new to marble development. I played around with the QT-Version and 
would like to propose the following change.

However, I am not sure if this change could break something around the
rubber-band code, which uses the control-key as well. Therefore I 
compare the coordinates between button-press and button-release. The 
addMeasurePoint() triggers only if the coordinates are equal.

I am not sure how to generate a patch. It would be great if anyone could 
point me to some guidelines.

Please find the patch-file attached to this mail.

Thanks,
Thomas

File: marble/src/lib/MarbleWidgetInputHandler.cpp

             // Regarding mouse button releases:
             if ( e->type() == QEvent::MouseButtonRelease
                  && event->button() == Qt::LeftButton )
             {

                 if (      ( event->modifiers() & Qt::ControlModifier )
                       &&  ( event->globalPos() == d->m_selectionOrigin 
     )
                         )
                 {
                     d->m_addMeasurePointAction->setData( QPoint( 
event->x(),
event->y() ) );
                     addMeasurePoint();
                 }
                 else
                 {

                     //emit current coordinates to be be interpreted
                     //as requested
                     emit mouseClickScreenPosition( d->m_leftpressedx,
d->m_leftpressedy );

                 }

                 MarbleWidgetInputHandler::d->m_widget->setViewContext( 
Still );
                 if ( MarbleWidgetInputHandler::d->m_widget->mapQuality( 
Still )
                      != MarbleWidgetInputHandler::d->m_widget->mapQuality(
Animation ) )
                 {
 
MarbleWidgetInputHandler::d->m_widget->updateChangedMap();
                 }

                 d->m_leftpressed = false;
             }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MarbleWidgetInputHandler.cpp.diff
Type: text/x-patch
Size: 1402 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20100919/162fd245/attachment.diff 


More information about the Marble-devel mailing list