Re: QTimer not calling slot
Does the slot really exist? Is the file processed by moc?
Re: QTimer not calling slot
Is the event loop running?
Re: QTimer not calling slot
Quote:
Does the slot really exist? Is the file processed by moc?
Yes, it does:
Code:
public slots:
void updatePos()
;
Quote:
Is the event loop running?
Hmmm.. I think so. This is a class I call to create an item when needed.
Code:
if(btn1){
ui->lineEdit->setText("cliked");
Shot tiro;
}
Re: QTimer not calling slot
Think what is the scope of your "tiro" object and what happens to it when line #4 of the code is reached.
Re: QTimer not calling slot
@#!!%&* I should really take a shot on the head.:mad:
Scope, I always forget.... Thanks for the patience.:o
BTW, why is QGraphicsView so slow when updating an item's position?
Re: QTimer not calling slot
Quote:
Originally Posted by
been_1990
BTW, why is QGraphicsView so slow when updating an item's position?
Because you are not using it correctly.
Re: QTimer not calling slot
I'm using setPos(x,y) to update it's position. Isn't that correct? I checked out the "40000 Chips" example, and copied some settings from it's QGraphicsView:
Code:
graphicsView
->setOptimizationFlags
(QGraphicsView::DontSavePainterState);
graphicsView
->setViewportUpdateMode
(QGraphicsView::SmartViewportUpdate);
But it still goes slow. Where can I see an example of correct implementation of QGraphicsView with changing elements positions(not drag-'n-drop)
Re: QTimer not calling slot
There is no correct implementation of Graphics View bla bla bla. What is correct depends on a case-by-case basis.