Results 1 to 9 of 9

Thread: pyqt4 dialog "object has no attribute"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: pyqt4 dialog "object has no attribute"

    In "launchPcDialog" you are creating an instance of PartCountEditorDialog, which creates the UI elements, and then you create another set of UI elements that the dialog has no access to.

    So the code in your showPartDescription slot accesses the first set of elements, which is no longer visible since they are hidden by the second second set.

    Just don't create the second set.

    Cheers,
    _

  2. #2
    Join Date
    Oct 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: pyqt4 dialog "object has no attribute"

    If I comment out line 12 in the above code, I am back to the original problem:

    File "/Users/robert/PycharmProjects/pcbMrp/Utilities/dialogTest.py", line 18, in showPartDescription
    part = self.pcePartNoEditor.text()
    AttributeError: 'PartCountEditorDialog' object has no attribute 'pcePartNoEditor'

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: pyqt4 dialog "object has no attribute"

    Quote Originally Posted by jacksonr View Post
    If I comment out line 12 in the above code, I am back to the original problem:
    And why on earth would you do that?

    Why would you want to not create the UI elements that you need and keep the ones you don't?

    Cheers,
    _

  4. #4
    Join Date
    Oct 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: pyqt4 dialog "object has no attribute"

    I get it now.

    Thanks

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 10:02
  2. Replies: 0
    Last Post: 23rd April 2014, 07:45
  3. PyQt4: QNetworkDiskCache. Save images with attribute "no-cache"
    By rustamakhmetov in forum Qt Programming
    Replies: 0
    Last Post: 25th November 2011, 05:50
  4. "Render" Qt dialog window from ".ui" file
    By BitEater in forum Qt Programming
    Replies: 1
    Last Post: 8th July 2011, 14:40
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.