Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to access spinbox value in another class in a different .py file to the main window file?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 183 Views
  • 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 Offline
    G Offline
    gemmaaa_95
    wrote on last edited by gemmaaa_95
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved