0

I have a QPushButton embedded in my QGraphicsScene using a QProxyWidget. When I click the button, I want to change a global game state object and then signal the paint event of the view, to update the entire game. What would be the best way to accomplish this?

Here's my button mousePressEvent:

void Button::mousePressEvent(QMouseEvent * event) {


    /**
        Trying to signal the QGRaphicsView from here
    **/


}

Any help would be greatly appreciated, I can't seem to find any documentation online as to how to manually force a paint event.

Thanks

JonMorehouse
  • 1,313
  • 6
  • 14
  • 34

1 Answers1

0

Why don't you just connect the button's pressed() signal to the graphicsview's update() or repaint() slot?

Stephen Chu
  • 12,724
  • 1
  • 35
  • 46
  • hmm...thats an option, but I need to actually change the game_state class in my button widget. What my goal is, is to change the game state in the widget and then call the view to change the scene based upon that input. Could I connect two signals? – JonMorehouse Nov 30 '12 at 19:39