当前位置: 首页>>代码示例>>Python>>正文


Python Main.show方法代码示例

本文整理汇总了Python中main.Main.show方法的典型用法代码示例。如果您正苦于以下问题:Python Main.show方法的具体用法?Python Main.show怎么用?Python Main.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在main.Main的用法示例。


在下文中一共展示了Main.show方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from main import Main [as 别名]
# 或者: from main.Main import show [as 别名]
def main():

    def update_splash(text):
        splash.showMessage(text)
        app.processEvents()

    app = QtGui.QApplication(sys.argv)
    splash_img = QtGui.QPixmap(':images/splash.png')
    splash = QtGui.QSplashScreen(splash_img, QtCore.Qt.WindowStaysOnTopHint)
    splash.show()
    time.sleep(.001)
    update_splash("Establishing Connection...")
    if not dbConnection.default_connection():
        QtGui.QMessageBox.critical(None, "No Connection!", "The database connection could not be established.")
        sys.exit(1)
    update_splash("Loading GUI...")
    myapp = Main()
    myapp.tab_loaded.connect(update_splash)
    myapp.setWindowIcon(QtGui.QIcon(':images/post_laser_schedule.ico'))
    myapp.show()
    update_splash("GUI Loaded...")
    myapp.load_tabs()
    update_splash("Loading Actions...")
    myapp.load_actions()
    splash.finish(myapp)
    sys.exit(app.exec_())
开发者ID:Doyle-MFG,项目名称:post_laser_schedule,代码行数:28,代码来源:__init__.py

示例2: colors

# 需要导入模块: from main import Main [as 别名]
# 或者: from main.Main import show [as 别名]
from reportlab.pdfbase import _fontdata_widths_helvetica
from reportlab.pdfbase import _fontdata_widths_helveticabold
from reportlab.pdfbase import _fontdata_widths_helveticaoblique
from reportlab.pdfbase import _fontdata_widths_helveticaboldoblique
from reportlab.pdfbase import _fontdata_widths_timesroman
from reportlab.pdfbase import _fontdata_widths_timesbold
from reportlab.pdfbase import _fontdata_widths_timesitalic
from reportlab.pdfbase import _fontdata_widths_timesbolditalic
from reportlab.pdfbase import _fontdata_widths_symbol
from reportlab.pdfbase import _fontdata_widths_zapfdingbats
from reportlab.pdfbase import _fontdata_enc_winansi
from reportlab.pdfbase import _fontdata_enc_macroman
from reportlab.pdfbase import _fontdata_enc_standard
from reportlab.pdfbase import _fontdata_enc_symbol
from reportlab.pdfbase import _fontdata_enc_zapfdingbats
from reportlab.pdfbase import _fontdata_enc_pdfdoc
from reportlab.pdfbase import _fontdata_enc_macexpert


#Colors
def colors():
    return

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    if not dbConnection.default_connection():
        sys.exit(1)
    myapp = Main()
    myapp.show()
    sys.exit(app.exec_())
开发者ID:Doyle-MFG,项目名称:laser_manager,代码行数:32,代码来源:__init__.py

示例3: Main

# 需要导入模块: from main import Main [as 别名]
# 或者: from main.Main import show [as 别名]
__author__ = 'ryan'

import sys
from PyQt4 import QtGui

from main import Main

import database_connection

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    if not database_connection.default_connection():
        sys.exit(1)
    sos = Main()
    sos.show()
    sys.exit(app.exec_())
开发者ID:xcrx,项目名称:fab_paperwork,代码行数:18,代码来源:__init__.py

示例4: Main2

# 需要导入模块: from main import Main [as 别名]
# 或者: from main.Main import show [as 别名]
class Main2(QtGui.QMainWindow, Ui_MainWindow):

###########################    Initlization part    ###########################
    def __init__(self, foldername = None):
        '''
        Initialization of main window
        '''
        #Initiate main window
        super(Main2, self).__init__()
        self.setupUi(self)
        self.isDirectlyClose = False
        self.initGui()
        self.text_edit = None
        
        
    def initGui(self):
        self.initQuitButton()
        self.initSelectDirectory()
        self.initColumnView()
        self.initImportButton()
        self.initOpenButton()
        
        
    def close (self):
        for childQWidget in self.findChildren(QtGui.QWidget):
            childQWidget.close()
        self.isDirectlyClose = True
        return QtGui.QMainWindow.close(self)

    def closeEvent (self, eventQCloseEvent):
        if self.isDirectlyClose:
            eventQCloseEvent.accept()
        else:
            answer = QtGui.QMessageBox.question (
                self,
                'Quit',
                'Are you sure you want to quit ?',
                QtGui.QMessageBox.Yes,
                QtGui.QMessageBox.No)
            if (answer == QtGui.QMessageBox.Yes) or (self.isDirectlyClose == True):
                eventQCloseEvent.accept()
            else:
                eventQCloseEvent.ignore()

############# Init different push button
              
    # Quit button                
    def initQuitButton(self):
        self.quitButton.clicked.connect(QtGui.qApp.quit)
                
    # Select direcory button           
    def initSelectDirectory(self):
        self.selectDirectory.clicked.connect(self.chooseDirectory)
        
    def initOpenButton(self):
        self.openScan.clicked.connect(self.openScanWindow)
        
    def chooseDirectory(self):
        self.foldername = str(QtGui.QFileDialog.getExistingDirectory(
                              self, 'Select folder'))
                              
        self.labelDirectory.setText(self.foldername)
        
        root = self.fileSystemModel.setRootPath(self.foldername)
        self.treeView.setRootIndex(root)
        
        
    def initColumnView(self):
        self.treeView = QtGui.QColumnView()
        self.fileSystemModel = QtGui.QFileSystemModel(self.treeView)
        self.fileSystemModel.setReadOnly(False)
        self.fileSystemModel.setFilter(QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot | QtCore.QDir.AllEntries)
        root = self.fileSystemModel.setRootPath("/")
        self.treeView.setModel(self.fileSystemModel)
        self.treeView.setRootIndex(root)
        
        self.scanExplorer.addWidget(self.treeView)
        
    def readText(self):
        if self.text_edit:
            self.scanInfo.removeWidget(self.text_edit)
        
        index = self.treeView.currentIndex()
        self.scanfolder = self.fileSystemModel.filePath(index)
        file = self.scanfolder + "/info_scan.txt"
        
        self.text_edit = QtGui.QPlainTextEdit()
        text = open(file).read()
        self.text_edit.setPlainText(text)
        self.scanInfo.addWidget(self.text_edit)
        
    def initImportButton(self):
        self.importButton.clicked.connect(self.readText)


    def openScanWindow(self):
        self.scanwindow = Main(self.scanfolder)
        self.scanwindow.show()
开发者ID:pertoty,项目名称:Geneva_analysis,代码行数:100,代码来源:openproject.py

示例5: QApplication

# 需要导入模块: from main import Main [as 别名]
# 或者: from main.Main import show [as 别名]
#!/usr/bin/python

import sys
from PyQt4.QtGui import QApplication
from main import Main

if __name__ == '__main__':
    app = QApplication(sys.argv)
    main = Main()

    main.show()
    sys.exit(app.exec_())

开发者ID:Naroko,项目名称:xia-core,代码行数:14,代码来源:launch.py


注:本文中的main.Main.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。