def createGui(self, parentWindow):
        '''
    Gui comprises a formation (a structured model) and a dialog(sic) that controls it.
    The dialog is a View.  View displays the model and controls it.
    One way: user is the only one controlling the model (not any other business logic.)
    After editing formation, it is reflected (converted) to StylingActs.
    The edited formation (or at least the contents) is then discarded.
    
    Formerly, this was created on the fly then discarded, over and over.
    
    Note the gui may be QWidget based, or QML based.
    For QML, we create the gui early so that we can expose the model to it.
    '''
        self.editedFormation = self.getFormation(
            newAllSelector())  # Temporary: previous is garbage collected.
        assert self.editedFormation is not None

        # parentWindow is document so dialog centers in document.
        # If parentWindow were mainWindow (toplevel), Qt not center dialog
        self.dialog = dialogFactory.produceEditableDialog(
            parentWindow=parentWindow,
            formation=self.editedFormation,
            titleParts=(self.name, "Style Sheet"))
        # WAS flags=Qt.Sheet)
        # but that is not needed if open() which is window modal
        self.dialog.connectSignals(acceptSlot=self.acceptEdit,
                                   cancelSlot=self.cancelEdit)
Esempio n. 2
0
 def createGui(self, parentWindow, titleParts):
   '''
   Compare to IntermediateStyleSheet.
   '''
   self.editedFormation = self.formation()   # New copy
   assert self.editedFormation is not None
   '''
   Parent to app's activeWindow.
   FUTURE, if a document element is its own window, parent to it?
   Or position the dialog closer to the document element.
   '''
   self.dialog = dialogFactory.produceEditableDialog(parentWindow = parentWindow,
                                     formation=self.editedFormation, 
                                     titleParts = titleParts)
                                     # WAS flags=Qt.Sheet)
                                     # but that is not needed if open() which is window modal
   self.dialog.connectSignals(acceptSlot=self.accept, 
                              cancelSlot=self.cancel)
Esempio n. 3
0
 def createGui(self, parentWindow, titleParts):
     '''
 Compare to IntermediateStyleSheet.
 '''
     self.editedFormation = self.formation()  # New copy
     assert self.editedFormation is not None
     '''
 Parent to app's activeWindow.
 FUTURE, if a document element is its own window, parent to it?
 Or position the dialog closer to the document element.
 '''
     self.dialog = dialogFactory.produceEditableDialog(
         parentWindow=parentWindow,
         formation=self.editedFormation,
         titleParts=titleParts)
     # WAS flags=Qt.Sheet)
     # but that is not needed if open() which is window modal
     self.dialog.connectSignals(acceptSlot=self.accept,
                                cancelSlot=self.cancel)
 def createGui(self, parentWindow):
   '''
   Gui comprises a formation (a structured model) and a dialog(sic) that controls it.
   The dialog is a View.  View displays the model and controls it.
   One way: user is the only one controlling the model (not any other business logic.)
   After editing formation, it is reflected (converted) to StylingActs.
   The edited formation (or at least the contents) is then discarded.
   
   Formerly, this was created on the fly then discarded, over and over.
   
   Note the gui may be QWidget based, or QML based.
   For QML, we create the gui early so that we can expose the model to it.
   '''
   self.editedFormation = self.getFormation(newAllSelector())  # Temporary: previous is garbage collected.
   assert self.editedFormation is not None
   
   # parentWindow is document so dialog centers in document.  
   # If parentWindow were mainWindow (toplevel), Qt not center dialog
   self.dialog = dialogFactory.produceEditableDialog(parentWindow = parentWindow,
                                     formation=self.editedFormation, 
                                     titleParts = (self.name, "Style Sheet"))
                                     # WAS flags=Qt.Sheet)
                                     # but that is not needed if open() which is window modal
   self.dialog.connectSignals(acceptSlot=self.acceptEdit, cancelSlot=self.cancelEdit)