This sounds like you are on a wrong design path.
If you explain what it is you want to achieve and why, we might help you to solve it correctly.
This sounds like you are on a wrong design path.
If you explain what it is you want to achieve and why, we might help you to solve it correctly.
==========================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.
Yes, thank you. I will try to explain it a bit more clearly.
I have 3 tab pages. When I switch from one to the other. I need to check if widgets on one page have been modified, if they are, when I switch tab, I will ask the user if they want to discard or save them. If I use the QTabWidget::currentChanged(int), I will go to the other tab directly, without me being able to properly get user response...(discard or save)...
At the moment I'm trying to subclass QTabWidget such that I can get the internal QTabBar (since it's protected). But then again, QTabBar also only has currentChanged(int) signal...I'm having difficulties subclassing QTabBar and install custom signals.................Thanks
Why not?If I use the QTabWidget::currentChanged(int), I will go to the other tab directly, without me being able to properly get user response...(discard or save)...
the user will not see the difference if the message box comes on just as the new tab got shown or when the old tab is still there (or, the difference has no effect on the user).
The user has to interact with the message box any how, not with the tab.
==========================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.
Yes many thanks on your input.
I could also cache a variable recording current tab...and this issue can be fixed..
However, I am trying a way that does not cache states, and my UI was designed in Qt Creator...(I could also bypass this problem by hard-coding UI components).....
Thanks all the ways
Bookmarks