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. Import def (of class MainWindow) for another file .py
Forum Updated to NodeBB v4.3 + New Features

Import def (of class MainWindow) for another file .py

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 5 Posters 558 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.
  • L Offline
    L Offline
    Logan12
    wrote on last edited by
    #1

    When I trie import a def, I recieve this output (image). How I can import?

    39c57b95-75b6-49c9-b979-225eac0d2966-image.png

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

      Hi and welcome to devnet,

      From your code, you are not creating a QApplication object before your widget.

      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
      • L Offline
        L Offline
        Logan12
        wrote on last edited by
        #3

        Thank you :) .

        I'm noob. Do you can teach how I do this?

        jsulmJ 1 Reply Last reply
        0
        • L Logan12

          Thank you :) .

          I'm noob. Do you can teach how I do this?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Logan12 There are many examples and documentation: https://build-system.fman.io/pyqt5-tutorial

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • Jaime02J Offline
            Jaime02J Offline
            Jaime02
            Qt Champion 2021
            wrote on last edited by Jaime02
            #5

            @Logan12
            You are using PyCharm, and it does not always catch the errors. Try doing this:
            323717e0-0336-4271-8793-d23f23a99f01-image.png

            40337ac4-f9d8-48ac-b2fb-f6e88a1abcb9-image.png
            Check that option and you will see a proper error traceback

            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