本文整理汇总了Python中styledwidget.StyledWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python StyledWidget.__init__方法的具体用法?Python StyledWidget.__init__怎么用?Python StyledWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类styledwidget.StyledWidget
的用法示例。
在下文中一共展示了StyledWidget.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, parent):
StyledWidget.__init__(self, parent)
# Throbber
self.plsWait = QLabel(self)
self.plsWait.setText("<strong>Please wait...</strong>")
self.plsWait.setAlignment(Qt.AlignCenter)
self.status = QLabel(self)
self.status.setText("")
self.status.setAlignment(Qt.AlignCenter)
self.throbber = QLabel(self)
self.movie = QMovie(self)
self.movie.setFileName("amsn2/gui/front_ends/qt4/throbber.gif")
self.movie.start()
self.throbber.setMovie(self.movie)
# Layout, for horizontal centering
self.hLayout = QHBoxLayout()
self.hLayout.addStretch()
self.hLayout.addWidget(self.throbber)
self.hLayout.addStretch()
# Layout, for vertical centering
self.vLayout = QVBoxLayout()
self.vLayout.addStretch()
self.vLayout.addLayout(self.hLayout)
self.vLayout.addWidget(self.plsWait)
self.vLayout.addWidget(self.status)
self.vLayout.addStretch()
# Top level layout
self.setLayout(self.vLayout)
# Apply StyleSheet
self.setStyleSheet("background: white;")
示例2: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self._parent = parent
self._skin = amsn_core._skin_manager.skin
self._theme_manager = self._amsn_core._theme_manager
self._ui_manager = self._amsn_core._ui_manager
self.ui = Ui_Login()
self.ui.setupUi(self)
self._parent = parent
self.loginThrobber = None
QObject.connect(self.ui.pushSignIn, SIGNAL("clicked()"), self.__login_clicked)
QObject.connect(self.ui.styleDesktop, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleRounded, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleWLM, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.checkRememberMe, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkRememberPass, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkSignInAuto, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
self.setTestStyle()
# status list
self.status_values = {}
self.status_dict = {}
status_n = 0
for key in self._amsn_core.p2s:
name = self._amsn_core.p2s[key]
_, path = self._theme_manager.get_statusicon("buddy_%s" % name)
if (name == self._amsn_core.Presence.OFFLINE): continue
self.status_values[key] = status_n
self.status_dict[str.capitalize(name)] = key
status_n = status_n +1
icon = QIcon(path)
self.ui.comboStatus.addItem(icon, str.capitalize(name))
示例3: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent._parent)
self._amsn_core = amsn_core
self._myview = parent._myview
self.ui = Ui_ContactList()
self.ui.setupUi(self)
delegate = itemDelegate(self)
self.ui.cList.setItemDelegate(delegate)
self._parent = parent
self._mainWindow = parent._parent
self._model = QStandardItemModel(self)
self._model.setColumnCount(4)
self._proxyModel = QSortFilterProxyModel(self)
self._proxyModel.setSourceModel(self._model)
self.ui.cList.setModel(self._proxyModel)
self._contactDict = dict()
self.groups = []
self.contacts = {}
self._proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
self._proxyModel.setFilterKeyColumn(-1)
(self.ui.cList.header()).resizeSections(1) #auto-resize column wigth
(self.ui.cList.header()).setSectionHidden(1, True) #hide --> (group/contact ID)
(self.ui.cList.header()).setSectionHidden(2, True) #hide --> (boolean value. Do I really need this?)
(self.ui.cList.header()).setSectionHidden(3, True) #hide --> (contact/group view object)
self.connect(self.ui.searchLine, SIGNAL('textChanged(QString)'), self._proxyModel, SLOT('setFilterFixedString(QString)'))
self.connect(self.ui.nickName, SIGNAL('nickChange()'), self.__nickChange)
self.connect(self.ui.statusMessage, SIGNAL('psmChange()'), self.__psmChange)
self.connect(self.ui.status, SIGNAL('currentIndexChanged(int)'), self.__statusChange)
self.connect(self.ui.cList, SIGNAL('doubleClicked(QModelIndex)'), self.__clDoubleClick)
self.ui.nickName.installEventFilter(GlobalFilter(self.ui.nickName))
self.ui.statusMessage.installEventFilter(GlobalFilter(self.ui.statusMessage))
示例4: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self._parent = parent
self._skin = amsn_core._skin_manager.skin
self._theme_manager = self._amsn_core._theme_manager
self._ui_manager = self._amsn_core._ui_manager
self.ui = Ui_Login()
self.ui.setupUi(self)
self._parent = parent
self.loginThrobber = None
QObject.connect(self.ui.pushSignIn, SIGNAL("clicked()"), self.__login_clicked)
QObject.connect(self.ui.linePassword, SIGNAL("returnPressed()"), self.__login_clicked)
QObject.connect(self.ui.styleDesktop, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleRounded, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleWLM, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.checkRememberMe, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkRememberPass, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkSignInAuto, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.comboAccount, SIGNAL("currentIndexChanged(QString)"), self.__on_user_comboxEntry_changed)
self.setTestStyle()
# status list
for key in self._amsn_core.p2s:
name = self._amsn_core.p2s[key]
_, path = self._theme_manager.get_statusicon("buddy_%s" % name)
if (name == self._amsn_core.p2s['FLN']): continue
self.ui.comboStatus.addItem(QIcon(path), str.capitalize(name), key)
示例5: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self._ui_manager = self._amsn_core._ui_manager
self.ui = Ui_Login()
self.ui.setupUi(self)
self._parent = parent
QObject.connect(self.ui.pushSignIn, SIGNAL("clicked()"), self.signin)
QObject.connect(self.ui.styleDesktop, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleRounded, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleWLM, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.checkRememberMe, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkRememberPass, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QObject.connect(self.ui.checkSignInAuto, SIGNAL("toggled(bool)"), self.__on_toggled_cb)
self.setTestStyle()
# status list
self.status_values = {}
self.status_dict = {}
status_n = 0
for key in self._amsn_core.p2s:
name = self._amsn_core.p2s[key]
if (name == 'offline'): continue
self.status_values[name] = status_n
self.status_dict[str.capitalize(name)] = key
status_n = status_n +1
self.ui.comboStatus.addItem(str.capitalize(name))
示例6: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
base.aMSNContactListWidget.__init__(self, amsn_core, parent)
StyledWidget.__init__(self, parent._parent)
self._amsn_core = amsn_core
self.ui = Ui_ContactList()
self.ui.setupUi(self)
delegate = itemDelegate(self)
self.ui.cList.setItemDelegate(delegate)
self._parent = parent
self._mainWindow = parent._parent
self._model = QStandardItemModel(self)
self._model.setColumnCount(4)
self._proxyModel = QSortFilterProxyModel(self)
self._proxyModel.setSourceModel(self._model)
self.ui.cList.setModel(self._proxyModel)
self._contactDict = dict()
self.groups = []
self.contacts = {}
self._proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
self._proxyModel.setFilterKeyColumn(-1)
(self.ui.cList.header()).resizeSections(1) # auto-resize column wigth
(self.ui.cList.header()).setSectionHidden(1, True) # hide --> (group/contact ID)
(self.ui.cList.header()).setSectionHidden(2, True) # hide --> (boolean value. Do I really need this?)
(self.ui.cList.header()).setSectionHidden(3, True) # hide --> (contact/group view object)
self.connect(
self.ui.searchLine, SIGNAL("textChanged(QString)"), self._proxyModel, SLOT("setFilterFixedString(QString)")
)
QObject.connect(self.ui.nickName, SIGNAL("textChanged(QString)"), self.__slotChangeNick)
self.connect(self.ui.cList, SIGNAL("doubleClicked(QModelIndex)"), self.__slotContactCallback)
示例7: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self.ui = Ui_Login()
self.ui.setupUi(self)
self._parent = parent
QObject.connect(self.ui.pushSignIn, SIGNAL("clicked()"), self.signin)
QObject.connect(self.ui.styleDesktop, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleRounded, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleWLM, SIGNAL("clicked()"), self.setTestStyle)
self.setTestStyle()
示例8: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent._parent)
self._amsn_core = amsn_core
self.ui = Ui_ContactList()
self.ui.setupUi(self)
self._parent = parent
self._mainWindow = parent._parent
self._model = QStandardItemModel(self)
self._proxyModel = QSortFilterProxyModel(self)
self._proxyModel.setSourceModel(self._model)
self.ui.cList.setModel(self._proxyModel)
self._contactDict = dict()
self._proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
self._proxyModel.setFilterKeyColumn(-1)
self.connect(self.ui.searchLine, SIGNAL('textChanged(QString)'),
self._proxyModel, SLOT('setFilterFixedString(QString)'))
QObject.connect(self.ui.nickName, SIGNAL('textChanged(QString)'),
self.__slotChangeNick)
示例9: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self._parent = parent
self._skin = amsn_core._skin_manager.skin
self._theme_manager = self._amsn_core._theme_manager
self._ui_manager = self._amsn_core._ui_manager
self.ui = uic.loadUi(ufp, self)
self._parent = parent
self.loginThrobber = None
QtCore.QObject.connect(self.ui.pushSignIn, QtCore.SIGNAL("clicked()"), self.__login_clicked)
QtCore.QObject.connect(self.ui.linePassword, QtCore.SIGNAL("returnPressed()"), self.__login_clicked)
QtCore.QObject.connect(self.ui.checkRememberMe, QtCore.SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QtCore.QObject.connect(self.ui.checkRememberPass, QtCore.SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QtCore.QObject.connect(self.ui.checkSignInAuto, QtCore.SIGNAL("toggled(bool)"), self.__on_toggled_cb)
QtCore.QObject.connect(
self.ui.comboAccount, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__on_user_comboxEntry_changed
)
styleData = QtCore.QFile()
styleData.setFileName("amsn2/ui/front_ends/qt4/style1.qss")
if styleData.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text):
styleReader = QtCore.QTextStream(styleData)
self.setStyleSheet(styleReader.readAll())
示例10: __init__
# 需要导入模块: from styledwidget import StyledWidget [as 别名]
# 或者: from styledwidget.StyledWidget import __init__ [as 别名]
def __init__(self, amsn_core, parent):
StyledWidget.__init__(self, parent)
self._amsn_core = amsn_core
self.ui = Ui_Login()
self.ui.setupUi(self)
self._parent = parent
QObject.connect(self.ui.pushSignIn, SIGNAL("clicked()"), self.signin)
QObject.connect(self.ui.styleDesktop, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleRounded, SIGNAL("clicked()"), self.setTestStyle)
QObject.connect(self.ui.styleWLM, SIGNAL("clicked()"), self.setTestStyle)
self.setTestStyle()
# status list
self.status_values = {}
self.status_dict = {}
status_n = 0
for key in self._amsn_core.p2s:
name = self._amsn_core.p2s[key]
if name == "offline":
continue
self.status_values[name] = status_n
self.status_dict[str.capitalize(name)] = name
status_n = status_n + 1
self.ui.comboStatus.addItem(str.capitalize(name))