Exemple #1
0
 def render( self ):
     """create the text edit dialog. this method is used to unit test
     the action step."""
     dialog = StandaloneWizardPage( self.window_title )
     dialog.set_default_buttons()
     main_widget = dialog.main_widget()
     layout = QtGui.QHBoxLayout()
     editor = RichTextEditor()
     editor.set_document( self.document )
     layout.addWidget( editor )
     main_widget.setLayout( layout )
     resize_widget_to_screen( dialog )
     return dialog
 def render( self, gui_context ):
     """create the print preview widget. this method is used to unit test
     the action step."""
     self.config_printer()
     gui_context = gui_context.copy( DocumentActionGuiContext )
     gui_context.document = self.document
     dialog = PrintPreviewDialog( self.printer, 
                                  gui_context, 
                                  actions = [EditDocument()],
                                  flags = QtCore.Qt.Window )
     # show maximized seems to trigger a bug in qt which scrolls the page 
     # down dialog.showMaximized()
     resize_widget_to_screen( dialog )
     return dialog
 def render( self, gui_context ):
     """create the print preview widget. this method is used to unit test
     the action step."""
     self.config_printer()
     gui_context = gui_context.copy( DocumentActionGuiContext )
     gui_context.document = self.document
     from camelot.admin.action.document import EditDocument
     dialog = PrintPreviewDialog( self.printer, 
                                  gui_context, 
                                  actions = [EditDocument()],
                                  flags = QtCore.Qt.Window )
     # show maximized seems to trigger a bug in qt which scrolls the page 
     # down dialog.showMaximized()
     resize_widget_to_screen( dialog )
     return dialog
Exemple #4
0
 def render( self ):
     """create the text edit dialog. this method is used to unit test
     the action step."""
     dialog = StandaloneWizardPage( self.window_title )
     dialog.set_default_buttons( reject = None )
     dialog.set_banner_title( self.title )
     dialog.set_banner_subtitle( self.subtitle )
     main_widget = dialog.main_widget()
     layout = QtGui.QHBoxLayout()
     editor = RichTextEditor()
     editor.set_document( self.document )
     editor.set_toolbar_hidden( False )
     layout.addWidget( editor )
     main_widget.setLayout( layout )
     resize_widget_to_screen( dialog )
     return dialog
Exemple #5
0
 def render( self ):
     """create the print preview widget. this method is used to unit test
     the action step."""
     if not self.printer:
         self.printer = QtGui.QPrinter()
     if not self.printer.isValid():
         self.printer.setOutputFormat( QtGui.QPrinter.PdfFormat )
     if self.page_size != None:
         self.printer.setPageSize( self.page_size )
     if self.page_orientation != None:
         self.printer.setOrientation( self.page_orientation )
     dialog = QtGui.QPrintPreviewDialog( self.printer, flags=QtCore.Qt.Window )
     dialog.paintRequested.connect( self.paint_on_printer )
     # show maximized seems to trigger a bug in qt which scrolls the page 
     # down dialog.showMaximized()
     resize_widget_to_screen( dialog )
     return dialog