示例#1
0
	def __init__(self, options, mapfile, *args, **kwargs):
		Editor.editor = self

		self._filemanager = None

		self._options = options
		self._mapfile = mapfile
		self._eventlistener = None
		self._pluginmanager = None

		self._inited = False

		self._mapview = None
		self._mapviewlist = []
		self._mapgroup = None
		self._mapbar = None
		self._maparea = None
		self._mapeditor = None

		self._file_menu = None
		self._edit_menu = None
		self._view_menu = None
		self._tools_menu = None
		self._help_menu = None

		self._change_map = -1

		self._settings = TDS

		self._lighting_mode = int(TDS.get("FIFE", "Lighting"))
		self._help_dialog = None

		ApplicationBase.__init__(self, TDS, *args, **kwargs)
		MainWindow.__init__(self, *args, **kwargs)
示例#2
0
    def __init__(self, models):
        self.managers = models

        app = QtGui.QApplication(sys.argv)
        window = MainWindow( self , self.managers)
        window.show()
        sys.exit(app.exec_())
示例#3
0
文件: editor.py 项目: m64/PEG
	def __init__(self, params, *args, **kwargs):
		Editor.editor = self
	
		self._filemanager = None
		self._open_files = []
	
		self._params = params
		self._eventlistener = None
		self._pluginmanager = None
		
		self._inited = False
		
		self._mapview = None
		self._mapviewlist = []
		self._mapgroup = None
		self._mapbar = None
		self._maparea = None
		self._mapeditor = None
		
		self._file_menu = None
		self._edit_menu = None
		self._view_menu = None
		self._tools_menu = None
		self._help_menu = None
		
		self._settings = None
		
		self._help_dialog = None
	
		ApplicationBase.__init__(self, *args, **kwargs)
		MainWindow.__init__(self, *args, **kwargs)
		pychan.init(self.engine, debug=False)
示例#4
0
文件: main.py 项目: BloatIt/bloatit
 def start_gui(self):
     
     app = QtGui.QApplication(sys.argv)
 
     main_window = MainWindow()
     main_window.show()
     
     main_window.load(Member.objects)
     
     sys.exit(app.exec_())
示例#5
0
文件: __init__.py 项目: nsmgr8/qtbe
def main():
    """Main entry to run the app"""
    import sys
    from PySide.QtGui import QApplication
    from gui.mainwindow import MainWindow

    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()

    return app.exec_()
示例#6
0
	def show_gui(self):
		from PyQt4 import QtCore, QtGui
		from gui.mainwindow import MainWindow

		QtCore.QCoreApplication.setOrganizationName('Rhoket Scientists');
		QtCore.QCoreApplication.setOrganizationDomain('');
		QtCore.QCoreApplication.setApplicationName('Vegetation Analyzer');

		app = QtGui.QApplication(sys.argv)
		window = MainWindow(args = self.args)
		#window.setWindowState(QtCore.Qt.WindowMaximized)
		window.show()
		window.raise_()
		return app.exec_()
示例#7
0
	def _initGui(self):
		""" Sets up the GUI """
		screen_width = self.engine.getSettings().getScreenWidth()
		screen_height = self.engine.getSettings().getScreenHeight()
		MainWindow.initGui(self, screen_width, screen_height)

		self._toolbox = ToolBar(title=u"", orientation=1)
		self._toolbox.position_technique = "explicit"
		self._toolbox.position = (150, 150)

		self._mapbar = ToolBar(name="MapBar", panel_size=20)
		self._mapbar.setDocked(True)

		self._maparea = pychan.widgets.VBox()
		self._maparea.opaque = False
		self._maparea.is_focusable = True

		# Capture mouse and key events for EventListener
		cw = self._maparea
		cw.capture(self.__sendMouseEvent, "mouseEntered")
		cw.capture(self.__sendMouseEvent, "mouseExited")
		cw.capture(self.__sendMouseEvent, "mousePressed")
		cw.capture(self.__sendMouseEvent, "mouseReleased")
		cw.capture(self.__sendMouseEvent, "mouseClicked")
		cw.capture(self.__sendMouseEvent, "mouseMoved")
		cw.capture(self.__sendMouseEvent, "mouseWheelMovedUp")
		cw.capture(self.__sendMouseEvent, "mouseWheelMovedDown")
		cw.capture(self.__sendMouseEvent, "mouseDragged")
		cw.capture(self.__sendKeyEvent, "keyPressed")
		cw.capture(self.__sendKeyEvent, "keyReleased")

		self._centralwidget.addChild(self._mapbar)
		self._centralwidget.addChild(self._maparea)

		self._initActions()

		self._toolbox.show()

		events.preMapClosed.connect(self._mapRemoved)
示例#8
0
    def _initGui(self):
        """ Sets up the GUI """
        screen_width = self.engine.getSettings().getScreenWidth()
        screen_height = self.engine.getSettings().getScreenHeight()
        MainWindow.initGui(self, screen_width, screen_height)

        self._toolbox = ToolBar(name="ToolBox", title=u"", orientation=1)
        self._toolbox.position_technique = "explicit"
        self._toolbox.position = (150, 150)

        self._mapbar = ToolBar(name="MapBar", panel_size=20)
        self._mapbar.setDocked(True)

        self._maparea = pychan.widgets.VBox()
        self._maparea.opaque = False
        self._maparea.is_focusable = True

        # Capture mouse and key events for EventListener
        cw = self._maparea
        cw.capture(self.__sendMouseEvent, "mouseEntered")
        cw.capture(self.__sendMouseEvent, "mouseExited")
        cw.capture(self.__sendMouseEvent, "mousePressed")
        cw.capture(self.__sendMouseEvent, "mouseReleased")
        cw.capture(self.__sendMouseEvent, "mouseClicked")
        cw.capture(self.__sendMouseEvent, "mouseMoved")
        cw.capture(self.__sendMouseEvent, "mouseWheelMovedUp")
        cw.capture(self.__sendMouseEvent, "mouseWheelMovedDown")
        cw.capture(self.__sendMouseEvent, "mouseDragged")
        cw.capture(self.__sendKeyEvent, "keyPressed")
        cw.capture(self.__sendKeyEvent, "keyReleased")

        self._centralwidget.addChild(self._mapbar)
        self._centralwidget.addChild(self._maparea)

        self._initActions()

        self._toolbox.show()

        events.preMapClosed.connect(self._mapRemoved)
示例#9
0
def main():
    app = QApplication(sys.argv)

    window = MainWindow()
    window.setMinimumSize(700, 700)
    window.show()  # IMPORTANT!!!!! Windows are hidden by default.

    # Start the event loop.
    app.exec_()
示例#10
0
文件: main.py 项目: mwinberg/bloatit
    def start_gui(self):

        app = QtGui.QApplication(sys.argv)

        main_window = MainWindow()
        main_window.show()

        main_window.load(Member.objects)

        sys.exit(app.exec_())
示例#11
0
    def show_gui(self):
        from PyQt4 import QtCore, QtGui
        from gui.mainwindow import MainWindow

        QtCore.QCoreApplication.setOrganizationName('Rhoket Scientists')
        QtCore.QCoreApplication.setOrganizationDomain('')
        QtCore.QCoreApplication.setApplicationName('Vegetation Analyzer')

        app = QtGui.QApplication(sys.argv)
        window = MainWindow(args=self.args)
        #window.setWindowState(QtCore.Qt.WindowMaximized)
        window.show()
        window.raise_()
        return app.exec_()
示例#12
0
##################################################################################
#
#  Shaderlink - A RenderMan Shader Authoring Toolkit
#  http://libe.ocracy.org/shaderlink.html
#  2010 Libero Spagnolini ([email protected])
#
##################################################################################

import sys

import resources.resources

from PyQt4 import QtGui, QtCore
from gui.mainwindow import MainWindow

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

    # used by QSettings to store in registry (windows) or home (linux)
    app.setOrganizationName('Libero')
    app.setOrganizationDomain('Spagnolini')
    app.setApplicationName("Shaderlink")
    app.setWindowIcon(QtGui.QIcon(':/shaderLink.png'))

    form = MainWindow()
    #form.resize(QtCore.QSize(1200, 900))
    form.showMaximized()
    form.show()
    sys.exit(app.exec_())
示例#13
0
# HumDep
humdep = HumDep(humgen, config, debug_logger, "HUMDEP")

# State
state = State(humgen, humdep, config, debug_logger, object_id="STATE")

# MaintenanceTools
maintenancetools = MaintenanceTools(valve1, valve2, pressure, pump, flowA,
                                    flowB, valve2x3, config)

########################################################################################################################
# WINDOWS
########################################################################################################################

app = QApplication(sys.argv)
main_window = MainWindow(state, temperature)
main_window_ui = main_window.get_main_ui()
pump_ui = main_window.get_pump_ui()
electrovalve_ui = main_window.get_electrovalve_ui()
flow_ui = main_window.get_flow_ui()
pressure_ui = main_window.get_pressure_ui()
valve2x3_ui = main_window.get_valve2x3_ui()
maintenancetools_ui = main_window.get_maintenancetools_ui()
temperature_ui = main_window.get_temperature_ui()
debuglog_ui = main_window.get_debuglog_window()
state_ui = main_window.get_state_window()

########################################################################################################################
# GUI MANAGERS
########################################################################################################################
示例#14
0
import sys
from PyQt5 import QtWidgets
import qdarkstyle

from core import prefs
from gui.mainwindow import MainWindow

if __name__ == "__main__":
    APP = QtWidgets.QApplication(sys.argv)
    if prefs.USE_DARK_THEME:
        APP.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
    else:
        APP.setStyle(prefs.LIGHT_THEME)
    WINDOW = MainWindow()
    WINDOW.show()
    sys.exit(APP.exec_())
示例#15
0
''' entrypoint '''

import sys
from fbs_runtime.application_context.PyQt5 import ApplicationContext
from PyQt5.QtWidgets import QMainWindow
from gui.mainwindow import MainWindow


if __name__ == '__main__':
    CONTEXT = ApplicationContext()
    WINDOW = QMainWindow()
    WINDOW.setCentralWidget(MainWindow())
    WINDOW.show()
    EXIT_CODE = CONTEXT.app.exec_()
    sys.exit(EXIT_CODE)
 def setup(self):
     self.app = QApplication(sys.argv)
     self.mw = MainWindow()
     self.mw.show()
示例#17
0
def main():
    # import all the UI classes:
    sys.path.insert(0,'.')
    sys.path.insert(0,'..') # würg
    from gui.mainwindow import MainWindow
    import gui.sxmrc
    
    # create main QT application:
    app = QApplication(sys.argv)
    splashpixmap = QPixmap(":/images/images/splash.png")
    splash = QSplashScreen(splashpixmap) #,QtCore.Qt.WindowStaysOnTopHint)
    splash.show()
    a = Qt.AlignBottom
    splash.showMessage("PySPA starting...",a)
    app.processEvents()
    app.setStyle(QStyleFactory.create("Windows"))
    app.setQuitOnLastWindowClosed(True)
    
    # install translator
    trans = QTranslator(app)
    trans.load(':lang/sxmlang_en.qm')
    app.installTranslator(trans)
    app.processEvents()
    modulestring = "Loading"
    modulestring += " SciPy"
    splash.showMessage(modulestring,a)
    app.processEvents()
    import scipy
    modulestring += " PIL"
    splash.showMessage(modulestring,a)
    app.processEvents()
    import Image
    modulestring += " format plugins"
    splash.showMessage(modulestring,a)
    app.processEvents()
    from SXM import SM3
    import SXM.FileIO
    SXM.FileIO.init()
    modulestring += "."
    splash.showMessage(modulestring,a)
    app.processEvents()
    from SXM import Data
    
    # create and show main window
    win = MainWindow(app)
    win.show()
        
    splash.finish(win)
    
    # testing: start a dummy worker thread
##    worker = DummyThread()
##    worker.start()
    
    # run application event loop
    app.exec_()
    
##    if not worker.isFinished():
##        print "Asking worker thread to finish."
##        worker.stop()
##        print "Waiting for worker thread to finish..."
##        worker.wait()
##    else:
##        print "Worker thread has already finished."
    
    sys.exit()
示例#18
0
# dope wars

from gui.mainwindow import MainWindow

if __name__ == "__main__":
    MainWindow()
示例#19
0
class Views :

    def __init__(self, models):
        self.managers = models

        app = QtGui.QApplication(sys.argv)
        self.window = MainWindow( self , self.managers)
        self.window.show()
        sys.exit(app.exec_())

    def instanceCliente(self):
        from model.cliente.gui import ClienteGUI
        self.cliente = ClienteGUI(self.managers.clientes, self.managers, parent=self.window)
        return self.cliente

    def instanceEmpleado(self):
        from model.empleado.gui import EmpleadoGUI
        self.empleado = EmpleadoGUI(self.managers.empleados, self.managers, parent=self.window)
        return self.empleado

    def instanceMaquina(self):
        from model.maquina.gui import MaquinaGUI
        self.maquina = MaquinaGUI(self.managers.maquinas, self.managers, parent=self.window)
        return self.maquina

    def instanceMateriaprima(self):
        from model.materiaprima.gui import MateriaprimaGUI
        self.materiaprima = MateriaprimaGUI(self.managers.materiasprimas, self.managers, parent=self.window)
        return self.materiaprima

    def instanceInsumo(self):
        from model.insumos.gui import InsumosGUI
        self.insumos = InsumosGUI(self.managers.insumos, self.managers, parent=self.window)
        return self.insumos

    def instanceProveedor(self):
        from model.proveedor.gui import ProveedorGUI
        self.proveedor = ProveedorGUI(self.managers.proveedores, self.managers, parent=self.window)
        return self.proveedor

    def instanceProducto(self):
        from model.productos.gui import ProductosGUI
        self.productos = ProductosGUI(self.managers.productos, self.managers, parent=self.window)
        return self.productos

    def instancePedidos(self):
        from model.pedidos.gui import PedidosGUI
        self.pedidos_gui = PedidosGUI(self.managers.pedidos, self.managers, parent=self.window)
        return self.pedidos_gui

    def instanceTurnos(self):
        from model.turno.gui import TurnoGUI
        self.turno_gui = TurnoGUI(self.managers.turno, self.managers, parent=self.window)
        return self.turno_gui

    def instanceMovimientos(self):
        from model.movimiento.libro_diario import LibroDiarioGUI
        self.movimientos = LibroDiarioGUI(self.managers.movimientos, managers = [CuentasGUI(self.managers.cuentas)])
        return self.movimientos

    def instanceSecciones(self):
        from model.seccion.secciones_categorias_gui import SeccionesCategoriasGUI
        self.secciones = SeccionesCategoriasGUI(self.managers.secciones, managers =
            [SeccionesGUI(self.managers.secciones, managers = [self.managers.cuentas]),
            CuentasGUI(self.managers.cuentas)])
        return self.secciones
示例#20
0
文件: main.py 项目: D3f0/txscada
def main(argv = sys.argv):
    ''' Funcion main '''
    app = QtGui.QApplication(argv)
    win = MainWindow()
    win.show()
    return app.exec_()
示例#21
0
def main():
    app = QApplication(sys.argv)
    window = MainWindow()
    sys.exit(app.exec_())
示例#22
0
文件: run.py 项目: brupelo/shaderlink
##################################################################################
#
#  Shaderlink - A RenderMan Shader Authoring Toolkit 
#  http://libe.ocracy.org/shaderlink.html
#  2010 Libero Spagnolini ([email protected])
#
##################################################################################

import sys

import resources.resources

from PyQt4 import QtGui, QtCore
from gui.mainwindow import MainWindow

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

    # used by QSettings to store in registry (windows) or home (linux)
    app.setOrganizationName('Libero')
    app.setOrganizationDomain('Spagnolini')
    app.setApplicationName("Shaderlink")
    app.setWindowIcon(QtGui.QIcon(':/shaderLink.png'))

    form = MainWindow()    
    #form.resize(QtCore.QSize(1200, 900))
    form.showMaximized()
    form.show()   
    sys.exit(app.exec_())
示例#23
0
from PySide.QtCore import QTranslator

from gui.mainwindow import MainWindow
import constants
import utils
import texts

if __name__ == '__main__':

    app = QApplication(sys.argv)

    translator = QTranslator()
    translator.load(constants.QM_PATH)
    app.installTranslator(translator)

    mainwindow = MainWindow()

    def excepthook(excType, excValue, tracebackobj):
        msg_box = utils.getCriticalMessageBox(texts.GENERAL_ERROR_TITLE,
                                              texts.GENERAL_ERROR_MSG)
        msg_box.exec_()
        app.exit()

    sys.excepthook = excepthook

    try:
        from data.indicators.aggregation_indicators import *
        load_aggregation_operators()
        mainwindow.showMaximized()
        app.exec_()
    except AggregationIndicatorsError:
示例#24
0
import sys
from PyQt5 import QtWidgets
from gui.mainwindow import MainWindow

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    win = MainWindow()
    win.showMaximized()
    app.exec_()
示例#25
0
import sys
from gui.mainwindow import MainWindow
from PyQt5.QtWidgets import QApplication

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = MainWindow()
    sys.exit(app.exec_())
示例#26
0
__version__ = '1.1.0'

from PyQt5.QtWidgets import *
from gui.messages import ErrorMessage
from gui.mainwindow import MainWindow
import sys
from basic.file.files import ExcelFile
from win32api import GetSystemMetrics

app = QApplication(sys.argv)
try:
    if int(sys.version[0]) != 3 and float(sys.version[:3]) < 3.6:
        raise Exception
except:
    errorMessage = ErrorMessage()
    errorMessage.setText(
        "<nobr>The version of Python must be 3.6 or higher.</nobr>")
    sys.exit(app.exec_())

ExcelFile.open_excel_app()
win = MainWindow()
win.resize(GetSystemMetrics(0) * 3 / 4.0, GetSystemMetrics(1) * 3 / 5.0)
win.show()
try:
    app.exec_()
except Exception as e:
    print(e)
finally:
    ExcelFile.close_excel_app()
示例#27
0
from PyQt5.QtWidgets import QApplication

from gui.mainwindow import MainWindow

INITIAL_CFG = 'config.ini'
USER_CFG = 'config.json'


def load_config():
    config = INITIAL_CFG

    if os.path.exists(USER_CFG):
        config = USER_CFG

    with open(config) as fp:
        config = json.load(fp)

    return config


if __name__ == '__main__':
    # Load config
    config = load_config()

    a = QApplication(sys.argv)
    w = MainWindow(config)
    w.show()

    a.exec()
示例#28
0
def main():

    app = QtWidgets.QApplication(sys.argv)
    main = MainWindow(paths.MAIN_CONFIG)
    main.show()
    sys.exit(app.exec_())
示例#29
0
import sys

from PyQt4.QtGui import QApplication
from gui.mainwindow import MainWindow

__author__ = 'ovol'

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

    w = MainWindow()
    w.show()

    app.exec_()
示例#30
0
from PyQt5 import QtWidgets
from gui.mainwindow import MainWindow

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    ui = MainWindow()
    ui.show()
    sys.exit(app.exec_())
示例#31
0
def main():
    cwd = Path.cwd()
    app = QApplication(sys.argv)
    window = MainWindow(app, cwd)
    window.show()
    sys.exit(app.exec_())
示例#32
0
import os
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox
from gui.mainwindow import MainWindow


def get_platforms_path():
    file_path = os.path.dirname(os.path.abspath(__file__))
    return os.path.join(file_path, 'venv', 'Lib', 'site-packages', 'PyQt5',
                        'Qt', 'plugins', 'platforms')


if __name__ == '__main__':
    os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = get_platforms_path()

    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()

    sys.exit(app.exec_())
示例#33
0
    if (c != old):
        dial_map[0].setValue(c.red())
        dial_map[1].setValue(c.green())
        dial_map[2].setValue(c.blue())


color_button = QPushButton("color")
color_button.clicked.connect(color_button_clicked)

group_leds.layout().addWidget(led_mode_combo, 3, 1)
group_leds.layout().addWidget(commit_led_button, 3, 2)
group_leds.layout().addWidget(color_button, 3, 0)

#dsp.refresh()

#timer = QtCore.QTimer()
#timer.setInterval(5000)
#timer.timeout.connect(timer_timeout)
#timer.start()

main_window = MainWindow()

#tx_worker.start()
main_window.show()
#GUI = Window()
QCoreApplication.setOrganizationName("Julian Schick")
QCoreApplication.setApplicationName("FlipUI")

app.exec_()
示例#34
0
class GUI:
    def __init__(self, root):
        self.root = root
        self.app = QApplication([])
        self.icons = {
            "timelapse": QIcon(resource_path('icons/timelapse.png')),
            "sync": QIcon(resource_path('icons/sync.png')),
            "sync_disabled": QIcon(resource_path('icons/sync_disabled.png')),
            "logo": QIcon(resource_path('icons/logo.png')),
            "settings": QIcon(resource_path('icons/settings.png')),
            "github": QIcon(resource_path('icons/github.png'))
        }

        self.main_window = MainWindow(self)
        self.offset_window = None
        self.settings_window = None
        self.messages = [[], []]
        self.section_labels = [
            self.main_window.ui.right_status,
            self.main_window.ui.right_status_2
        ]

        menu = QMenu('FS Time Sync')
        menu.setStyleSheet("""
        QMenu {
            background-color: #151515;
            color: #ffffff;
        }
        QMenu::item {
            padding: 5px 10px 5px 10px;
        }
        QMenu::item:selected {
            background-color: #ffffff;
            color: #151515;
        }
        """)
        self.tray_actions = {}
        self.tray_actions["sync_now"] = menu.addAction("Sync Now")
        self.tray_actions["sync_now"].triggered.connect(
            lambda: self.root.sync_sim(force=True))
        self.tray_actions["hide_show"] = menu.addAction("Hide")
        self.tray_actions["hide_show"].triggered.connect(self.hide)
        self.tray_actions["exit"] = menu.addAction("Exit")
        self.tray_actions["exit"].triggered.connect(self.exit)

        self.tray = QSystemTrayIcon()
        self.tray.setIcon(self.icons['logo'])
        self.tray.setToolTip("FS Time Sync")
        self.tray.setContextMenu(menu)
        self.tray.activated.connect(self.trayActivated)
        self.tray.show()

    def main_window_act(self, func, *args, **kwargs):
        self.main_window.act.emit([func, args, kwargs])

    def hide(self):
        self.tray_actions["hide_show"].setText("Show")
        self.tray_actions["hide_show"].triggered.connect(self.show)
        if self.offset_window:
            self.offset_window.close()
        self.main_window.saveState()
        self.main_window.hide()

    def trayActivated(self, reason):
        if reason == self.tray.ActivationReason.Trigger:
            self.show()

    def single_instance_triggered(self):
        self.tray.showMessage("FS Time Sync",
                              "FS Time Sync is already running.")
        self.show()

    def show(self):
        self.tray_actions["hide_show"].setText("Hide")
        self.tray_actions["hide_show"].triggered.connect(self.hide)
        self.main_window.show()
        # Brings window forward, but doesn't force it to stay active.
        self.main_window.setWindowState(Qt.WindowActive)
        self.main_window.setWindowState(Qt.WindowNoState)

    def exit(self):
        self.app.quit()

    def start(self):
        # Add single instance trigger.
        self.root.si.add_trigger(self.single_instance_triggered)

        # Settings are triggered here.
        if not self.root.settings.get(
                "startup", "tray"):  # Start regularly or as tray icon
            self.main_window.show()
        else:
            self.tray.showMessage("FS Time Sync",
                                  "FS Time Sync Started in Tray.")
            self.tray_actions["hide_show"].setText("Show")
            self.tray_actions["hide_show"].triggered.connect(self.show)

        if self.root.settings.get("startup", "auto_sync"):
            self.root.enable_live_sync()

        self.app.exec_()

    def add_message(self, section, code, msg):
        for message in self.messages[section]:
            if message["code"] == code:
                message["msg"] = msg
                break
        else:
            self.messages[section].append({"code": code, "msg": msg})

        self.main_window.act.emit([self.section_labels[section].setText, msg])

    def remove_message(self, section, code):
        for message in self.messages[section]:
            if message["code"] == code:
                self.messages[section].remove(message)
                break
        else:
            return  # No action just return

        if len(self.messages[section]) > 0:
            print(self.messages[section])
            self.main_window.act.emit([
                self.section_labels[section].setText,
                self.messages[section][-1]["msg"]
            ])
        else:
            self.main_window.act.emit(
                [self.section_labels[section].setText, ""])
class TestHeatMapWidget:
    def setup(self):
        self.app = QApplication(sys.argv)
        self.mw = MainWindow()
        self.mw.show()

    def teardown(self):
        with pytest.raises(SystemExit):
            with contextlib.closing(Closeable()):
                sys.exit()

    @patch.object(HeatMap, 'plot')
    @patch.object(HeatMap, '__init__')
    def test_plot_choose_param(self, no_init, no_plot):
        p_x = get_NF()  # [1, 2, 3, 4]
        p_y = get_ILCNP()  # [1, 2, 3, 4, 5, 6, 7]
        p_x.set_selected_values(1)
        p_y.set_selected_values(1)
        param = [p_x, p_y]

        obj = PossibleGraph("HEAT_MAP", param, [], [])

        wdg = HeatMapWidget(obj)
        wdg.selected_value = [[1, 2, 3, 4], [1, 2, 3, 4, 5, 6, 7]]

        no_init.return_value = None

        wdg.create_graph(lambda text: print(text), [])

        assert no_init.call_count == 1

        args = list(no_init.call_args_list[0])[0]
        assert wdg.selected_value == args[-1]

        assert no_plot.call_count == 1, "метод heat_map.plot не был вызван"

    @patch.object(HeatMap, 'plot')
    @patch.object(HeatMap, '__init__')
    @patch.object(QSpinBox, 'value')
    @patch.object(QDoubleSpinBox, 'value')
    def test_plot_input_param(self, no_double_value, no_int_value, no_init,
                              no_plot):
        p_x = get_KN()  # 0.0, 10.0, 1.0
        p_y = get_NP()  # 100, 500, 100
        param = [p_x, p_y]

        def f():
            for i in [0.0, 10.0, 1.0]:
                yield i
            return None

        def f1():
            for i in [100, 500, 100]:
                yield i
            return None

        x = f()
        y = f1()

        no_int_value.side_effect = y.__next__
        no_double_value.side_effect = x.__next__
        no_init.return_value = None

        obj = PossibleGraph("HEAT_MAP", param, [], [])

        wdg = HeatMapWidget(obj)
        w = wdg.get_widget()

        expected_axis = [[
            0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0
        ], [100, 200, 300, 400, 500]]

        wdg.create_graph(lambda text: print(text), [])

        assert no_init.call_count == 1

        args = list(no_init.call_args_list[0])[0]
        assert expected_axis == args[-1]

        assert no_plot.call_count == 1, "метод heat_map.plot не был вызван"

    def test_get_widget(self, param_loop):
        param, expected_type = param_loop
        obj = PossibleGraph("HEAT_MAP", param, [], [])
        wdg = HeatMapWidget(obj)
        w = wdg.get_widget()

        numb_btn = 0

        j = 0
        for i in range(wdg.grid.count()):
            item = wdg.grid.itemAt(i).widget()
            if type(item) == QPushButton:
                numb_btn += 1
            elif type(item) in expected_type:
                assert type(item) == expected_type[j]
                j += 1

        assert numb_btn == 2
示例#36
0
##################################################################################
#
#  Shaderlink - A RenderMan Shader Authoring Toolkit 
#  http://libe.ocracy.org/shaderlink.html
#  2010 Libero Spagnolini ([email protected])
#
##################################################################################

import sys

import resources.resources

from PySide import QtGui, QtCore
from gui.mainwindow import MainWindow

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

    # used by QSettings to store in registry (windows) or home (linux)
    app.setOrganizationName('Libero')
    app.setOrganizationDomain('Spagnolini')
    app.setApplicationName("Shaderlink")
    app.setWindowIcon(QtGui.QIcon(':/shaderLink.png'))

    form = MainWindow()    
    #form.resize(QtCore.QSize(1200, 900))
    # form.showMaximized()
    form.show()
    form.raise_()
    sys.exit(app.exec_())
示例#37
0
文件: main.py 项目: nemanja97/Query
import sys

from PySide.QtCore import Qt
from PySide.QtGui import QApplication, QPixmap, QSplashScreen

from dialog.directory_dialog import DirectoryDialog
from indexer.indexer import Indexer
from gui.mainwindow import MainWindow

if __name__ == "__main__":
    app = QApplication(sys.argv)
    dir = DirectoryDialog()
    if dir.exec_() and dir.result() != "" and dir.result() != None:
        app.indexer = Indexer(dir.result())
        splash_pix = QPixmap('res/SplashScreen.png')
        splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
        splash.setMask(splash_pix.mask())
        splash.show()
        app.processEvents()
        app.indexer.load_data()
        app.doclist = None
        app.webview = None
        app.currentWord = None
        app.mainWindow = MainWindow()
        splash.finish(app.mainWindow)
        app.mainWindow.show()
        sys.exit(app.exec_())
    else:
        app.quit()
示例#38
0
# -*- coding: utf-8 -*-
"""
@author: Xu Gaoxiang
@license: Apache V2
@email: [email protected]
@site: https://www.xugaoxiang.com
@software: PyCharm
@file: main.py
@time: 2019/1/10 10:50
"""

import sys

from PyQt5.QtWidgets import QApplication

from gui.mainwindow import MainWindow

if __name__ == '__main__':

    app = QApplication(sys.argv)
    main_window = MainWindow()
    main_window.show()
    sys.exit(app.exec_())
示例#39
0
import sys

from PyQt5.QtWidgets import QApplication, QMainWindow

from gui.mainwindow import MainWindow

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

    win = MainWindow()

    win.show()

    app.exec()

示例#40
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName("PySpice")
    window = MainWindow()
    window.resize(800, 600)
    app.exec_()
示例#41
0
##################################################################################
#
#  Shaderlink - A RenderMan Shader Authoring Toolkit
#  http://libe.ocracy.org/shaderlink.html
#  2010 Libero Spagnolini ([email protected])
#
##################################################################################

import sys

import resources.resources

from PySide import QtGui, QtCore
from gui.mainwindow import MainWindow

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

    # used by QSettings to store in registry (windows) or home (linux)
    app.setOrganizationName('Libero')
    app.setOrganizationDomain('Spagnolini')
    app.setApplicationName("Shaderlink")
    app.setWindowIcon(QtGui.QIcon(':/shaderLink.png'))

    form = MainWindow()
    #form.resize(QtCore.QSize(1200, 900))
    # form.showMaximized()
    form.show()
    form.raise_()
    sys.exit(app.exec_())