Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QPainter errors while project compiling as static method



  • Hai,

    In my project I am used to display one image in my application so for that I am used Qpainter method to display image.
    This project is cross compiled for ARM controller. If I use dynamic compilation method image was displaying well.

    but if I use static compilation I am getting an error as shown below

    bq. QPainter::begin: Paint device returned engine == 0, type: 2
    QPainter::setWorldTransform: Painter not active
    QPainter::end: Painter not active, aborted

    and below is my code

    @
    QPixmap sourceImage("/Images/compassneedle.png");
    QPixmap rotatePixmap(sourceImage.size());
    rotatePixmap.fill(Qt::transparent);
    QTransform transform;
    transform.translate(sourceImage.size().width() / 2, sourceImage.size().height() / 2);
    transform.rotate(i);
    transform.translate(-sourceImage.size().width() / 2, -sourceImage.size().height() / 2);
    QPainter m_Qpointer;
    m_Qpointer.begin(&rotatePixmap);
    m_Qpointer.setTransform(transform);
    m_Qpointer.drawPixmap(0, 0, sourceImage);
    m_Qpointer.end();
    ContentImageLable->setScaledContents(true);
    myLabel->setScaledContents(true);

    myLabel->setPixmap(rotatePixmap);
    

    @

    please how can I solve this one. please suggest me
    is there any mistake is my code or static compilation is problem


Log in to reply