Ejemplo n.º 1
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName("Audio Device Test")

    audio = AudioTest()
    audio.show()
    app.exec_()
Ejemplo n.º 2
0
def main():
    app = QApplication(sys.argv)
    # this is used for the window title
    app.setApplicationName('PoC audio player')
    mainwindow = PlaybackWindow()
    mainwindow.show()
    app.exec_()
Ejemplo n.º 3
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName("Audio Device Test")

    audio = AudioTest()
    audio.show()
    app.exec_()
Ejemplo n.º 4
0
def main():
    app = QApplication(sys.argv)
    # this is used for the window title
    app.setApplicationName('PoC audio player')
    mainwindow = PlaybackWindow()
    mainwindow.show()
    app.exec_()
Ejemplo n.º 5
0
def main():
    client = HCPHoNClient()
    
    # Temporary client config
    # Move to self implementation using QSettings later.
    client._configure(protocol=19)

    app = QApplication(sys.argv)
    app.setApplicationName("HoNChatPy")
    #app.setQuitOnLastWindowClosed(True) # May need to change for system tray behaviour
    
    login_window = HCPLoginWindow(client)
    login_window.setObjectName('login_window')
    
    core_window = HCPCoreWindow(client)
    core_window.setObjectName('hcp_window')
    
    while True:
        while not client.is_logged_in:
            login_window.show()
            app.exec_()
       
        while client.is_logged_in:
            core_window.show()
            client.connect()
            app.exec_()
Ejemplo n.º 6
0
def main(argv=None):
    if argv is None:
        argv = sys.argv
    app = QApplication(argv)
    app.setApplicationName('CANopenGUI')
    window = MainWindow()
    window.show()
    return app.exec_()
Ejemplo n.º 7
0
def main():

    app = QApplication([])
    app.setApplicationName('Simple Audio player')

    window = AudioTest(os.path.abspath(sys.argv[1]))
    window.show()

    return app.exec_()
Ejemplo n.º 8
0
def main():

    app = QApplication([])
    app.setApplicationName('Simple Audio player')

    window = AudioTest(os.path.abspath(sys.argv[1]))
    window.show()

    return app.exec_()
Ejemplo n.º 9
0
def main():
	QApplication.setColorSpec(QApplication.ManyColor)
	app = QApplication(sys.argv)
	app.setOrganizationName("NJN Ltd.")
	app.setOrganizationDomain("e-nool.blogspot.com")
	app.setApplicationName("Nigandu English to Tamil Dictionary")
	app.setWindowIcon(QIcon(":/icons/njnlogo.png"))
	form = mainwin()
	form.show()
	app.exec_()
Ejemplo n.º 10
0
def main(args):
    app = QApplication(args)
    app.setApplicationName(__APPNAME__)
    app.setApplicationVersion(__VERSION__)
    app.setOrganizationName(__ORG__)
    app.setOrganizationDomain(__ORGDOMAIN__)
    mainwindow = MaeBird()
    mainwindow.show()
    app.exec_()
    del mainwindow
def run(url, filename, image_crop, translate_page):
    app=QApplication.instance()
    if not app:
     app = QApplication(sys.argv)
    app.setApplicationName('myWindow')   
    r = Render(url, filename, image_crop, translate_page)
    r.show()
    while not r.finished:
        app.processEvents()
        time.sleep(0.01)
    return r.filepath
def run(url, filename, image_crop, translate_page):
    app = QApplication.instance()
    if not app:
        app = QApplication(sys.argv)
    app.setApplicationName('myWindow')
    r = Render(url, filename, image_crop, translate_page)
    r.show()
    while not r.finished:
        app.processEvents()
        time.sleep(0.01)
    return r.filepath
Ejemplo n.º 13
0
def main():
    'Main Program Entry Point'
    QResource.registerResource('res/icons.rcc')
    
    app = QApplication(sys.argv)
    app.setOrganizationName(__ORG_NAME)
    app.setOrganizationDomain(__ORG_DOMAIN)
    app.setApplicationName(__APP_NAME)
    app.setApplicationVersion(__APP_VERSION)
    
    w = TransferPanel()
    w.show()
    
    sys.exit(app.exec_())
Ejemplo n.º 14
0
def main():

    app = QApplication(sys.argv)
    app.setApplicationName('Audio Output Test')

    try:
        filename = sys.argv[1]
    except IndexError:
        filename = None

    window = AudioTest(filename=filename)
    window.show()

    return app.exec_()
Ejemplo n.º 15
0
def main():
  app = QApplication(sys.argv)
  try:
    auto_update()
  except:
    pass

  app.setOrganizationName("Deca Technologies")
  app.setOrganizationDomain("decatechnologies.com")
  app.setApplicationName("Pyrite")

  # create app environment
  window = MainWindow()
  window.show()

  # run main application loop
  sys.exit(app.exec_())
Ejemplo n.º 16
0
def main():
    #Start the Flask server in a new thread.
    startServerThread()

    #Now start the main UI.
    app = QApplication(sys.argv)
    app.setOrganizationName("Guru")
    app.setOrganizationDomain("rwu.edu")
    app.setApplicationName("Guru")

    main_window = MainWindow(isWelcome=True)
    main_window.show()
    main_window.activateWindow() #This does not work for some reason.
    main_window.raise_()         #But this does.
    app.exec_()

    cleanup()
Ejemplo n.º 17
0
class CinemolApp(object):
    def __init__(self):
        pass

    def launch(self):
        self.app = QApplication(sys.argv)
        self.app.setOrganizationName("rotatingpenguin.com")
        self.app.setApplicationName("Cinemol")
        self.mainWin = MainWindow()
        self.renderer = CinemolRenderer()
        # self.renderer.actors.append(Sphere2TestScene())
        self.renderer.actors.append(FiveBallScene())
        # self.renderer.actors.append(TeapotActor())
        self.mainWin.ui.glCanvas.set_gl_renderer(self.renderer)
        console_context.cm._set_app(self)
        self.mainWin.show()
        sys.exit(self.app.exec_())
def main():
    # Fix for PySide on OSX Mavericks
    import sys
    if sys.platform.startswith("darwin"):
        from PySide.QtGui import QFont
        QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande")

    app = QApplication(sys.argv)
    app.setObjectName(APPNAME)
    app.setApplicationName(APPNAME)
    app.setOrganizationName(ORGNAME)
    app.setOrganizationDomain(ORGDOMAIN)

    mainWindow = RegistrationShop(sys.argv)
    mainWindow.raise_()
    mainWindow.show()
    mainWindow.initialize()
    sys.exit(app.exec_())
Ejemplo n.º 19
0
def main():
    QApplication.setOrganizationName('OpenBossa')
    QApplication.setApplicationName('mobtrans')
    QApplication.setGraphicsSystem('raster')
    app = QApplication([])
    serverConfig = ServerConfig()
    server = Server(serverConfig)
    model = TorrentModel(server)
    searchModel = SearchModel()

    view = QDeclarativeView()
    #view.setMinimumSize(800, 600)
    view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
    view.rootContext().setContextProperty('server', server)
    view.rootContext().setContextProperty('torrentModel', model)
    view.rootContext().setContextProperty('searchModel', searchModel)
    view.setSource(QUrl.fromLocalFile('./qml/main.qml'))
    view.show()
    app.exec_()
Ejemplo n.º 20
0
def main():
    """
    """
    from MainWindow import MainWindow

    translator = QTranslator() #Build the translator
    translator.load(":/locales/df_%s" % QLocale.system().name())
    qttranslator = QTranslator()#A translator for Qt standard strings
    qttranslator.load("qt_%s" % (QLocale.system().name()))
    App = QApplication(sys.argv) #Creating the app
    App.setOrganizationName(ORGNAME) #Setting organization and application's
    App.setApplicationName(NAME)#name. It's only useful for QSettings
    App.setApplicationVersion(VERSION)
    App.setOrganizationDomain(URL)
    App.installTranslator(translator)#Install translators into the application.
    App.installTranslator(qttranslator)
    mw = MainWindow(App) #Now it's time to instantiate the main window
    mw.show() #And show it
    sys.exit(App.exec_()) #When the app finishes, exit.
Ejemplo n.º 21
0
def main():
    """
    """
    from MainWindow import MainWindow

    translator = QTranslator()  #Build the translator
    translator.load(":/locales/df_%s" % QLocale.system().name())
    qttranslator = QTranslator()  #A translator for Qt standard strings
    qttranslator.load("qt_%s" % (QLocale.system().name()))
    App = QApplication(sys.argv)  #Creating the app
    App.setOrganizationName(ORGNAME)  #Setting organization and application's
    App.setApplicationName(NAME)  #name. It's only useful for QSettings
    App.setApplicationVersion(VERSION)
    App.setOrganizationDomain(URL)
    App.installTranslator(
        translator)  #Install translators into the application.
    App.installTranslator(qttranslator)
    mw = MainWindow(App)  #Now it's time to instantiate the main window
    mw.show()  #And show it
    sys.exit(App.exec_())  #When the app finishes, exit.
Ejemplo n.º 22
0
def main():
    app = QApplication([])
    app.setApplicationName("Audio Output Test")
    view = QDeclarativeView()

    devices = []
    for info in QAudioDeviceInfo.availableDevices(QAudio.AudioOutput):
        devices.append(info)

    player = TonePlayer(devices, sys.argv[1] if len(sys.argv) > 1 else None)

    context = view.rootContext()
    context.setContextProperty("player", player)
    context.setContextProperty("deviceModel", [x.deviceName() for x in devices])

    url = QUrl("main.qml")
    view.setSource(url)

    view.show()

    app.exec_()
Ejemplo n.º 23
0
def main():
    app = QApplication([])
    app.setApplicationName('Audio Output Test')
    view = QDeclarativeView()

    devices = []
    for info in QAudioDeviceInfo.availableDevices(QAudio.AudioOutput):
        devices.append(info)

    player = TonePlayer(devices, sys.argv[1] if len(sys.argv) > 1 else None)

    context = view.rootContext()
    context.setContextProperty("player", player)
    context.setContextProperty("deviceModel",
                               [x.deviceName() for x in devices])

    url = QUrl('main.qml')
    view.setSource(url)

    view.show()

    app.exec_()
Ejemplo n.º 24
0
#!/usr/bin/env python

if __name__ == "__main__":
    """Python entry point."""

    from sys import argv
    from PySide.QtGui import QApplication
    from caerus.controller import Controller

    qt = QApplication(argv)

    qt.setApplicationName("Caerus")
    qt.setApplicationVersion("1.0")

    qt.setOrganizationName("MMT Temporary Services")
    qt.setOrganizationDomain("http://www.mmt-temp-srvs.com")

    c = Controller()
    qt.exec_()
Ejemplo n.º 25
0
    @param tback: The Traceback
    @type tback: Traceback
    """
    # log the exception 
    tbackString = traceback.format_list(traceback.extract_tb(tback))
    logging.exception("\nAn exception occurred: %s\nTraceback: %s" % (value,
                                                                      tbackString))

    # then call the default handler
    sys.__excepthook__(type, value, tback)


if __name__ == '__main__':
    sys.excepthook = my_excepthook  # catch all exceptions for the logger

    app = QApplication(sys.argv)
    #set some info, just to be thorough (this stuff is mainly set in BioParkinController or the Ui_MainWindow itself).
    app.setOrganizationName("Zuse Institute Berlin")
    app.setOrganizationDomain("zib.de")
    app.setApplicationName("BioPARKIN")

    parkin = BioParkinController(sys.argv)
    parkin.show()

    app.exec_()

    #cProfile.run('app.exec_()')


Ejemplo n.º 26
0
# -*- coding: utf-8 -*-
import os
import sys
#do not generate pyc file
sys.dont_write_bytecode = True

import splash_rc

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

#create application and set properties
app = QApplication(sys.argv)
app.setOrganizationName('Chengdu University')
app.setOrganizationDomain('http://www.cdu.edu.cn')
app.setApplicationName('Krait')

#support windows 7, 10 taskbar icon
import ctypes
if os.name == 'nt':
    myappid = 'CDU.Krait.ssr.1.0'
    ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

splash_img = QPixmap(":/icons/splash.png")
splash = QSplashScreen(splash_img)
splash.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.SplashScreen
                      | Qt.FramelessWindowHint)
splash.setStyleSheet('''
	font-family:"Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
''')
Ejemplo n.º 27
0
from ui.mainwindow import MainWindow

config = Config()
config.load()

# Create some directories if they don't exist
for dir in ['tmp', 'cache', 'cache' + os.sep + 'data']:
	if not os.path.exists(os.path.join(os.getcwd(), dir)):
		os.mkdir(os.path.join(os.getcwd(), dir))
		os.chmod(os.path.join(os.getcwd(), dir), 0777)

# The app
if __name__ == '__main__':
	# Create app
	app = QApplication(sys.argv)
	app.setApplicationName('LMMS Theme Installer')

	# Configuration wizard
	if config.get('Wizard', 'firstrun') == 'True':
		from ui.firstrunwizard import FirstRunWizardWindow
		wizard = FirstRunWizardWindow()
		wizard.show()

	# Show window
	window = MainWindow()
	window.show()

	# Closed connection
	app.lastWindowClosed.connect(app.quit)

	# Run it
Ejemplo n.º 28
0
def main(argv):
    """
    TOWRITE

    :param `argc`: TOWRITE
    :type `argc`: int
    :param `argv`: TOWRITE
    :type `argv`: char
    :rtype: int
    """

    filesToOpen = []  # QStringList filesToOpen;
    filesToCheck = []

    bindings = defaultBindings
    bindings_flag = False
    for arg in argv[1:]:
        if bindings_flag:
            bindings_flag = False
            if not arg in ("pyside", "pyqt4"):
                usage()
            else:
                bindings = arg
        elif arg == "-d" or arg == "--debug":
            pass
        elif arg == "-h" or arg == "--help":
            usage()
        elif arg == "-v" or arg == "--version":
            version()
        elif arg == "-b" or arg == "--bindings":
            bindings_flag = True
        else:
            filesToCheck.append(arg)

    if exitApp:
        return 1

    # make global to all modules
    if bindings == "pyside":
        builtins.PYSIDE = True
        builtins.PYQT4 = False
    elif bindings == "pyqt4":
        builtins.PYSIDE = False
        builtins.PYQT4 = True

    if PYSIDE:
        from PySide.QtScript import QScriptEngine
        if not hasattr(QScriptEngine, "newFunction"):
            raise ImportError(
                'You need a patched version of PySide.\n'
                'see: https://codereview.qt-project.org/112333')

    #--PySide Imports.
    if PYSIDE:
        from PySide.QtCore import QObject, SIGNAL, SLOT, QFile
        from PySide.QtGui import QApplication
    elif PYQT4:
        import sip
        sip.setapi('QString', 2)
        sip.setapi('QVariant', 2)
        from PyQt4.QtCore import QObject, SIGNAL, SLOT, QFile
        from PyQt4.QtGui import QApplication

    from mainwindow import MainWindow

    for file_ in filesToCheck:
        if QFile.exists(file_) and MainWindow.validFileFormat(file_):
            filesToOpen.append(file_)
        else:
            usage()
            break

    if exitApp:
        return 1

    app = QApplication(argv)
    app.setApplicationName(_appName_)
    app.setApplicationVersion(_appVer_)

    mainWin = MainWindow()  # MainWindow* 

    QObject.connect(app, SIGNAL("lastWindowClosed()"), mainWin, SLOT("quit()"))

    mainWin.setWindowTitle(app.applicationName() + " " + app.applicationVersion())
    mainWin.show()

    # NOTE: If openFilesSelected() is called from within the mainWin constructor, slot commands wont work and the window menu will be screwed
    if filesToOpen:  # if(!filesToOpen.isEmpty())
        mainWin.openFilesSelected(filesToOpen)

    # return app.exec_()
    return app.exec_()
Ejemplo n.º 29
0
def main():
    """Execute QDarkStyle example."""
    parser = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument(
        '--qt_from',
        default='pyqt',
        choices=['pyqt', 'pyqt5', 'pyside', 'qtpy', 'pyqtgraph'],
        help="Choose which wrapper/framework is to be used to run the example.",
        type=str)
    parser.add_argument(
        '--no_dark',
        action='store_true',
        help="Exihibts the original  window (without qdarkstyle).")
    parser.add_argument('--test',
                        action='store_true',
                        help="Auto close window after 2s.")
    # parsing arguments from command line
    args = parser.parse_args()

    # set log for debug
    logging.basicConfig(level=logging.DEBUG)

    if args.qt_from == 'pyside':
        # using PySide wrapper
        from PySide.QtGui import QApplication, QMainWindow, QDockWidget
        from PySide.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyside_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyside_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyside_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyside_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyside_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyside_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyside_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyside_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyside_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyside()

    elif args.qt_from == 'pyqt':
        # using PyQt4 wrapper
        from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget
        from PyQt4.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt()

    elif args.qt_from == 'pyqt5':
        # using PyQt5 wrapper
        from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWidget
        from PyQt5.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt5_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt5_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt5_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt5_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt5_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt5()

    elif args.qt_from == 'qtpy':
        # using QtPy API
        from qtpy.QtWidgets import QApplication, QMainWindow, QDockWidget
        from qtpy.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_qtpy_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_qtpy_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_qtpy_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_qtpy_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_qtpy_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_qtpy_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_qtpy_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_qtpy_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_qtpy_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment()

    elif args.qt_from == 'pyqtgraph':
        # using PyQtGraph API
        from pyqtgraph.Qt.QtGui import QApplication, QMainWindow, QDockWidget
        from pyqtgraph.Qt.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        #from pyqtgraph.Qt import QtGui, QtCore
        # import examples UI according to wrapper
        from ui.mw_menus_pyqtgraph_ui import Ui_MainWindow as ui_main
        from ui.dw_buttons_pyqtgraph_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqtgraph_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_no_fields
        from ui.dw_widgets_pyqtgraph_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqtgraph_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment(is_pyqtgraph=True)

    if args.no_dark:
        style = ''

    def write_settings(window):
        """Get window settings and write it into a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')
        settings.setValue('pos', window.pos())
        settings.setValue('size', window.size())
        settings.setValue('state', window.saveState())

    def read_settings(window):
        """Read and set window settings from a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')
        if args.qt_from == 'pyside':
            pos = settings.value('pos', window.pos())
            size = settings.value('size', window.size())
            state = settings.value('state', window.saveState())
        else:
            pos = settings.value('pos', window.pos(), type='QPoint')
            size = settings.value('size', window.size(), type='QSize')
            state = settings.value('state',
                                   window.saveState(),
                                   type='QByteArray')
        window.restoreState(state)
        window.resize(size)
        window.move(pos)

    # create the application
    app = QApplication(sys.argv)
    app.setOrganizationName('QDarkStyle')
    app.setApplicationName('QDarkStyle Example')

    # setup stylesheet
    app.setStyleSheet(style)

    # create main window
    window = QMainWindow()
    window.setObjectName('mainwindow')
    ui = ui_main()
    ui.setupUi(window)
    window.setWindowTitle("QDarkStyle v." + qdarkstyle.__version__ +
                          " - Example - Using " + args.qt_from)

    # create docks for buttons
    dw_buttons = QDockWidget()
    dw_buttons.setObjectName('buttons')
    ui_buttons = ui_buttons()
    ui_buttons.setupUi(dw_buttons)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_buttons)

    # create docks for buttons
    dw_displays = QDockWidget()
    dw_displays.setObjectName('displays')
    ui_displays = ui_displays()
    ui_displays.setupUi(dw_displays)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_displays)

    # create docks for inputs - fields
    dw_inputs_fields = QDockWidget()
    dw_inputs_fields.setObjectName('_fields')
    ui_inputs_fields = ui_inputs_fields()
    ui_inputs_fields.setupUi(dw_inputs_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_fields)

    # create docks for inputs - no fields
    dw_inputs_no_fields = QDockWidget()
    dw_inputs_no_fields.setObjectName('inputs_no_fields')
    ui_inputs_no_fields = ui_inputs_no_fields()
    ui_inputs_no_fields.setupUi(dw_inputs_no_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_no_fields)

    # create docks for widgets
    dw_widgets = QDockWidget()
    dw_widgets.setObjectName('widgets')
    ui_widgets = ui_widgets()
    ui_widgets.setupUi(dw_widgets)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_widgets)

    # create docks for views
    dw_views = QDockWidget()
    dw_views.setObjectName('views')
    ui_views = ui_views()
    ui_views.setupUi(dw_views)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_views)

    # create docks for containters - tabs
    dw_containers_tabs = QDockWidget()
    dw_containers_tabs.setObjectName('containers')
    ui_containers_tabs = ui_containers_tabs()
    ui_containers_tabs.setupUi(dw_containers_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_tabs)

    # create docks for containers - no tabs
    dw_containers_no_tabs = QDockWidget()
    dw_containers_no_tabs.setObjectName('containers_no_tabs')
    ui_containers_no_tabs = ui_containers_no_tabs()
    ui_containers_no_tabs.setupUi(dw_containers_no_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_no_tabs)

    # tabify right docks
    window.tabifyDockWidget(dw_buttons, dw_displays)
    window.tabifyDockWidget(dw_displays, dw_inputs_fields)
    window.tabifyDockWidget(dw_inputs_fields, dw_inputs_no_fields)

    # auto quit after 2s when testing on travis-ci
    if "--test" in sys.argv:
        QTimer.singleShot(2000, app.exit)

    # run
    read_settings(window)
    window.showMaximized()
    app.exec_()
    write_settings(window)
Ejemplo n.º 30
0
def main():
    """Execute QDarkStyle example."""
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('--qt_from', default='pyqt',
                        choices=['pyqt', 'pyqt5', 'pyside', 'qtpy', 'pyqtgraph'],
                        help="Choose which wrapper/framework is to be used to run the example.", type=str)
    parser.add_argument('--no_dark', action='store_true',
                        help="Exihibts the original  window (without qdarkstyle).")
    parser.add_argument('--test', action='store_true',
                        help="Auto close window after 2s.")
    # parsing arguments from command line
    args = parser.parse_args()

    # set log for debug
    logging.basicConfig(level=logging.DEBUG)

    if args.qt_from == 'pyside':
        # using PySide wrapper
        from PySide.QtGui import QApplication, QMainWindow, QDockWidget
        from PySide.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyside_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyside_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyside_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyside_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyside_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyside_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyside_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyside_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyside_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyside()

    elif args.qt_from == 'pyqt':
        # using PyQt4 wrapper
        from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget
        from PyQt4.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt()

    elif args.qt_from == 'pyqt5':
        # using PyQt5 wrapper
        from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWidget
        from PyQt5.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt5_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt5_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt5_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt5_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt5_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt5()

    elif args.qt_from == 'qtpy':
        # using QtPy API
        from qtpy.QtWidgets import QApplication, QMainWindow, QDockWidget
        from qtpy.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_qtpy_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_qtpy_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_qtpy_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_qtpy_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_qtpy_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_qtpy_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_qtpy_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_qtpy_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_qtpy_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment()

    elif args.qt_from == 'pyqtgraph':
        # using PyQtGraph API
        from pyqtgraph.Qt.QtGui import QApplication, QMainWindow, QDockWidget
        from pyqtgraph.Qt.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        #from pyqtgraph.Qt import QtGui, QtCore
        # import examples UI according to wrapper
        from ui.mw_menus_pyqtgraph_ui import Ui_MainWindow as ui_main
        from ui.dw_buttons_pyqtgraph_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqtgraph_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_no_fields
        from ui.dw_widgets_pyqtgraph_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqtgraph_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_no_tabs
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment(is_pyqtgraph=True)

    if args.no_dark:
        style = ''

    def write_settings(window):
        """Get window settings and write it into a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')
        settings.setValue('pos', window.pos())
        settings.setValue('size', window.size())
        settings.setValue('state', window.saveState())

    def read_settings(window):
        """Read and set window settings from a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')
        if args.qt_from == 'pyside':
            pos = settings.value('pos', window.pos())
            size = settings.value('size', window.size())
            state = settings.value('state', window.saveState())
        else:
            pos = settings.value('pos', window.pos(), type='QPoint')
            size = settings.value('size', window.size(), type='QSize')
            state = settings.value('state', window.saveState(), type='QByteArray')
        window.restoreState(state)
        window.resize(size)
        window.move(pos)

    # create the application
    app = QApplication(sys.argv)
    app.setOrganizationName('QDarkStyle')
    app.setApplicationName('QDarkStyle Example')

    # setup stylesheet
    app.setStyleSheet(style)

    # create main window
    window = QMainWindow()
    window.setObjectName('mainwindow')
    ui = ui_main()
    ui.setupUi(window)
    window.setWindowTitle("QDarkStyle v." + qdarkstyle.__version__ +
                          " - Example - Using " + args.qt_from)

    # create docks for buttons
    dw_buttons = QDockWidget()
    dw_buttons.setObjectName('buttons')
    ui_buttons = ui_buttons()
    ui_buttons.setupUi(dw_buttons)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_buttons)

    # create docks for buttons
    dw_displays = QDockWidget()
    dw_displays.setObjectName('displays')
    ui_displays = ui_displays()
    ui_displays.setupUi(dw_displays)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_displays)

    # create docks for inputs - fields
    dw_inputs_fields = QDockWidget()
    dw_inputs_fields.setObjectName('_fields')
    ui_inputs_fields = ui_inputs_fields()
    ui_inputs_fields.setupUi(dw_inputs_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_fields)

    # create docks for inputs - no fields
    dw_inputs_no_fields = QDockWidget()
    dw_inputs_no_fields.setObjectName('inputs_no_fields')
    ui_inputs_no_fields = ui_inputs_no_fields()
    ui_inputs_no_fields.setupUi(dw_inputs_no_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_no_fields)

    # create docks for widgets
    dw_widgets = QDockWidget()
    dw_widgets.setObjectName('widgets')
    ui_widgets = ui_widgets()
    ui_widgets.setupUi(dw_widgets)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_widgets)

    # create docks for views
    dw_views = QDockWidget()
    dw_views.setObjectName('views')
    ui_views = ui_views()
    ui_views.setupUi(dw_views)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_views)

    # create docks for containters - tabs
    dw_containers_tabs = QDockWidget()
    dw_containers_tabs.setObjectName('containers')
    ui_containers_tabs = ui_containers_tabs()
    ui_containers_tabs.setupUi(dw_containers_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_tabs)

    # create docks for containers - no tabs
    dw_containers_no_tabs = QDockWidget()
    dw_containers_no_tabs.setObjectName('containers_no_tabs')
    ui_containers_no_tabs = ui_containers_no_tabs()
    ui_containers_no_tabs.setupUi(dw_containers_no_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_no_tabs)

    # tabify right docks
    window.tabifyDockWidget(dw_buttons, dw_displays)
    window.tabifyDockWidget(dw_displays, dw_inputs_fields)
    window.tabifyDockWidget(dw_inputs_fields, dw_inputs_no_fields)

    # auto quit after 2s when testing on travis-ci
    if "--test" in sys.argv:
        QTimer.singleShot(2000, app.exit)

    # run
    read_settings(window)
    window.showMaximized()
    app.exec_()
    write_settings(window)
Ejemplo n.º 31
0
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA


import os
from PySide.QtGui import QApplication
from PySide.phonon import Phonon

app = QApplication([])
app.setApplicationName('Phonon Video Player')

#file_path = os.path.join(os.path.dirname(__file__), '320x240.ogv')
file_path = os.path.join(os.path.dirname(__file__), 'FolgersCoffe_512kb_mp4_026vbr260.ogv')
media_src = Phonon.MediaSource(file_path)

media_obj = Phonon.MediaObject()
media_obj.setCurrentSource(media_src)

video_widget = Phonon.VideoWidget()
Phonon.createPath(media_obj, video_widget)

audio_out = Phonon.AudioOutput(Phonon.VideoCategory)
Phonon.createPath(media_obj, audio_out)

video_widget.show()
Ejemplo n.º 32
0
if __name__ == '__main__':
    import sys
    import Qrc  # noqa
    import HelpForm

    class FakeState:
        def __init__(self):
            self.window = None
            self.helpForm = None
            self.stdFontFamily = "Times New Roman"
            self.stdFontSize = 13

        def help(self, page=None):
            if self.helpForm is None:
                self.helpForm = HelpForm.Form("xix_help.html", self.window)
            if page is not None:
                self.helpForm.changePage(page)
            self.helpForm.show()
            self.helpForm.raise_()
            self.helpForm.activateWindow()

    app = QApplication([])
    app.setOrganizationName("Qtrac Ltd.")
    app.setOrganizationDomain("qtrac.eu")
    app.setApplicationName("XindeX-Test")
    app.setApplicationVersion("1.0.0")
    state = FakeState()
    form = Form(state)
    form.show()
    app.exec_()
Ejemplo n.º 33
0
#!/usr/bin/python
__author__ = 'thomas'

from PySide.QtGui import QApplication
from highwaySimulatorGui import *
import sys

#def trace(frame, event, arg):
#    with open('/home/thomas/ZumoDrive/Highway_Simulation_GUI/trace.log','a') as log:
#        log.write("%s, %s:%d\n" % (event, frame.f_code.co_filename, frame.f_lineno))
#    return trace
#sys.settrace(trace)

app = QApplication(sys.argv)
app.setApplicationName("Highway Simulation GUI")

mw = HighwaySimulatorGui()
mw.show()

sys.exit(app.exec_())
Ejemplo n.º 34
0
        return QGraphicsProxyWidget.boundingRect(self).adjusted(0, 0, 0, 0);

# This is the magic:
    def paint(self, painter, option, widget=None):
        painter_inverted = QPainter()
        brect= QGraphicsProxyWidget.boundingRect(self)
        invertedColor = QImage(brect.width(),brect.height(),QImage.Format_RGB32)
        painter_inverted.begin(invertedColor)
        QGraphicsProxyWidget.paint(self,painter_inverted, option, widget)
        painter_inverted.end()
        painter.drawImage(0,0,invertedColor.rgbSwapped())


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

    scene = QGraphicsScene()

    media = Phonon.MediaObject()
    video = Phonon.VideoWidget()
    Phonon.createPath(media, video)

    proxy = CustomProxy()
    proxy.setWidget(video)
    rect = proxy.boundingRect()
    #proxy.setPos(0, 0)
    #proxy.show()
    scene.addItem(proxy)

    media.setCurrentSource("/home/amit/Videos/Kung Fu Panda 3 (2015) 1080p R6 [DayT.se].mp4")
Ejemplo n.º 35
0
            [self.db.get('/fault/{}'.format(k), 0) for k in self.faults])
        self.ui.faults_label.setStyleSheet(alert_style if alert else '')

        alert = any([
            self.db.get('/simulate/{}'.format(k), 0) for k in self.simulations
        ])
        self.ui.simulation_label.setStyleSheet(alert_style if alert else '')

    def _put_checkbox(self, key, checkbox):
        self.sync.put(key, checkbox.isChecked())
        checkbox.blockSignals(True)
        checkbox.setChecked(not checkbox.isChecked())
        checkbox.blockSignals(False)

    def _ui(self, name):
        return getattr(self.ui, name)


if __name__ == '__main__':
    from PySide.QtGui import QApplication, QStyleFactory

    app = QApplication([])
    app.setApplicationName('ARC Reactor')
    app.setStyle(QStyleFactory.create('fusion'))

    window = FrontPanel()
    window.show()

    from .sync import exec_async
    exec_async(app)
Ejemplo n.º 36
0
def main(argv):
    """
    TOWRITE

    :param `argc`: TOWRITE
    :type `argc`: int
    :param `argv`: TOWRITE
    :type `argv`: char
    :rtype: int
    """

    filesToOpen = []  # QStringList filesToOpen;
    filesToCheck = []

    bindings = defaultBindings
    bindings_flag = False
    for arg in argv[1:]:
        if bindings_flag:
            bindings_flag = False
            if not arg in ("pyside", "pyqt4"):
                usage()
            else:
                bindings = arg
        elif arg == "-d" or arg == "--debug":
            pass
        elif arg == "-h" or arg == "--help":
            usage()
        elif arg == "-v" or arg == "--version":
            version()
        elif arg == "-b" or arg == "--bindings":
            bindings_flag = True
        else:
            filesToCheck.append(arg)

    if exitApp:
        return 1

    # make global to all modules
    if bindings == "pyside":
        builtins.PYSIDE = True
        builtins.PYQT4 = False
    elif bindings == "pyqt4":
        builtins.PYSIDE = False
        builtins.PYQT4 = True

    if PYSIDE:
        from PySide.QtScript import QScriptEngine

        if not hasattr(QScriptEngine, "newFunction"):
            raise ImportError("You need a patched version of PySide.\n" "see: https://codereview.qt-project.org/112333")

    # --PySide Imports.
    if PYSIDE:
        from PySide.QtCore import QObject, SIGNAL, SLOT, QFile
        from PySide.QtGui import QApplication
    elif PYQT4:
        import sip

        sip.setapi("QString", 2)
        sip.setapi("QVariant", 2)
        from PyQt4.QtCore import QObject, SIGNAL, SLOT, QFile
        from PyQt4.QtGui import QApplication

    from mainwindow import MainWindow

    for file_ in filesToCheck:
        if QFile.exists(file_) and MainWindow.validFileFormat(file_):
            filesToOpen.append(file_)
        else:
            usage()
            break

    if exitApp:
        return 1

    app = QApplication(argv)
    app.setApplicationName(_appName_)
    app.setApplicationVersion(_appVer_)

    mainWin = MainWindow()  # MainWindow*

    QObject.connect(app, SIGNAL("lastWindowClosed()"), mainWin, SLOT("quit()"))

    mainWin.setWindowTitle(app.applicationName() + " " + app.applicationVersion())
    mainWin.show()

    # NOTE: If openFilesSelected() is called from within the mainWin constructor, slot commands wont work and the window menu will be screwed
    if filesToOpen:  # if(!filesToOpen.isEmpty())
        mainWin.openFilesSelected(filesToOpen)

    # return app.exec_()
    return app.exec_()
Ejemplo n.º 37
0
        dateString = self.exerciseDateEdit.date().toString('yyyy-MM-dd')
        self.db.logExercise(dateString, exData[0], exData[1], exData[2], exData[3], exData[4])
        # reload model
        self.changeExerciseDate(self.exerciseDateEdit.date())
        
    def logExerciseClick(self):
        """
        Use the button to log the currently selected exercise to the currently
        selected day
        """
        if len(self.exerciseList.selectedIndexes()) != 0:
            QModelIndex = self.exerciseList.selectedIndexes()[0]
            self.logExercise(QModelIndex)
        
    def changeExerciseDate(self, date=QDate.currentDate()):
        """
        Actions to conduct when date is changed, e.g. check if date exists in
        database, load existing exercise log
        """
        
        self.exerciseLogModel = ExerciseLogModel(self.db, date, self)
        self.dailyExerciseLog.setModel(self.exerciseLogModel)
        
if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setOrganizationName('visrolia.net')
    app.setOrganizationDomain('visrolia.net')
    app.setApplicationName('Tracker')
    frame = MainWindow()
    frame.show()
    app.exec_()
Ejemplo n.º 38
0
from PySide.QtGui import QApplication
from PySide.QtGui import QIcon

from PySide.QtCore import QTranslator
from PySide.QtCore import QLocale
from PySide.QtCore import QLibraryInfo
from PySide.QtCore import Qt

from qrmainwindow import QtReduceMainWindow

app = QApplication(sys.argv)

app.setOrganizationName("The Reduce Project")
app.setOrganizationDomain("reduce-algebra.sourceforge.net")
app.setApplicationName("QReduce")

qtTranslator = QTranslator(app)
qtTranslator.load("qt_" + QLocale.system().name(),
                  QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app.installTranslator(qtTranslator)

qreduceTranslator = QTranslator(app)
qreduceTranslator.load(sys.path[0] + "/" + "qreducetr." +
                       str(locale.getdefaultlocale()[0]))
#app.installTranslator(qreduceTranslator)

# app.setStyleSheet("QStatusBar::item { border: 0px solid black }");

app.setWindowIcon(QIcon(sys.path[0] + "/" + "Bumblebee.png"))
Ejemplo n.º 39
0
		layout.addWidget(self.lineEdit,0,1)
		layout.addWidget(self.updateButton,0,2)
		layout.addWidget(self.autoUpdate,1,1,1,2)
		layout.addWidget(responseLabel,2,0)
		layout.addWidget(self.responseLabel,2,1,1,2)
		layout.addWidget(self.tableWidget,3,0,1,3)
		layout.addWidget(progressLabel,4,0)
		layout.addWidget(self.progressView,5,0,1,3)
		layout.addWidget(self.aboutButton,6,2)
		self.setLayout(layout)
	
	def closeEvent(self,event):
		self.thread.quit()
		self.thread.wait()
		event.accept()
	
	def keyPressEvent(self,event):
		if event.key() == Qt.Key_Escape:
			self.thread.calculator.progress.abort()
			event.accept()
		else:
			event.ignore()

app=QApplication(sys.argv)
app.setOrganizationName("Peter Waldert")
app.setApplicationName("SymbolWorte")
app.setApplicationVersion("v0.3")
f=SymbolWort()
f.show()
sys.exit(app.exec_())
Ejemplo n.º 40
0
        else:
            super(Window, self).keyPressEvent(event)

    def hideEvent(self, event):
        self.hide()
        super(Window, self).hideEvent(event)

    def try_toogle_show(self, reason):
        if reason == QSystemTrayIcon.Trigger:
            self.setWindowState(Qt.WindowActive)
            self.toggle_show()

    def toggle_show(self):
        if self.isHidden():
            self.show()
        else:
            self.hide()


if __name__ == "__main__":
    from sys import argv
    from PySide.QtGui import QApplication

    app = QApplication(argv)
    app.setApplicationName(APP_NAME)

    window = Window()
    window.show()

    app.exec_()
Ejemplo n.º 41
0
def main():
    """Execute QDarkStyle example."""
    parser = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument(
        '--qt_from',
        default='qtpy',
        choices=['pyqt', 'pyqt5', 'pyside', 'pyside2', 'qtpy', 'pyqtgraph'],
        help="Choose which wrapper/framework is to be used to run the example.",
        type=str)
    parser.add_argument(
        '--no_dark',
        action='store_true',
        help="Exihibts the original  window (without qdarkstyle).")
    parser.add_argument('--test',
                        action='store_true',
                        help="Auto close window after 2s.")
    parser.add_argument('--reset',
                        action='store_true',
                        help="Reset GUI settings (position, size).")
    parser.add_argument('--screenshots',
                        action='store_true',
                        help="Generate screenshots.")

    # parsing arguments from command line
    args = parser.parse_args()

    # set log for debug
    logging.basicConfig(level=logging.DEBUG)

    # to avoid problems when testing without screen
    if args.test:
        os.environ['QT_QPA_PLATFORM'] = 'offscreen'

    if args.qt_from == 'pyside':
        # using PySide wrapper
        from PySide.QtGui import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from PySide.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyside_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyside_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyside_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyside_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyside_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyside_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyside_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyside_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyside_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = qdarkstyle.load_stylesheet_pyside

    elif args.qt_from == 'pyqt':
        # using PyQt4 wrapper
        from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from PyQt4.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = qdarkstyle.load_stylesheet_pyqt

    elif args.qt_from == 'pyqt5':
        # using PyQt5 wrapper
        from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from PyQt5.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyqt5_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyqt5_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqt5_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqt5_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyqt5_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqt5_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqt5_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = qdarkstyle.load_stylesheet_pyqt5

    elif args.qt_from == 'pyside2':
        # using PyQt5 wrapper
        from PySide2.QtWidgets import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from PySide2.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_pyside2_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_pyside2_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyside2_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyside2_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyside2_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_pyside2_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyside2_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyside2_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyside2_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = qdarkstyle.load_stylesheet_pyside2

    elif args.qt_from == 'qtpy':
        # using QtPy API
        from qtpy.QtWidgets import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from qtpy.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # import examples UI according to wrapper
        from ui.mw_menus_qtpy_ui import Ui_MainWindow as ui_main

        from ui.dw_buttons_qtpy_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_qtpy_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_qtpy_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_qtpy_ui import Ui_DockWidget as ui_inputs_no_fields

        from ui.dw_widgets_qtpy_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_qtpy_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_qtpy_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_qtpy_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = qdarkstyle.load_stylesheet_from_environment

    elif args.qt_from == 'pyqtgraph':
        # using PyQtGraph API
        from pyqtgraph.Qt.QtGui import QApplication, QMainWindow, QDockWidget, QStatusBar, QLabel, QPushButton
        from pyqtgraph.Qt.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        #from pyqtgraph.Qt import QtGui, QtCore
        # import examples UI according to wrapper
        from ui.mw_menus_pyqtgraph_ui import Ui_MainWindow as ui_main
        from ui.dw_buttons_pyqtgraph_ui import Ui_DockWidget as ui_buttons
        from ui.dw_displays_pyqtgraph_ui import Ui_DockWidget as ui_displays
        from ui.dw_inputs_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_fields
        from ui.dw_inputs_no_fields_pyqtgraph_ui import Ui_DockWidget as ui_inputs_no_fields
        from ui.dw_widgets_pyqtgraph_ui import Ui_DockWidget as ui_widgets
        from ui.dw_views_pyqtgraph_ui import Ui_DockWidget as ui_views
        from ui.dw_containers_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_tabs
        from ui.dw_containers_no_tabs_pyqtgraph_ui import Ui_DockWidget as ui_containers_no_tabs

        # Getting style
        style_method = lambda: qdarkstyle.load_stylesheet_from_environment(
            is_pyqtgraph=True)

    def write_settings(window):
        """Get window settings and write it into a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')
        settings.setValue('pos', window.pos())
        settings.setValue('size', window.size())
        settings.setValue('state', window.saveState())

    def read_settings(window, reset=False):
        """Read and set window settings from a file."""
        settings = QSettings('QDarkStyle', 'QDarkStyle Example')

        try:
            pos = settings.value('pos', window.pos())
            size = settings.value('size', window.size())
            state = settings.value('state', window.saveState())
        except Exception:
            pos = settings.value('pos', window.pos(), type='QPoint')
            size = settings.value('size', window.size(), type='QSize')
            state = settings.value('state',
                                   window.saveState(),
                                   type='QByteArray')

        if not reset:
            window.restoreState(state)
            window.resize(size)
            window.move(pos)

    # create the application
    app = QApplication(sys.argv)
    app.setOrganizationName('QDarkStyle')
    app.setApplicationName('QDarkStyle Example')

    # setup stylesheet
    style = ''

    if args.no_dark is False:
        style = style_method()

    app.setStyleSheet(style)

    # create main window
    window = QMainWindow()
    window.setObjectName('mainwindow')
    ui = ui_main()
    ui.setupUi(window)
    window.setWindowTitle("QDarkStyle v." + qdarkstyle.__version__)

    # create docks for buttons
    dw_buttons = QDockWidget()
    dw_buttons.setObjectName('buttons')
    ui_buttons = ui_buttons()
    ui_buttons.setupUi(dw_buttons)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_buttons)

    # create docks for buttons
    dw_displays = QDockWidget()
    dw_displays.setObjectName('displays')
    ui_displays = ui_displays()
    ui_displays.setupUi(dw_displays)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_displays)

    # create docks for inputs - no fields
    dw_inputs_no_fields = QDockWidget()
    dw_inputs_no_fields.setObjectName('inputs_no_fields')
    ui_inputs_no_fields = ui_inputs_no_fields()
    ui_inputs_no_fields.setupUi(dw_inputs_no_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_no_fields)

    # create docks for inputs - fields
    dw_inputs_fields = QDockWidget()
    dw_inputs_fields.setObjectName('_fields')
    ui_inputs_fields = ui_inputs_fields()
    ui_inputs_fields.setupUi(dw_inputs_fields)
    window.addDockWidget(Qt.RightDockWidgetArea, dw_inputs_fields)

    # create docks for widgets
    dw_widgets = QDockWidget()
    dw_widgets.setObjectName('widgets')
    ui_widgets = ui_widgets()
    ui_widgets.setupUi(dw_widgets)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_widgets)

    # create docks for views
    dw_views = QDockWidget()
    dw_views.setObjectName('views')
    ui_views = ui_views()
    ui_views.setupUi(dw_views)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_views)

    # create docks for containers - no tabs
    dw_containers_no_tabs = QDockWidget()
    dw_containers_no_tabs.setObjectName('containers_no_tabs')
    ui_containers_no_tabs = ui_containers_no_tabs()
    ui_containers_no_tabs.setupUi(dw_containers_no_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_no_tabs)

    # create docks for containters - tabs
    dw_containers_tabs = QDockWidget()
    dw_containers_tabs.setObjectName('containers')
    ui_containers_tabs = ui_containers_tabs()
    ui_containers_tabs.setupUi(dw_containers_tabs)
    window.addDockWidget(Qt.LeftDockWidgetArea, dw_containers_tabs)

    # tabify right docks
    window.tabifyDockWidget(dw_buttons, dw_displays)
    window.tabifyDockWidget(dw_displays, dw_inputs_fields)
    window.tabifyDockWidget(dw_inputs_fields, dw_inputs_no_fields)

    # tabify right docks
    window.tabifyDockWidget(dw_containers_no_tabs, dw_containers_tabs)
    window.tabifyDockWidget(dw_containers_tabs, dw_widgets)
    window.tabifyDockWidget(dw_widgets, dw_views)

    # issues #9120, #9121 on Spyder
    qstatusbar = QStatusBar()
    qstatusbar.addWidget(
        QLabel('Issue Spyder #9120, #9121 - background not matching.'))
    qstatusbar.addWidget(QPushButton('OK'))
    window.setStatusBar(qstatusbar)

    # auto quit after 2s when testing on travis-ci
    if args.test:
        QTimer.singleShot(2000, app.exit)

    # run
    read_settings(window, args.reset)
    window.showMaximized()

    # Save screenshots for differents displays and quit
    if args.screenshots:
        window.showFullScreen()
        QTimer.singleShot(
            1000, lambda: create_screenshots(app, window, not args.no_dark))

    app.exec_()
    write_settings(window)
Ejemplo n.º 42
0
    Pipes all exceptions to the logger, then lets the exceptions continue on
    their normal way.

    @param value: An exception
    @type value: Exception

    @param tback: The Traceback
    @type tback: Traceback
    """
    # log the exception
    tbackString = traceback.format_list(traceback.extract_tb(tback))
    logging.exception("\nAn exception occurred: %s\nTraceback: %s" % (value, tbackString))

    # then call the default handler
    sys.__excepthook__(type, value, tback)


if __name__ == "__main__":
    sys.excepthook = my_excepthook  # catch all exceptions for the logger

    app = QApplication(sys.argv)
    # set some info, just to be thorough (this stuff is mainly set in BioParkinController or the Ui_MainWindow itself).
    app.setOrganizationName("Zuse Institute Berlin")
    app.setOrganizationDomain("zib.de")
    app.setApplicationName("BioPARKIN")

    parkin = BioParkinController(sys.argv)
    parkin.show()

    app.exec_()
Ejemplo n.º 43
0
def main():
    app = QApplication(sys.argv)
    app.setApplicationName('PoC video player')
    mainwindow = MainWindow()
    mainwindow.show()
    app.exec_()
Ejemplo n.º 44
0
import sys
from PySide.QtGui import QApplication, QMainWindow, QTableView, QAbstractItemView
from PySide.QtSql import QSqlDatabase, QSqlTableModel


class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        database = QSqlDatabase.addDatabase('QSQLITE')
        database.setDatabaseName('astatsscraper.db') # Better lookup logic needed
        if not database.open():
            print('Error opening database!')
        model = QSqlTableModel(db=database)
        model.setTable('steam_apps')
        table = QTableView()
        table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        table.setModel(model)
        self.setCentralWidget(table)
        table.show()

app = QApplication(sys.argv)
app.setApplicationName("AStatsScraperGui")
main_window = MainWindow()
main_window.show()
app.exec_()
Ejemplo n.º 45
0
# ====================
# APPLICATION INSTANCE
# ====================

if __name__ == '__main__':
    # ===========================================
    # Let's wrap the application in a try block
    # so that we can catch and handle exceptions
    # ===========================================
    try:
        # =============================================
        # Here we create an instance of our application
        # =============================================
        templateApp = QApplication(sys.argv)
        templateApp.setApplicationName('TextEdit')

        templateWindow = AppWindow()
        templateWindow.set_icon()
        templateWindow.center_application()
        templateWindow.setFont(QFont("Ubuntu", 10, QFont.Normal))
        #templateWindow.create_status_bar()
        #templateWindow.setup_components()
        templateWindow.show()
        templateWindow.raise_()

        templateApp.exec_()
        sys.exit(0)

    except NameError:
        print "Name Error: %s" % sys.exc_info()[1]
def get_main_window_app(qt_from='pyqt', no_dark=True):
    """Return main window application."""

    # set log for debug
    logging.basicConfig(level=logging.DEBUG)

    style = ''

    if qt_from == 'pyside':
        # using PySide wrapper
        from PySide.QtGui import QApplication, QMainWindow, QDockWidget
        from PySide.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # getting style
        style = qdarkstyle.load_stylesheet_pyside()

    elif qt_from == 'pyqt':
        # using PyQt4 wrapper
        from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget
        from PyQt4.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt()

    elif qt_from == 'pyqt5':
        # using PyQt5 wrapper
        from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWidget
        from PyQt5.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # getting style
        style = qdarkstyle.load_stylesheet_pyqt5()

    elif qt_from == 'qtpy':
        # using QtPy API
        from qtpy.QtWidgets import QApplication, QMainWindow, QDockWidget
        from qtpy.QtCore import QTimer, Qt, QSettings, QByteArray, QPoint, QSize
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment()

    elif qt_from == 'pyqtgraph':
        # using PyQtGraph API
        from pyqtgraph.Qt import QtGui, QtCore
        # getting style
        style = qdarkstyle.load_stylesheet_from_environment(is_pyqtgraph=True)

    if no_dark:
        style = ''

    # create the application
    app = QApplication(sys.argv)
    app.setOrganizationName('QDarkStyle')
    app.setApplicationName('QDarkStyle Test')
    # setup stylesheet
    app.setStyleSheet(style)
    # create main window
    window = QMainWindow()
    window.setWindowTitle("QDarkStyle v." + qdarkstyle.__version__ +
                          " - TEST - Using " + qt_from)
    # auto quit after 2s when testing on travis-ci
    if "--test" in sys.argv:
        QTimer.singleShot(2000, app.exit)
    # run
    window.showMaximized()
    app.exec_()

    return window
Ejemplo n.º 47
0
        self.disconnectAction.setEnabled(True)
        self.queryAction.setEnabled(True)

        uri_history = list()
        for i in range(self.connectionUriCombo.count()):
            uri_history.append(self.connectionUriCombo.itemText(i))

        if uri not in uri_history:
            self.connectionUriCombo.clearEditText()
            self.connectionUriCombo.addItem(uri)
            self.connectionUriCombo.setCurrentIndex(len(uri_history))
            uri_history.append(uri)
            path = os.path.join(self._home, 'uri_history.txt')
            open(path, 'w').write('\n'.join(uri_history))

    @Slot()
    def disconnectOneS(self):
        pythoncom.CoUninitialize()
        self._connection = None
        self.connectAction.setEnabled(True)
        self.disconnectAction.setDisabled(True)
        self.queryAction.setDisabled(True)

if __name__ == '__main__':
    QApplication.setApplicationName('1CConsole')
    application = QApplication(sys.argv)

    mainWidget = ConsoleWidget()
    mainWidget.show()

    sys.exit(application.exec_())
Ejemplo n.º 48
0
 def __init__(self):
     app = QApplication(sys.argv)
     app.setApplicationName('OpenDev Player')
     player = VideoPlayer()
     player.show()
     app.exec_()
Ejemplo n.º 49
0
import sys
from PySide.QtGui import QApplication, QMainWindow, QTableView, QAbstractItemView
from PySide.QtSql import QSqlDatabase, QSqlTableModel


class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        database = QSqlDatabase.addDatabase('QSQLITE')
        database.setDatabaseName(
            'astatsscraper.db')  # Better lookup logic needed
        if not database.open():
            print('Error opening database!')
        model = QSqlTableModel(db=database)
        model.setTable('steam_apps')
        table = QTableView()
        table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        table.setModel(model)
        self.setCentralWidget(table)
        table.show()


app = QApplication(sys.argv)
app.setApplicationName("AStatsScraperGui")
main_window = MainWindow()
main_window.show()
app.exec_()
Ejemplo n.º 50
0
        return os.system('dot_clean %s' % path)
    
    def siguienteClicked(self):
        if self.lista.currentItem():
            selected = self.lista.currentItem().text()
            path = os.path.join('/Volumes', selected)
            if self.dot_clean(path) == 0:
                title = 'Proceso exitoso'
                msg = u'Se limpió la memoria con éxito'
            else:
                title = 'Proceso fallido'
                msg = u'Ocurrió un error inesperado. Verifique que la memoria esté montada.'
        else:
            title = 'Proceso fallido'
            msg = u'No se encuentra ninguna memoria, por favor introduzca una y vuelva a iniciar la apliación'
        QMessageBox.information(self, title, msg)
        self.close()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setOrganizationName("ehmSoftware")
    app.setOrganizationDomain("ehmsoft.com")
    app.setApplicationName("Dot Clean")
    app.setWindowIcon(QIcon(":/images/icono.png"))
    ventana = GUIdot_cleanMac()
    ventana.show()
    ventana.raise_()
    sys.exit(app.exec_())