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

QMessageBox inside a QGraphicsScene



  • Hi, i have more QGraphicsPixmapItem inside a QGraphicsScene. I Create a signal on these object so i can know when a QGraphicsPixmapItem is clicked. If i try something like that:
    @
    void Home::pixmapPressed(quint16 id)
    {
    qDebug() << "id: " << id;

    switch(id)
    {
        case 0: 
            break;
        case 1: 
        case 2:
            break;
    }
    

    }
    @
    The result is the id of the pixmap and all works well.
    But if i change is something like that:
    @
    void Home::pixmapPressed(quint16 id)
    {
    qDebug() << "id: " << id;

    switch(id)
    {
        case 0: 
            formManager(FORM_NEXT);
            break;
        case 1: 
        case 2:
            QMessageBox::information(this,"test","test");
            break;
    }
    

    }@

    If i click the pixmap 0, call the formManager and this is ok. But if i click 1 or 2 i get the QMessageBox and after i close that all area of a QGraphicScene call a pixmapPressed with the latest id that open the QMessageBox!!! This is very strange!


Log in to reply