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. why predefined function do not work in pycharm
QtWS25 Last Chance

why predefined function do not work in pycharm

Scheduled Pinned Locked Moved Unsolved General and Desktop
pycharmpyqt5desktoppython3function
2 Posts 2 Posters 368 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.
  • L Offline
    L Offline
    lanas
    wrote on 8 Jun 2022, 15:04 last edited by
    #1

    i face this problem many times when i want to work with predefined functions in pycharms i do not know what is the problem or where . As example i want to work with those functions close() & hide() but there is an error that keeps showing up the error is :Error due to 'Ui_Login_Dialog' object has no attribute 'close'
    this is an example of function i work with

        def openwindow(self):
         try:
            self.nextui = QtWidgets.QWidget()
            self.ui = Registration.Ui_Registration()
            self.ui.setupUi(self.nextui)
            self.nextui.show()
            MainWindow.close()
         except  Exception as e:
             print("Error!", f"Error due to {str(e)}")
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Jun 2022, 15:11 last edited by
      #2

      Hi,

      That's because these classes are no widgets, there are used to build the UI.

      In you code snippet, you would use self.nextui.hide() to hide the widget that was created with the help of Registration.Ui_Registration. That is the same for all the widgets you created that way.

      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
      1

      2/2

      8 Jun 2022, 15:11

      • Login

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