Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to access spinbox value in another class in a different .py file to the main window file?

    Qt for Python
    2
    2
    73
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gemmaaa_95 last edited by gemmaaa_95

      I have three .py files. The first file has my main window class where I setup my UI from the second .py file which I generate from Qt Designer. This UI includes a QSpinBox. My third .py file includes a class to control a stepper motor. I am trying to setup a variable in my stepper motor class which is the value of the spin box, as I'd like to use this for the number of steps the motor takes. I can access the spin box value no problem in my main window file but not my stepper motor file? Is there a way this can be done without me having to move my stepper motor class into the same .py file as my main window? I'd like to keep them separate as I want to have different .py files for each piece of equipment so that the main window py file doesn't end up crowded.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Can you show your code ?

        Where exactly are you using your stepper motor control class ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post