use update() instead of repaint(); get rid of useless window attributes
authorChristian Pulvermacher <pulvermacher@gmx.de>
Sun, 29 Jan 2012 19:59:27 +0000 (20:59 +0100)
committerChristian Pulvermacher <pulvermacher@gmx.de>
Sun, 29 Jan 2012 19:59:27 +0000 (20:59 +0100)
src/mainwindow.cpp
src/vncview.cpp

index ce3afc5..d89af5a 100644 (file)
@@ -252,7 +252,7 @@ void MainWindow::statusChanged(RemoteView::RemoteStatus status)
 
         vnc_view->setZoomLevel(zoom_slider->value());
         vnc_view->useFastTransformations(false);
-        vnc_view->repaint();
+        vnc_view->update();
         break;
     case RemoteView::Disconnecting:
         if(old_status == RemoteView::Disconnected) //Disconnecting also occurs while connecting, so check last state
index dc1427d..d0a8e1b 100644 (file)
@@ -289,8 +289,7 @@ void VncView::updateImage(int x, int y, int w, int h)
     m_frame = vncThread.image();
 
     if (!m_initDone) { //TODO this seems an odd place for initialization
-        setAttribute(Qt::WA_StaticContents);
-        setAttribute(Qt::WA_OpaquePaintEvent);
+        setAttribute(Qt::WA_NoSystemBackground);
         installEventFilter(this);
 
         setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor);
@@ -315,7 +314,7 @@ void VncView::updateImage(int x, int y, int w, int h)
         emit framebufferSizeChanged(m_frame.width(), m_frame.height());
     }
 
-    repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor));
+    update(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor));
 }
 
 void VncView::setViewOnly(bool viewOnly)
@@ -538,9 +537,9 @@ void VncView::mouseEventHandler(QMouseEvent *e)
     if(((m_dotCursorState == CursorOn) || m_forceLocalCursor)
             and (cursor_x != old_cursor_x or cursor_y != old_cursor_y)) {
         //clear last position
-        repaint(old_cursor_x*m_horizontalFactor - CURSOR_SIZE/2, old_cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
+        update(old_cursor_x*m_horizontalFactor - CURSOR_SIZE/2, old_cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
         //and refresh new one
-        repaint(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
+        update(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
 
         old_cursor_x = cursor_x;
         old_cursor_y = cursor_y;