Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [PyQt] Signals and slots, transcending classes

I'm new to Python, and using QT to create a UI and am consequently using PyCharm to connect slots and signals.

In PyCharm I have the control parameters module. And was using it to pass away values to parameters so I can use those to do math outside the module. Looking something like this.

        Parameter1 = 0
        Parameter2 = 0
        Parameter3 = 0

        Parameter1 = self.CurrentControl.sliderMoved['int']
        Parameter2 = self.ShiftOPP.sliderMoved['int']
        Parameter3 = Parameter2 // wanted math here not possible
        # self.ShiftOPP.sliderMoved['int'].connect(self.Parameter2)
        # self.ShiftOPP.sliderMoved['int'].connect(self.Parameter2)
My problem is tho, I cant seem to do math inside the module, and whenever I try to reference the variables outside the main module I get an error. Is it possible to take them somewhere else where I can do integer arithmetic with the signals? "Not necessarily setting number boxes (passing integers), but preferrably not limitted to.

Kind Regards,
Okay that is not a MRE (Minimal Reproducible Example) so it will be very difficult to determine what you are doing and thus very difficult to answer your question. You will get a much quicker response if you include a completely functional bit of code that allows one to copy/paste and run it to see what you are doing. Also are you using just QT or PyQt and/or are you using some kind of Designer the latter btw while based on Qt/PyQt does not actually produce Qt/PyQt code. Once you see a true version of the former you will understand why I say that about the latter.
silly American kah-nig-hit

Top Page

Forum Jump:

Users browsing this thread: 1 Guest(s)