When does Simulator print its line?
When does Simulator print its line?
So which slot is not called? SetPositions? Did you remember to register a meta-type for your custom argument types?
yes SetPositions(), which receives the emit PositionsHaveChanged() signal when it is emitted by mousePressEvent() but does not receive it when emitted by Clear2().
meta-type? euhhhh actually no but:
- I had in mind that this was related to QVariant class in order to make unions of a limited list of types...
- anyway it does not explain why it works for mousePressEvent() and not for Clear2() (it should either work or not work for both, shouldn't it?)
I can't see in your code a connect statement that connects to the mousePressEvent() slot.
Never mind I see now what you meant.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
The mousePressEvent() is "natively" connected to the mouse :-) through the QLabel class, so no need to connect it anymore.
I am not sure what do you mean... after all.
I think you might (if I am getting right what I see in your code and what you say) be confusing the mousePressEvent() *event handler* and the mousePressEvent() slot you have overridden in your QLabel subclass!
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
but that slot has a single line:
Qt Code:
void Simulator::SetPositions(std::vector<std::vector<std::vector<double> > > positions) { this->Print("%d %d %d (%lf,%lf)", positions.size(), positions[0].size(), positions[0][0].size(), positions[0][0][0], positions[0][0][1]); }To copy to clipboard, switch view to plain text mode
Bookmarks