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. How to create a simple user app?
Forum Updated to NodeBB v4.3 + New Features

How to create a simple user app?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.7k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    jn30360
    wrote on last edited by
    #1

    I've installed QT Creator (3.5.1) and created a simple form that I need to integrate into an existing python script. Are there simple, straightforward instructions on how to do this?

    R 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you planning on using PyQt ?

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

      J 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you planning on using PyQt ?

        J Offline
        J Offline
        jn30360
        wrote on last edited by
        #3

        @SGaist The python program I have is PyCharm. (is that what you're asking?)

        1 Reply Last reply
        0
        • J jn30360

          I've installed QT Creator (3.5.1) and created a simple form that I need to integrate into an existing python script. Are there simple, straightforward instructions on how to do this?

          R Offline
          R Offline
          raf924
          wrote on last edited by
          #4

          @jn30360 To use the Qt framework on Python you need to use libraries such as PyQt or PySide.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jn30360
            wrote on last edited by
            #5

            I have included the following code:

            from pyside import QtCore
            from pyside import QtGui
            from pyside import QtUiTools
            ui=QtUiTools.QUiLoader()
            ui.load("frmMain.ui")

            Not sure what you do next to access objects (i.e., pushbuttons, etc) on the form frmMain.

            R 1 Reply Last reply
            0
            • J jn30360

              I have included the following code:

              from pyside import QtCore
              from pyside import QtGui
              from pyside import QtUiTools
              ui=QtUiTools.QUiLoader()
              ui.load("frmMain.ui")

              Not sure what you do next to access objects (i.e., pushbuttons, etc) on the form frmMain.

              R Offline
              R Offline
              raf924
              wrote on last edited by
              #6

              @jn30360 Hmm i don't think that's gonna work. try something like this:

              from PySide import QtCore, QtGui, QtUiTools
              
              
              def loadUiWidget(uifilename, parent=None):
                  loader = QtUiTools.QUiLoader()
                  uifile = QtCore.QFile(uifilename)
                  uifile.open(QtCore.QFile.ReadOnly)
                  ui = loader.load(uifile, parent)
                  uifile.close()
                  return ui
              
              
              if __name__ == "__main__":
                  import sys
                  app = QtGui.QApplication(sys.argv)
                  MainWindow = loadUiWidget(":/forms/myform.ui")
                  MainWindow.show()
                  sys.exit(app.exec_())
              

              (From stackoverflow)

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jn30360
                wrote on last edited by
                #7

                Hey that worked, thanks a lot. That gets the form open.

                Can you point me to code that interfaces a pushbutton on the form? Need something like:

                frmMain.pushbutton1_clicked:
                if <condition1> and not <condition2> etc... :
                <action>
                else :
                <action>

                Just can't find any clear example of how to integrate objects on the form into the script. I've seen some instructions on slots/signals, but can't find clear instructions/examples on how to implement.

                R 1 Reply Last reply
                0
                • J jn30360

                  Hey that worked, thanks a lot. That gets the form open.

                  Can you point me to code that interfaces a pushbutton on the form? Need something like:

                  frmMain.pushbutton1_clicked:
                  if <condition1> and not <condition2> etc... :
                  <action>
                  else :
                  <action>

                  Just can't find any clear example of how to integrate objects on the form into the script. I've seen some instructions on slots/signals, but can't find clear instructions/examples on how to implement.

                  R Offline
                  R Offline
                  raf924
                  wrote on last edited by
                  #8

                  @jn30360 this maybe : https://wiki.qt.io/Signals_and_Slots_in_PySide

                  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