本文整理汇总了Python中qt.QObject类的典型用法代码示例。如果您正苦于以下问题:Python QObject类的具体用法?Python QObject怎么用?Python QObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _initWidgets
def _initWidgets(self):
"""Initialises all of the main widgets in the window."""
global appRoot
appIconPath = os.path.join(appRoot, "images/miniicon.png")
self.setIcon(QPixmap(appIconPath))
self.mainBox = QHBox(self)
self.mainSplitter = QSplitter(self.mainBox)
self.bmarksListBox = QVBox(self.mainSplitter)
self.bmarksListBox.setMaximumWidth(250)
self.bmarksList = KTVBookmarksListView.KTVBookmarksListView(self.bmarksListBox, self)
QObject.connect(self.bmarksList, SIGNAL(str(u'doubleClicked(QListViewItem *)')), self._bookmarkChosen)
self.browserBox = QVBox(self.mainSplitter)
self.browser = KTVHTMLPart.KTVHTMLPart(self.browserBox, self)
self.setCentralWidget(self.mainBox)
self._buttonBox = QHBox(self.bmarksListBox)
self._addButton = QPushButton(u"&Add", self._buttonBox, str(u""))
QObject.connect(self._addButton, SIGNAL(str(u'clicked()')), self._addItem)
self._deleteButton = QPushButton(u"&Delete", self._buttonBox, str(u""))
QObject.connect(self._deleteButton, SIGNAL(str(u'clicked()')), self._deleteItem)
self._backButton = QPushButton(u"&Back", self.bmarksListBox, str(u""))
QObject.connect(self._backButton, SIGNAL(str(u'clicked()')), self._back)
self._helpButton = QPushButton(u"&Help", self.bmarksListBox, str(u""))
QObject.connect(self._helpButton, SIGNAL(str(u'clicked()')), self._help)
self.statusBar().message(u"KatchTV is now ready for use.")
开发者ID:lee-b,项目名称:katchtv,代码行数:35,代码来源:KTVMainWindow.py
示例2: test
def test():
from qt import QWidget
class W(QWidget):
def __init__(self):
QWidget.__init__(self)
def create():
global _list
s = SampleControl()
s.load('/home/ajole/wav/trance.wav')
s.slotStart()
s.slotSetZone(0, True)
_list.append(s)
import pkaudio
from qt import QApplication, QPushButton, QObject, SIGNAL
pkaudio.connect_to_host(startserver=0)
a = QApplication([])
w1 = SampleControl()
w1.load('/home/ajole/wav/track.wav')
w1.slotStart()
w1.slotSetZone(0, True)
b = QPushButton('create', None)
QObject.connect(b,
SIGNAL('clicked()'),
create)
b.show()
a.setMainWidget(b)
a.exec_loop()
开发者ID:patrickkidd,项目名称:pksampler-0.3,代码行数:32,代码来源:SampleControl.py
示例3: __init__
def __init__(self, *args):
QVBox.__init__(self, *args)
self.slider = QSlider(QSlider.Horizontal, self, "slider")
self.slider.setRange(0, 999)
self.slider.setValue(0)
QObject.connect(self.slider, SIGNAL("valueChanged(int)"), self.valueChanged)
self.setFocusProxy(self.slider)
开发者ID:dobbs,项目名称:dobbse.net,代码行数:7,代码来源:demo.py
示例4: __init__
def __init__(self, parent):
QObject.__init__(self)
self.parent = parent
try:
self.comar = ComarIface.ComarIface(self.handler, self.errHandler)
except:
self.parent.showErrorMessage(i18n("Cannot connect to Comar daemon"))
self.parent.updateGui()
开发者ID:Tayyib,项目名称:uludag,代码行数:8,代码来源:Commander.py
示例5: plot2d
def plot2d(self):
self.box = QHBox()
toolbar = QVBox(self.box)
self.plot2d = Plot2D(self.box, self.plotdata)
self.slider = QSlider(QSlider.Vertical, toolbar, "slider")
self.slider.setRange(0, self.plotdata.xmax - 1)
self.slider.setValue(0)
QObject.connect(self.slider, SIGNAL("valueChanged(int)"), self.plot2d.slice)
self.plot2d.slice(0)
self.box.show()
开发者ID:dobbs,项目名称:dobbse.net,代码行数:10,代码来源:demo.py
示例6: main
def main():
app = KdeQt.KQApplication(sys.argv, None)
stat = KdeQt.prepareCommandLine()
QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
wnd = MainForm_Impl.MainForm_Impl(statusbar=stat)
if wnd.init():
app.setMainWidget(wnd)
KdeQt.setupKDE(app, wnd)
wnd.show()
res = app.exec_loop()
sys.exit(res)
开发者ID:BackupTheBerlios,项目名称:pyqlogger-svn,代码行数:11,代码来源:pyqlogger.py
示例7: __init__
def __init__(self, parent):
QObject.__init__(self)
self.parent = parent
# Modal dialogs freezes pm in dbus signal path
self.delayTimer = QTimer(self)
self.lastError = None
##
self.connect(self.delayTimer, SIGNAL("timeout()"), self.exceptionHandler)
self.iface = PisiIface.Iface()
self.iface.setHandler(self.handler)
self.iface.setExceptionHandler(self.exceptionHandler)
开发者ID:Tayyib,项目名称:uludag,代码行数:11,代码来源:Commander.py
示例8: __init__
def __init__(self, f, log):
super(LyJob, self).__init__()
self.f = f
self.setExecutable(config("commands").get("lilypond", "lilypond"))
self.setWorkingDirectory(f.directory)
self.log = log
self.stdout = Outputter(log, f)
self.stderr = Outputter(log, f)
QObject.connect(self, SIGNAL("receivedStdout(KProcess*, char*, int)"), self.stdout.receive)
QObject.connect(self, SIGNAL("receivedStderr(KProcess*, char*, int)"), self.stderr.receive)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:11,代码来源:runlily.py
示例9: __init__
def __init__(self):
QObject.__init__(self)
bus = dbus.SessionBus()
self.notifyid = 0
try:
object = bus.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
self.iface = dbus.Interface(object, dbus_interface='org.freedesktop.Notifications')
object.connect_to_signal("ActionInvoked", self.click_handler, dbus_interface="org.freedesktop.Notifications")
except dbus.DBusException:
traceback.print_exc()
开发者ID:Tayyib,项目名称:uludag,代码行数:11,代码来源:Notifier.py
示例10: __init__
def __init__(self, parentWidget, window):
"""Initialises a new KTVHTMLPart object. Requires the same
arguments as KHTMLPart, plus the parent window it will attach to."""
KHTMLPart.__init__(self, parentWidget)
self._window = window
QObject.connect(self.browserExtension(), SIGNAL('openURLRequestDelayed(const KURL&, const KParts::URLArgs&)'), self._openURLRequest)
self.__lastURL = None
self.__currentURL = None
self.setFormNotification(self.NoNotification)
开发者ID:lee-b,项目名称:katchtv,代码行数:11,代码来源:KTVHTMLPart.py
示例11: __init__
def __init__(self, parent):
QObject.__init__(self)
try:
self.comar = ComarIface.ComarIface(self)
except:
parent.showErrorMessage("Cannot connect to Comar daemon")
self.parent = parent
# Init the database
pisi.api.init(database=True, write=False)
开发者ID:Tayyib,项目名称:uludag,代码行数:12,代码来源:Commander.py
示例12: __init__
def __init__(self, parent, reactor, watcher, socketType):
QObject.__init__(self, parent)
self.reactor = reactor
self.watcher = watcher
fd = watcher.fileno()
self.notifier = QSocketNotifier(fd, socketType, parent)
self.notifier.setEnabled(True)
if socketType == QSocketNotifier.Read:
self.fn = self.read
else:
self.fn = self.write
self.notifier.activated.connect(self.fn)
开发者ID:KDE,项目名称:kajongg,代码行数:12,代码来源:qt4reactor.py
示例13: __init__
def __init__(self):
""" sample -> splitter |-> volume -> pan -> muter -> mixers[0]
|-> volume -> pan -> muter -> mixers[1]
| ...
|-> volume -> pan -> mute from globals import *
"""
QObject.__init__(self)
self.sample = None
self.currentCue = 0
self.cues = []
self.groupingEnabled = 0
self.beatSynced = 0
self.pitchRange = PITCH_RANGE
self.savedPitchRange = 0
self.driver = pkaudio.Driver()
# Pitch : when real/temp pitch match, pitch is not bent
self.pitchTimer = QTimer(self)
QObject.connect(self.pitchTimer, SIGNAL("timeout()"),
self.slotDoPitchBend)
self.pitchTemp = 0.0 # the bent pitch
self.realPitch = 0.0 # the original pitch
self.pitchDirection = "back"
self.path = None
self.splitter = pkaudio.Splitter()
# Effect chains
effectChain0 = {}
effectChain1 = {}
self.effectChains = [effectChain0, effectChain1]
# connect eveything up
for i, chain in enumerate(self.effectChains):
chain['volume'] = pkaudio.Volume()
chain['pan'] = pkaudio.Pan()
chain['peak'] = pkaudio.PeakModule()
chain['muter'] = pkaudio.Muter()
chain['muter'].setOn(0)
chain['volume'].outputPort().connect(chain['pan'].inputPort())
chain['pan'].outputPort().connect(chain['peak'].inputPort())
chain['peak'].outputPort().connect(chain['muter'].inputPort())
if i != 1:
self.splitter.outputPort(i).connect(chain['volume'].inputPort())
else:
self.splitter.outputPort(i).connect(chain['pan'].inputPort())
self.effectChains[0]['volume'].setProperty('volume', 75)
self.slotConnectMixers()
开发者ID:patrickkidd,项目名称:pksampler-0.3,代码行数:52,代码来源:SampleControl.py
示例14: __init__
def __init__(self, *args):
self.super = super(self.__class__,self)
self.super.__init__(*args)
self.emitter = QObject()
self.selection = None
self.undoStack = UndoStack()
self.undoStackReadOnly = False
开发者ID:Sandy4321,项目名称:nltk_contrib,代码行数:7,代码来源:tableproxy.py
示例15: simulate
def simulate(self):
global _timer
if _timer: _timer.stop()
if not self.running:
self.running = 1
self.qApp.exit_loop()
return
self.runUntilCurrent()
# gah
timeout = self.timeout()
if timeout is None: timeout = 1.0
timeout = min(timeout, 0.1) * 1010
if not _timer:
_timer = QTimer()
QObject.connect( _timer, SIGNAL("timeout()"), self.simulate )
_timer.start(timeout, 1)
开发者ID:fxia22,项目名称:ASM_xf,代码行数:18,代码来源:qtreactor.py
示例16: __init__
def __init__(self, title, dataModelHandler, propertyDefinitionFactory, iconHandler):
"""
Constructor.
@param title: Name of edited data type if existing, "New_DataType" otherwise (at the same time a title from this dialog).
@type title: C{unicode}
"""
QObject.__init__(self)
self._dataModelHandler = dataModelHandler
self._propertyDefinitionFactory = propertyDefinitionFactory
self._iconHandler = iconHandler
self.__dataType = self._dataModelHandler.createDataType(title)
self.__title = title
self.__referenceTitle = title
self.__iconName = None
self.__propertyList = None
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:18,代码来源:data_type_dialog.py
示例17: __init__
def __init__(self, *what):
QObject.__init__(self)
pref = Internal.Preferences
if what[0] not in StateSaver.savers:
StateSaver.savers[what[0]] = self
what[0].installEventFilter(self)
self.widgets = []
for widget in what:
name = self.__generateName(widget)
self.widgets.append((name, widget))
pref.addString('States', name + 'State')
pref.addString('States', name + 'Geometry')
for name, widget in self.widgets:
stateFound = self.__restore(widget, name + 'State')
geometryFound = self.__restore(widget, name + 'Geometry')
if not stateFound and not geometryFound:
pref.addString('States', name)
self.__restore(widget, name)
开发者ID:KDE,项目名称:kajongg,代码行数:18,代码来源:statesaver.py
示例18: __init__
def __init__(self, title, dataModelHandler, iconHandler):
"""
Constructor.
@param title: Name of edited relation type if existing, "New_RelationType" otherwise (at the same time a title from this dialog).
@type title: C{unicode}
"""
QObject.__init__(self)
self._dataModelHandler = dataModelHandler
self._iconHandler = iconHandler
self.__relationType = self._dataModelHandler.createRelation(title)
self.__title = title
self.__referenceTitle = title
self.__iconName = None
self.__parentDataTypeList = None
self.__childDataTypeList = None
self.__availableDataTypeList = self._dataModelHandler.datatypes
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:18,代码来源:relation_type_dialog.py
示例19: __init__
def __init__(self, comboBox, table, currentKey=None, nullAllowed=False):
QObject.__init__(self)
self.comboBox=comboBox
self.key_to_index={}
self.index_to_key={}
if nullAllowed:
self.comboBox.insertItem("<None>")
self.key_to_index[None]=self.comboBox.count()-1
self.index_to_key[self.comboBox.count()-1]=None
for row in table:
self.comboBox.insertItem(row.getDescription())
primaryKey = row.getPrimaryKey()
self.key_to_index[primaryKey] = self.comboBox.count()-1
self.index_to_key[self.comboBox.count()-1] = primaryKey
if currentKey!=None:
self.setCurrentItem(currentKey)
self.connect(self.comboBox, SIGNAL("activated (int)"),
self.slotItemSelected)
self.comboBox.setAutoCompletion(True)
开发者ID:boudewijnrempt,项目名称:kura,代码行数:24,代码来源:comboproxy.py
示例20: __init__
def __init__(self, url):
KRun.__init__(self, KURL(url))
self.setAutoDelete(False)
krun.__savedInstances.append(self)
QObject.connect(self, SIGNAL("finished()"), self._slotExit)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:5,代码来源:util.py
注:本文中的qt.QObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论