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


Python MainWindow.raise_方法代码示例

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


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

示例1: main

# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import raise_ [as 别名]
def main(argv):

    # load plugins
    if os.path.exists(PLUGIN_FILE):
        imp.load_source('hmtk.plugin', PLUGIN_FILE)

    # create Qt application

    # Claim to be QGIS2 so that used plugins that tries to access
    # QSettings will get the QGIS2 settings
    QtGui.QApplication.setApplicationName('QGIS2')
    QtGui.QApplication.setOrganizationDomain('qgis.org')

    if QtCore.QSettings().value('locale/userLocale') is None:
        QtGui.QApplication.setOrganizationDomain('QGIS')

    app = QtGui.QApplication(argv, True)

    # setup QGIS
    QgsApplication.setPrefixPath(os.environ['QGIS_PREFIX_PATH'], True)
    QgsApplication.initQgis()

    # Install a custom exception hook that prints exception into a
    # MessageBox
    sys.excepthook = excepthook

    # create main window
    wnd = MainWindow()  # classname
    wnd.show()

    if sys.platform == "darwin":
        wnd.raise_()

    if len(argv) > 1:
        wnd.change_model(CatalogueModel.from_csv_file(argv[1]))

        if len(argv) > 2:
            wnd.load_fault_source(argv[2])
    else:
        wnd.load_catalogue()

    # Connect signal for app finish
    def on_quit():
        QgsApplication.exitQgis()
        app.quit()

    app.lastWindowClosed.connect(on_quit)

    # Start the app up
    ret = app.exec_()

    sys.exit(ret)
开发者ID:gem,项目名称:qt-experiments,代码行数:54,代码来源:main.py

示例2: about_to_quit

# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import raise_ [as 别名]
def about_to_quit():
    main.model.dump()
    #main.engine_controller.stop_engine()
    #main.engine_controller.thread.exit()


# set app icon
app_icon = QIcon()
app_icon.addFile('res/icons_taskbar/icon16.png', QSize(16,16))
app_icon.addFile('res/icons_taskbar/icon24.png', QSize(24,24))
app_icon.addFile('res/icons_taskbar/icon32.png', QSize(32,32))
app_icon.addFile('res/icons/taskbar/icon48.png', QSize(48,48))
app_icon.addFile('res/icons_taskbar/icon256.png',QSize(256,256))
app.setWindowIcon(app_icon)

app.setActiveWindow(main)
app.aboutToQuit.connect(about_to_quit) # myExitHandler is a callable


#main.setFocus()

# raise is only needed on osx due to
# a pyqt bug
# TODO: check os platform before calling
main.raise_()
main.show()
#splash.finish(main)


sys.exit(app.exec_())
开发者ID:jasiegel4,项目名称:jerry,代码行数:32,代码来源:jerry.py

示例3: main

# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import raise_ [as 别名]
def main():
    app = QtGui.QApplication(sys.argv)
    widget = MainWindow()
    widget.show()
    widget.raise_()
    sys.exit(app.exec_())
开发者ID:matthew-d-jones,项目名称:mantid-algorithm-use,代码行数:8,代码来源:algorithm_stats_viewer.py

示例4: MainWindow

# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import raise_ [as 别名]
import logging

# third party imports
from PySide import QtGui, QtCore

# local imports
from main_window import MainWindow

app = QtGui.QApplication([])

# Set up QSettings
app.setOrganizationName("Scott J Maddox")
app.setApplicationName("Plot Liberator")
settings = QtCore.QSettings()

# Set up logging
logging_level = settings.value("logging/level", logging.DEBUG)
logging.basicConfig(level=logging_level)

# Create main window
w = MainWindow()
w.show()
w.activateWindow()
w.raise_()

## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()
开发者ID:scott-maddox,项目名称:plotliberator,代码行数:32,代码来源:main.py


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