Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QT Double buffering does not work on the board

    Mobile and Embedded
    1
    1
    378
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      ForestPoem last edited by

      The PC will operate normally , but the image output is not smooth in the board.
      I checked and double-buffering support in QT itself, I understand that.
      Why not apply ? Below are the specific signal occurs when the behavior of the function.

      void curvePlotter::keyPressEvent(QKeyEvent *event)
      {

      switch (event->key()) {
      case Qt::Key_Plus:
          zoomIn();
          break;
      case Qt::Key_Minus:
          zoomOut();
          break;
      case Qt::Key_Left:
          zoomStack[curZoom].scroll(-1, 0);
          refreshPixmap();
          break;
      case Qt::Key_Right:
          zoomStack[curZoom].scroll(+1, 0);
          refreshPixmap();
          break;
      case Qt::Key_Down:
          zoomStack[curZoom].scroll(0, -1);
          refreshPixmap();
          break;
      case Qt::Key_Up:
          zoomStack[curZoom].scroll(0, +1);
          refreshPixmap();
          break;
      default:
          QWidget::keyPressEvent(event);
      }
      

      }

      void curvePlotter::refreshPixmap()
      {
      pixmap = QPixmap(size());
      pixmap.fill(this, 0, 0);
      QPainter painter(&pixmap);
      painter.initFrom(this);
      drawGrid(&painter);
      drawCurves(&painter);
      update();
      }

      1 Reply Last reply Reply Quote 0
      • First post
        Last post