예제 #1
0
파일: __init__.py 프로젝트: yxsyxs/QMusic
def get_qapplication_instance():
    """ Returns the QApplication instance. Creates one if it doesn't exist.
    """
    app = QtGui.QApplication.instance()

    if app is None:
        app = QtGui.QApplication(sys.argv)
    check_class(app, QtGui.QApplication)

    return app
예제 #2
0
def main():
    import platform
    if sys.platform == "linux2":
        QtGui.QApplication.addLibraryPath(
            '/usr/lib/%s-linux-gnu/qt5/plugins/' % platform.machine())
    app = QtGui.QApplication(sys.argv)
    window = ThFrame()
    window.setGeometry(100, 100, 800, 600)
    window.setWindowTitle('ThFrame')
    window.show()
    sys.exit(app.exec_())
예제 #3
0
        self.accept()  # 关闭对话框并返回1


def login(loginoptions):
    """返回True或False"""
    dialog = LoginDialog(loginoptions)
    if dialog.exec_():
        return True, (unicode(dialog.login_name.text()),
                      unicode(dialog.login_password.text()))
    else:
        return False, (u'', u'')


if __name__ == '__main__':
    import sys
    app = QtGui.QApplication(sys.argv)
    styleoptions = {
        'title':
        u'登录',
        'windowicon':
        os.sep.join(
            [os.path.dirname(__file__), 'utildialogskin', 'images', 'bg.jpg']),
        'minsize': (400, 300),
        'size': (400, 300),
        'logo_title':
        u'智能光纤云终端管理平台',
        'logo_img_url':
        os.sep.join(
            [os.path.dirname(__file__), 'utildialogskin', 'images', 'bg.jpg'])
    }
    print login(styleoptions)