Python PyQt5.QtGui.QGuiApplication() Examples

The following are code examples for showing how to use PyQt5.QtGui.QGuiApplication(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: uavsim   Author: kamikaze   File:    GNU General Public License v3.0 5 votes vote down vote up
def run_map_ui(queue_to_ui, queue_out):
    app = QGuiApplication(sys.argv)
    engine = QQmlApplicationEngine()
    ctx = engine.rootContext()

    locator = Locator(queue_to_ui, queue_out)
    pid_manager = PIDManager(queue_to_ui, queue_out)

    ctx.setContextProperty('locator', locator)
    ctx.setContextProperty('pidManager', pid_manager)
    ctx.setContextProperty('main', engine)
    engine.load(resource_filename('uavsim.resources', 'main.qml'))

Example 2
Project: HanziSRS   Author: patarapolw   File:    Apache License 2.0 5 votes vote down vote up
def main():
    start = time()
    sys.argv += ['--style', 'fusion']
    app = QGuiApplication(sys.argv)

    engine = QQmlApplicationEngine()
    context = engine.rootContext()

    hsk_vocab = HskVocab()
    spoonfed = SpoonFed()
    hanzi_variant = HanziVariant()
    vocab_category = VocabCategory()
    hanzi_level = HanziLevel()
    cedict = Cedict()
    context.setContextProperty('pyHskVocab', hsk_vocab)
    context.setContextProperty('pySentence', spoonfed)
    context.setContextProperty('pyHanziVariant', hanzi_variant)
    context.setContextProperty('pyVocabCategory', vocab_category)
    context.setContextProperty('pyHanziLevel', hanzi_level)
    context.setContextProperty('pyCedict', cedict)

    utils = Utils()
    context.setContextProperty('py', utils)

    user = User()
    context.setContextProperty('pyUser', user)

    user_db = sqlite3.connect(user_path('user.db'))
    user_vocab = UserVocab(user_db)
    user_hanzi = UserHanzi(user_db)
    user_sentence = UserSentence(user_db)
    context.setContextProperty('pyUserVocab', user_vocab)
    context.setContextProperty('pyUserHanzi', user_hanzi)
    context.setContextProperty('pyUserSentence', user_sentence)

    print("Startup time: {:.4f} seconds".format(time()-start))


Example 3
Project: python3_ios   Author: holzschu   File:    BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
def setUp(self):
            if ImageQt.qt_version == '5':
                from PyQt5.QtGui import QGuiApplication
            elif ImageQt.qt_version == '4':
                from PyQt4.QtGui import QGuiApplication
            elif ImageQt.qt_version == 'side':
                from PySide.QtGui import QGuiApplication
            elif ImageQt.qt_version == 'side2':
                from PySide2.QtGui import QGuiApplication
        except ImportError:
            self.skipTest('QGuiApplication not installed') = QGuiApplication([])