Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Designer/ slot method/ py script help
QtWS25 Last Chance

QT Designer/ slot method/ py script help

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 165 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.
  • Q Offline
    Q Offline
    Qtips
    wrote on 1 Jul 2024, 19:43 last edited by
    #1

    Hi all. Noob here. Just a question about having buttons built in QT DESIGNER run python scripts.

    How do I do it? do I have to export the .ui and convert it to .py and THEN insert the script or reference to a .py script I want to run?... or can I just add the script or code directly, somewhere, in the SLOT EDITOR?

    Is the QT DESIGNER workflow that you make the interface first, THEN add the code after exporting the .ui and converting it to .py?

    And if so, can you open the .py in QT DESIGNER? Do you have to convert it back to a .ui file, first?

    I've watched some tutorials but there is no clear answer. Any help is appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 1 Jul 2024, 19:52 last edited by
      #2

      Hi and welcome to devnet,

      No, no coding in Designer.
      The workflow is:

      • you create the UI file
      • you generate the Python from it
      • you have a second Python file that makes use of the generated file to create the widget and that will contain the code you want to execute.

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

      Q 1 Reply Last reply 2 Jul 2024, 00:21
      2
      • S SGaist
        1 Jul 2024, 19:52

        Hi and welcome to devnet,

        No, no coding in Designer.
        The workflow is:

        • you create the UI file
        • you generate the Python from it
        • you have a second Python file that makes use of the generated file to create the widget and that will contain the code you want to execute.
        Q Offline
        Q Offline
        Qtips
        wrote on 2 Jul 2024, 00:21 last edited by
        #3

        @SGaist thanks. i was wondering. i appreciate the help. stay orky

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Jul 2024, 20:20 last edited by
          #4

          You're welcome !

          Since your question is answered, please mark the thread as solved using the cog button or the three dot menu beside the answer you deem correct so other forum users may know a solution has been found :-)

          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

          4/4

          2 Jul 2024, 20:20

          • Login

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