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


Python QGLWidget.setAutoFillBackground方法代码示例

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


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

示例1: BitPurse

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import setAutoFillBackground [as 别名]
class BitPurse(QApplication):
    ''' Application class '''
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setOrganizationName("Khertan Software")
        self.setOrganizationDomain("khertan.net")
        self.setApplicationName("BitPurse")

        self.view = QtDeclarative.QDeclarativeView()
        # Are we on mer ? So don't use opengl
        # As it didn't works on all devices
        if os.path.exists('/etc/mer-release'):
            fullscreen = True
        elif os.path.exists('/etc/aegis'):
            fullscreen = True
            self.glformat = QGLFormat().defaultFormat()
            self.glformat.setSampleBuffers(False)
            self.glw = QGLWidget(self.glformat)
            self.glw.setAutoFillBackground(False)
            self.view.setViewport(self.glw)
        else:
            fullscreen = False

        self.walletController = WalletController()
        self.rootContext = self.view.rootContext()
        self.rootContext.setContextProperty("argv", sys.argv)
        self.rootContext.setContextProperty("__version__", __version__)
        self.rootContext.setContextProperty("__upgrade__", __upgrade__
                                            .replace('\n', '<br />'))
        self.rootContext.setContextProperty('WalletController',
                                            self.walletController)
        self.rootContext.setContextProperty('AddressesModel',
                                            self.walletController
                                            .addressesModel)
        self.rootContext.setContextProperty('TransactionsModel',
                                            self.walletController
                                            .transactionsModel)
        self.rootContext.setContextProperty('Settings',
                                            self.walletController
                                            .settings)

        self.view.setSource(QUrl.fromLocalFile(
            os.path.join(os.path.dirname(__file__),
                         'qml', 'main.qml')))

        self.rootObject = self.view.rootObject()
        if fullscreen:
            self.view.showFullScreen()
        else:
            self.view.show()
        # self.loginPage = self.rootObject.findChild(QObject, "loginPage")
        self.sendPage = self.rootObject.findChild(QObject, "sendPage")
        self.aboutPage = self.rootObject.findChild(QObject, "aboutPage")
        self.walletController.onError.connect(self.rootObject.onError)
        # self.walletController.onConnected.connect(self.loginPage.onConnected)
        self.walletController.onTxSent.connect(self.sendPage.onTxSent)
开发者ID:AnadoluPanteri,项目名称:BitPurse,代码行数:58,代码来源:__init__.py

示例2: KhtNotes

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import setAutoFillBackground [as 别名]
class KhtNotes(QApplication):
    ''' Application class '''
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setOrganizationName("Khertan Software")
        self.setOrganizationDomain("khertan.net")
        self.setApplicationName("KhtNotes")

        self.settings = Settings()
        self.view = FilteredDeclarativeView(settings=self.settings)
        if os.path.exists('/etc/mer-release'):
            fullscreen = True
        elif os.path.exists('/etc/aegis'):
            fullscreen = True
            self.glformat = QGLFormat().defaultFormat()
            self.glformat.setSampleBuffers(False)
            self.glw = QGLWidget(self.glformat)
            self.glw.setAutoFillBackground(False)
            self.view.setViewport(self.glw)
        else:
            fullscreen = False

        self.notesModel = NotesModel()
        self.note = Note(settings=self.settings)
        self.conboyImporter = TomboyImporter()
        self.syncer = Sync()
        self.rootContext = self.view.rootContext()
        self.rootContext.setContextProperty("argv", sys.argv)
        self.rootContext.setContextProperty("__version__", __version__)
        self.rootContext.setContextProperty("__upgrade__", __upgrade__
                                            .replace('\n', '<br />'))
        self.rootContext.setContextProperty("Settings", self.settings)
        self.rootContext.setContextProperty("Sync", self.syncer)
        self.rootContext.setContextProperty("Importer", self.conboyImporter)
        self.rootContext.setContextProperty('notesModel', self.notesModel)
        self.rootContext.setContextProperty('Note', self.note)

        try:
            self.view.setSource(QUrl.fromLocalFile(
                os.path.join(os.path.dirname(__file__),
                             'qml', 'Harmattan_main.qml')))
        except:
            self.view.setSource(QUrl.fromLocalFile(
                os.path.join(os.path.dirname(__file__),
                             'qml', 'Desktop_main.qml')))

        self.rootObject = self.view.rootObject()
        if fullscreen:
            self.view.showFullScreen()
        else:
            self.view.show()
        self.note.on_error.connect(self.rootObject.onError)
        self.syncer.on_error.connect(self.rootObject.onError)
        self.syncer.on_finished.connect(self.rootObject.refresh)
        self.conboyImporter.on_finished.connect(self.notesModel.reload)
开发者ID:khertan,项目名称:KhtNotes,代码行数:57,代码来源:__init__.py

示例3: KhtSimpleText

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import setAutoFillBackground [as 别名]
class KhtSimpleText(QApplication):
    ''' Application class '''
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setOrganizationName("Khertan Software")
        self.setOrganizationDomain("khertan.net")
        self.setApplicationName("KhtSimpleText")

        self.settings = Settings()
        self.view = FilteredDeclarativeView(self.settings)

        #Are we on mer ? So don't use opengl
        #As it didn't works on all devices
        if not os.path.exists('/etc/mer-release'):
            self.glformat = QGLFormat().defaultFormat()
            self.glformat.setSampleBuffers(False)
            self.glw = QGLWidget(self.glformat)
            self.glw.setAutoFillBackground(False)
            self.view.setViewport(self.glw)

        self.document = Document('~', settings=self.settings)
        self.documentsModel = DocumentsModel(currentDoc=self.document, settings=self.settings)

        self.rootContext = self.view.rootContext()
        self.rootContext.setContextProperty("argv", sys.argv)
        self.rootContext.setContextProperty("__version__", __version__)
        self.rootContext.setContextProperty("__upgrade__", __upgrade__
                                            .replace('\n', '<br>'))
        self.rootContext.setContextProperty("Settings", self.settings)
        self.rootContext.setContextProperty("DocumentsModel",
                                            self.documentsModel)
        self.rootContext.setContextProperty("Document",
                                            self.document)
        self.view.setSource(QUrl.fromLocalFile(
            os.path.join(os.path.dirname(__file__), 'qml', 'main.qml')))
        self.rootObject = self.view.rootObject()
        self.view.showFullScreen()
开发者ID:khertan,项目名称:KhtSimpleText,代码行数:39,代码来源:__init__.py

示例4: BitPurse

# 需要导入模块: from PySide.QtOpenGL import QGLWidget [as 别名]
# 或者: from PySide.QtOpenGL.QGLWidget import setAutoFillBackground [as 别名]
class BitPurse(QApplication):
    ''' Application class '''
    def __init__(self):
        QApplication.__init__(self, sys.argv)
        self.setOrganizationName("Khertan Software")
        self.setOrganizationDomain("khertan.net")
        self.setApplicationName("BitPurse")

        self.view = QtDeclarative.QDeclarativeView()
        # Are we on mer ? So don't use opengl
        # As it didn't works on all devices
        if os.path.exists('/etc/mer-release'):
            fullscreen = True
        elif os.path.exists('/etc/aegis'):
            fullscreen = True
            self.glformat = QGLFormat().defaultFormat()
            self.glformat.setSampleBuffers(False)
            self.glw = QGLWidget(self.glformat)
            self.glw.setAutoFillBackground(False)
            self.view.setViewport(self.glw)
        else:
            fullscreen = False

        self.walletController = WalletController()
        self.rootContext = self.view.rootContext()
        self.rootContext.setContextProperty("argv", sys.argv)
        self.rootContext.setContextProperty("__version__", __version__)
        self.rootContext.setContextProperty("__upgrade__", __upgrade__
                                            .replace('\n', '<br />'))
        self.rootContext.setContextProperty('WalletController',
                                            self.walletController)
        self.rootContext.setContextProperty('AddressesModel',
                                            self.walletController
                                            .addressesModel)
        self.rootContext.setContextProperty('TransactionsModel',
                                            self.walletController
                                            .transactionsModel)
        self.rootContext.setContextProperty('Settings',
                                            self.walletController
                                            .settings)

        self.view.setSource(QUrl.fromLocalFile(
            os.path.join(os.path.dirname(__file__),
                         'qml', 'main.qml')))

        self.rootObject = self.view.rootObject()
        if fullscreen:
            self.view.showFullScreen()
        else:
            self.view.show()
        self.sendPage = self.rootObject.findChild(QObject, "sendPage")
        self.aboutPage = self.rootObject.findChild(QObject, "aboutPage")
        self.walletController.onError.connect(self.rootObject.onError)
        self.walletController.onTxSent.connect(self.sendPage.onTxSent)
        if len(sys.argv) >= 2:
            if sys.argv[1].startswith('bitcoin:'):
                params = sys.argv[1][8:].split('?')
                addr = params[0].strip('/')
                amount = 0
                if params > 1:
                    for param in params:
                        if param.startswith('amount='):
                            if len(param.split('=')) > 1:
                                amount = param.split('=')[1]
                self.rootObject.sendTo(addr, amount)
        if self.walletController.settings.numberOfLaunch == 25:
            self.rootObject.showDonation()
        self.walletController.settings.numberOfLaunch += 1
开发者ID:khertan,项目名称:BitPurse,代码行数:70,代码来源:__init__.py


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