lowercase class names, eg., qtgui ? (PyQt4)

Discussion in 'Python' started by Glen, Apr 25, 2007.

  1. Glen

    Glen Guest

    Hello,

    In the file generated by pyuic4 from Designer's .ui file I noticed the use
    of lower case class names (I'm assuming these are the names of classes,
    not modules). For example:

    It imports thusly:

    from PyQt4 import QtGui

    then uses things like:
    self.gridlayout = qtgui.qgridlayout(dldialog)

    What exactly is going on here? Are these instances that are defined
    somewhere else (their not in the local scope.)? Can I do the same in my
    code when I import something?

    Thanks,

    Glen

    Glen
    Glen, Apr 25, 2007
    #1
    1. Advertising

  2. Glen

    Tina I Guest

    Glen wrote:
    > Hello,
    >
    > In the file generated by pyuic4 from Designer's .ui file I noticed the use
    > of lower case class names (I'm assuming these are the names of classes,
    > not modules). For example:
    >
    > It imports thusly:
    >
    > from PyQt4 import QtGui
    >
    > then uses things like:
    > self.gridlayout = qtgui.qgridlayout(dldialog)
    >
    > What exactly is going on here? Are these instances that are defined
    > somewhere else (their not in the local scope.)? Can I do the same in my
    > code when I import something?
    >
    > Thanks,
    >
    > Glen
    >
    > Glen
    >

    Hi,

    Are you sure? That's strange. I have never seen that. Here is a snippet
    of one of my typical .py files generated by 'pyuic4':

    self.gridlayout = QtGui.QGridLayout(self.centralwidget)
    self.gridlayout.setMargin(9)
    self.gridlayout.setSpacing(6)
    self.gridlayout.setObjectName("gridlayout")

    self.hboxlayout = QtGui.QHBoxLayout()
    self.hboxlayout.setMargin(0)
    self.hboxlayout.setSpacing(6)
    self.hboxlayout.setObjectName("hboxlayout")

    self.hboxlayout1 = QtGui.QHBoxLayout()
    self.hboxlayout1.setMargin(0)
    self.hboxlayout1.setSpacing(6)
    self.hboxlayout1.setObjectName("hboxlayout1")

    Upper case all the way...

    Tina
    Tina I, Apr 26, 2007
    #2
    1. Advertising

  3. Glen

    Glen Guest

    On Thu, 26 Apr 2007 09:09:44 +0200, Tina I wrote:

    Hi Tina,

    Thanks for the reply. Of course, by now I've run pyuic4 again on my .ui
    file and things are back to normal. Believe it or not, my example was a
    copy/paste directly from my .py file. Some strange anomoly, I guess.
    Everything's ok now. Maybe vim was just displaying the text wrong for a
    minute. Had me going though.

    Thanks again.

    Glen

    > Are you sure? That's strange. I have never seen that. Here is a

    snippet
    > of one of my typical .py files generated by 'pyuic4':
    >
    > self.gridlayout = QtGui.QGridLayout(self.centralwidget)
    > self.gridlayout.setMargin(9)
    > self.gridlayout.setSpacing(6)
    > self.gridlayout.setObjectName("gridlayout")
    >
    > self.hboxlayout = QtGui.QHBoxLayout() self.hboxlayout.setMargin(0)
    > self.hboxlayout.setSpacing(6)
    > self.hboxlayout.setObjectName("hboxlayout")
    >
    > self.hboxlayout1 = QtGui.QHBoxLayout() self.hboxlayout1.setMargin(0)
    > self.hboxlayout1.setSpacing(6)
    > self.hboxlayout1.setObjectName("hboxlayout1")
    >
    > Upper case all the way...
    >
    > Tina
    Glen, Apr 26, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. stef mientki
    Replies:
    2
    Views:
    426
    Rob Wolfe
    Sep 14, 2007
  2. Guest
    Replies:
    0
    Views:
    736
    Guest
    Sep 18, 2007
  3. wgw
    Replies:
    1
    Views:
    461
  4. ÊØÖê´ýÍÃ

    ImportError: No module named PyQt4.QtGui

    ÊØÖê´ýÍÃ, Aug 4, 2011, in forum: Python
    Replies:
    0
    Views:
    463
    ÊØÖê´ýÍÃ
    Aug 4, 2011
  5. Thomas Jollans

    Re: ImportError: No module named PyQt4.QtGui

    Thomas Jollans, Aug 4, 2011, in forum: Python
    Replies:
    0
    Views:
    901
    Thomas Jollans
    Aug 4, 2011
Loading...

Share This Page