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

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

        self.retranslateUi(Control_Parameters)
        self.CurrentControl.sliderMoved['int'].connect(self.label_5.setNum)
        Parameter1 = self.CurrentControl.sliderMoved['int']
        Parameter1.connect(self.label_3.setNum)
        Parameter2 = self.ShiftOPP.sliderMoved['int']
        Parameter3 = Parameter2 // wanted math here not possible
        self.retranslateUi(Control_Parameters)
        Parameter3.connect(self.label_4.setNum)
        # self.ShiftOPP.sliderMoved['int'].connect(self.Parameter2)
        # self.ShiftOPP.sliderMoved['int'].connect(self.Parameter2)
        self.Offset.sliderMoved['int'].connect(self.label_4.setNum)
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,
Reply


Messages In This Thread
Signals and slots, transcending classes - by Saltwater - Sep-07-2019, 12:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Connecting pushbuttons signals throug a lambda fonction in a loop arbiel 4 2,522 Nov-05-2020, 06:37 PM
Last Post: arbiel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020