Unsolved GUI blocking...
-
Thanks. I have your code from above working, using QTimer - and behaving correctly... what i'm now trying to do is repeat the operation while the button is checked but also stopped when it is unchecked.. That sounded like an ideal solution but I haven't tried it as i couldn't work out how it worked... I guess i'll have to keep trying.
as another issue, when i attempt to do wiringPiSetup() as i have above it dosen't work, until a button that has it in is pushed. can i run it when the program starts? if so how?
-
Thanks, very much appreciated. I'll give that a go.
-
-
@Pablo-J.-Rogina said in GUI blocking...:
@Aesgarth you need to call wiringPiSetup() only once in your application, maybe in main.cpp before starting Qt event loop, on in MainWindow constructor for instance. Also don't forget that it needs to be called with root privileges... see here.
Thanks, putting it in the constructor worked - I'd put it in the wrong place earlier.
Re the timer issue, having tried your example above i'm getting the error
timerRelay1On was not declared in this scope
but i've probably done something wrong. I'll keep trying.thanks again.
-
@Aesgarth said in GUI blocking...:
timerRelay1On was not declared in this scope
Well, you have to declare timerRelay1On somewhere before you can use it. Either add it as class member to MainWindow or just do
QTimer *timerRelay1On = new QTimer(this);