Class's value not changing / keeps reseting | Simple Qt Application
-
Hey, this is my first time using qt. I had this issue while making a simple windows app, I don't know how I’m going to explain this but please bear with me.
I have added in the app's main window a single button, that based on a class object's boolean variable ("availability"), you can be able to press the button or not. Let's say that the variable is true, the button is now clickable and pressing it will 'supposedly' set the “availability” to false. The problem here is somehow the variable doesn't get set to false when I press the button, I can just keep pressing and it never changes to false.
After some debugging, I’ve found that somehow whenever I click on the button, what will happen is the “availability” will be set to false but when I click on the button again its value gets reset to true, so whether clicking on it or not wouldn’t change anything.
This seems like nonsense and a lot for you to read, but I can't think of any other way to explain this, as I myself have no idea what's causing this issue. Also, english is not my first language, so I’ll be thankful for any good explanation! -
Don't worry, the description is clear, but what we're missing is your code :-) It's hard to guess what's wrong with it without seeing it.
Just from the description I'd say either signal-slot connection is not working, or slot code is wrong.
-
Hi,
@vander_13 said in Class's value not changing / keeps reseting | Simple Qt Application:
Hey, thanks for your reply!
Where can i share the code with you?You can post the relevant code here.