[Qt-interest] Ruler widget not repainting

Anton Chernov mechernov at gmail.com
Tue Mar 22 09:01:15 CET 2011


Debugging shows a call to the update!..

void setCursorPos( const QPoint& cursorPos )
{
  if( mCursorPos == cursorPos ) { return; }
  mCursorPos = cursorPos;
  *update*();
}

bool eventFilter( QObject* obj, QEvent* event )
{
  if( event->type() == QEvent::MouseMove )
  {
    QMouseEvent* mevent = static_cast( event );
    QWidget* widget = qobject_cast( obj );
    if( widget ) { *setCursorPos*( mevent->pos() ); }
    /* handle mouse events further */
    return false;
  }
  return QWidget::eventFilter( obj, event );
}

2011/3/21 Gabriel M. Beddingfield <gabrbedd at gmail.com>:
>
>
> On Mon, 21 Mar 2011, Anton Chernov wrote:
>
>> offseted origin, just like the standard way. The problem is that the
>> current mouse position guids are drawn only when the mouse is over the
>> ruler widget and not when the button is over the widget that i want to
>> "measure" with my ruler.
>
> Have you tried calling update() in your eventFilter() ?
>
> -gabriel
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110322/c9028c26/attachment.html 


More information about the Qt-interest-old mailing list