Please nominate your Qt Champions for 2021!

[Closed] Problem with paint event in mac?

  • I have tried the following program in both windows and mac. In windows it is working fine but in mac while moving the focus from one Qlineedit to other. in some portion around qlineedit the painting is missing.
    @bool ofi_vc_gui_panel::eventFilter (QObject *obj, QEvent *event)
    // Check for the paint event.
    if (event->type () == QEvent::Paint) {

        QPainter paint(window); // Create a paint object.
        // Store the source rect of the image.
        QRect source = QRect(0, 0,,;
        // Store the target rect where image is to be drawn.
        QRect target = QRect(0, 0,,;
        // Draw the image.
        paint.drawPixmap (target, pixmap, source);
        // Return the status.
        return true;

    Here i am painting on parent window containing qlineedit as a child.
    For image see the link below login window image
    The white color around the qlineedit corresponding to emilid is the problem.

  • You are discussing the same issue already in another "topic": I think you have been warned before not to open duplicate topics.

    I am closing this topic.

Log in to reply