[PyKDE] KTMainWindow.memberList ?

Boudewijn Rempt boud at rempt.xs4all.nl
Sat Oct 16 09:16:21 BST 1999


Dear people,

I'm busy translating the framework KDevelop generates into Python.
I really want to get the multiple document working, but I'm running
into a bit of trouble with the function:

void KuraApp::slotFileQuit()
{
  saveOptions();
  // close the first window, the list makes the next one the first
  // again.
  // This ensures that queryClose() is called on each window to ask for
  // closing
  KTMainWindow* w;
  if(memberList){
    for(w=memberList->first(); w; w=memberList->first()){
      // only close the window if the closeEvent is accepted. If the
      // user presses Cancel on the saveModified() dialog,
      // the window and the application stay open.
      if(!w->close())
        break;
    }
  } 
}

This I translate as:

  def slotFileQuit(self):
    self.saveOptions()
    # close the first window, the list makes the next one the first
    # again.
    # This ensures that queryClose() is called on each window to ask
    # for closing
    for win in self.memberList:
      # only close the window if the closeEvent is accepted. If the
      # user presses Cancel on the saveModified() dialog,
      # the window and the application stay open.
      if win.close()==FALSE:
        return


However, it appearst that the KTMainWindow class in Python doesn't
have the memberList variable - it's not mentioned in the KDUI
documentation, but appears in the header files:

public:

  /**
   * List of members of KTMainWindow class
   */
  static QList<KTMainWindow>* memberList;


Is this merely an omission in PyKDE or am I doing something silly?

Also, is there anyone who has gotten the KConfig.readListEntry to
work? Translating _config->readListEntry("Recent Files",recent_files)_
into _self.config.readListEntry("Recent Files",self.recent_files)_
doesn't work either.

Oh, and Phil, can you put KAccel in the next version?

Boudewijn Rempt  | http://www.xs4all.nl/~bsarempt





More information about the PyQt mailing list