def firstPage(self): for i in range( self.mainLayout.count() ): item = self.mainLayout.itemAt(0) item.widget().setParent( None ) title = QLabel( "<p style='color:rgb( 137,129,120 )'>Welcome to the PingoTools Installer</p>" ) title.setFixedHeight( 50 ) titleFont = QFont() titleFont.setPixelSize( 18 ) titleFont.setBold( True ) titleFont.setFamily( "Helvetica [Cronyx]" ) title.setAlignment( QtCore.Qt.AlignCenter ) title.setFont( titleFont ) description = QLabel() description.setAlignment( QtCore.Qt.AlignCenter ) buttonsWidget = QWidget(); buttonsWidget.setMaximumHeight( 50 ) buttonsLayout = QHBoxLayout( buttonsWidget ) emptyArea = QLabel() buttonNext = QPushButton( 'Next > ' ) buttonCancel = QPushButton( 'Cancel' ) buttonsLayout.addWidget( emptyArea ) buttonsLayout.addWidget( buttonNext ); buttonNext.setFixedWidth( 100 ) buttonsLayout.addWidget( buttonCancel ); buttonCancel.setFixedWidth( 100 ) self.mainLayout.addWidget( title ) self.mainLayout.addWidget( description ) self.mainLayout.addWidget( buttonsWidget ) origWidth = 500 frontImage = QImage() frontImage.load( os.path.dirname( __file__ ) + '/images/pingoTools_main.jpg' ) trValue = QTransform().scale( float(origWidth)/frontImage.width(), float(origWidth)/frontImage.width() ) transformedImage = frontImage.transformed( trValue ) pixmap = QPixmap.fromImage( transformedImage ) description.setPixmap( pixmap ) description.setGeometry( 0,0, transformedImage.width() , transformedImage.height() ) description.paintEvent(QPaintEvent(QtCore.QRect( 0,0,self.width(), self.height() ))) QtCore.QObject.connect( buttonNext, QtCore.SIGNAL( 'clicked()' ), self.secondPage ) QtCore.QObject.connect( buttonCancel, QtCore.SIGNAL( 'clicked()' ), self.cmd_cancel )
def secondPage(self): for i in range( self.mainLayout.count() ): item = self.mainLayout.itemAt(0) item.widget().setParent( None ) title = QLabel( "설치할 플러그인을 선택하십시오.".decode( 'utf-8' ) ) title.setFixedHeight( 50 ) listWidget = QListWidget() listWidget.setFixedHeight( 273 ) widgetItem_for2015 = QListWidgetItem("PingoTools for Maya2015", listWidget ) widgetItem_for2016 = QListWidgetItem("PingoTools for Maya2016", listWidget ) widgetItem_for2017 = QListWidgetItem("PingoTools for Maya2017", listWidget ) widgetItem_for2015.setCheckState( QtCore.Qt.Checked ) widgetItem_for2016.setCheckState( QtCore.Qt.Checked ) widgetItem_for2017.setCheckState( QtCore.Qt.Checked ) #widgetItem_for2015.setFlags( not QtCore.Qt.ItemIsSelectable ) buttonsWidget = QWidget(); buttonsWidget.setMaximumHeight( 50 ) buttonsLayout = QHBoxLayout( buttonsWidget ) emptyArea = QLabel() buttonBack = QPushButton( 'Back < ' ) buttonNext = QPushButton( 'Install' ) buttonCancel = QPushButton( 'Cancel' ) buttonsLayout.addWidget( emptyArea ) buttonsLayout.addWidget( buttonBack ); buttonBack.setFixedWidth( 100 ) buttonsLayout.addWidget( buttonNext ); buttonNext.setFixedWidth( 100 ) buttonsLayout.addWidget( buttonCancel ); buttonCancel.setFixedWidth( 100 ) self.mainLayout.addWidget( title ) self.mainLayout.addWidget( listWidget ) self.mainLayout.addWidget( buttonsWidget ) QtCore.QObject.connect( buttonBack, QtCore.SIGNAL( 'clicked()' ), self.firstPage ) QtCore.QObject.connect( buttonNext, QtCore.SIGNAL( 'clicked()' ), self.lastPage ) QtCore.QObject.connect( buttonCancel, QtCore.SIGNAL( 'clicked()' ), self.cmd_cancel )
def lastPage(self): for i in range( self.mainLayout.count() ): item = self.mainLayout.itemAt(0) item.widget().setParent( None ) title = QLabel( "".decode( 'utf-8' ) ) title.setFixedHeight( 50 ) description = QLabel( "<p style='line-height:150%';'><b>PingoTools</b> 인스톨이 완료되었습니다.<p>".decode( 'utf-8' ) ) description.setAlignment( QtCore.Qt.AlignCenter ) buttonsWidget = QWidget(); buttonsWidget.setMaximumHeight( 50 ) buttonsLayout = QHBoxLayout( buttonsWidget ) emptyArea = QLabel() buttonClose = QPushButton( 'Close' ); buttonClose.setFixedWidth( 100 ) buttonsLayout.addWidget( emptyArea ) buttonsLayout.addWidget( buttonClose ) self.mainLayout.addWidget( title ) self.mainLayout.addWidget( description ) self.mainLayout.addWidget( buttonsWidget ) QtCore.QObject.connect( buttonClose, QtCore.SIGNAL( 'clicked()' ), self.cmd_close )
def createElements(self): """ Creates the widgets and docks of which the main window is composed. """ self.mainWindow = QMainWindow() projectController = ProjectController.Instance() self.transformTool = None # Render widgets self.fixedDataWidget = RenderWidget() self.movingDataWidget = RenderWidget() self.multiDataWidget = MultiRenderWidget() self.fixedRenderController = RenderController(self.fixedDataWidget, "fixed") self.movingRenderController = RenderController(self.movingDataWidget, "moving") self.multiRenderController = MultiRenderController( self.multiDataWidget) # Give references of the render controllers to the project controller projectController.fixedRenderController = self.fixedRenderController projectController.movingRenderController = self.movingRenderController projectController.multiRenderController = self.multiRenderController # Render properties widgets sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(1) self.fixedPropWidget = RenderPropWidget(self.fixedRenderController, parent=self) self.fixedPropWidget.setSizePolicy(sizePolicy) self.fixedPropWidget.setFileChangedSignal( projectController.fixedFileChanged) self.fixedPropWidget.setLoadDataSlot(self.loadFixedDataSetFile) self.movingPropWidget = RenderPropWidget(self.movingRenderController, parent=self) self.movingPropWidget.setSizePolicy(sizePolicy) self.movingPropWidget.setFileChangedSignal( projectController.movingFileChanged) self.movingPropWidget.setLoadDataSlot(self.loadMovingDataSetFile) self.multiPropWidget = MultiRenderPropWidget( self.multiRenderController, parent=self) self.multiPropWidget.setSizePolicy(sizePolicy) self.verticalSplitter = QSplitter() self.verticalSplitter.setOrientation(Qt.Vertical) # Create the layouts fixedDataTitleWidget = TitleWidget("Fixed volume") multiDataTitleWidget = TitleWidget("Fixed + Moving") movingDataTitleWidget = TitleWidget("Moving volume") fixedLayout = QGridLayout() fixedLayout.setSpacing(0) fixedLayout.setContentsMargins(0, 0, 0, 0) fixedLayout.addWidget(fixedDataTitleWidget) fixedLayout.addWidget(self.fixedDataWidget) fixedWidget = QWidget() fixedWidget.setLayout(fixedLayout) multiLayout = QGridLayout() multiLayout.setSpacing(0) multiLayout.setContentsMargins(0, 0, 0, 0) multiLayout.addWidget(multiDataTitleWidget) multiLayout.addWidget(self.multiDataWidget) multiWidget = QWidget() multiWidget.setLayout(multiLayout) movingLayout = QGridLayout() movingLayout.setSpacing(0) movingLayout.setContentsMargins(0, 0, 0, 0) movingLayout.addWidget(movingDataTitleWidget) movingLayout.addWidget(self.movingDataWidget) movingWidget = QWidget() movingWidget.setLayout(movingLayout) horizontalSplitter = QSplitter() horizontalSplitter.setOrientation(Qt.Horizontal) horizontalSplitter.addWidget(fixedWidget) horizontalSplitter.addWidget(multiWidget) horizontalSplitter.addWidget(movingWidget) propsLayout = QHBoxLayout() propsLayout.setSpacing(1) propsLayout.setContentsMargins(0, 0, 0, 0) propsLayout.addWidget(self.fixedPropWidget) propsLayout.addWidget(self.multiPropWidget) propsLayout.addWidget(self.movingPropWidget) propsWidget = QWidget() propsWidget.setMinimumHeight(245) propsWidget.setMaximumHeight(350) propsWidget.setLayout(propsLayout) self.verticalSplitter.addWidget(horizontalSplitter) self.verticalSplitter.addWidget(propsWidget) self.verticalSplitter.setStretchFactor(0, 2) self.verticalSplitter.setStretchFactor(1, 1) self.setCentralWidget(self.verticalSplitter)