Kaydet (Commit) 8db487eb authored tarafından Gökmen Göksel's avatar Gökmen Göksel

* Damadın dayısından Qt4 örneği ..

üst 252fca79
pyuic4 mainform.ui -o mainform.py
# -*- coding: utf-8 -*-
import sys
import comar
import mainform
from PyQt4 import QtGui
from PyQt4.QtCore import *
from dbus.mainloop.qt import DBusQtMainLoop
class Window(QtGui.QWidget):
def __init__(self, *args):
QtGui.QWidget.__init__(self, None)
# Create ui
self.ui = mainform.Ui_mainForm()
# Call Comar
self.link = comar.Link()
# Connect button click event to getServices method
self.connect(self.ui.buttonServices, SIGNAL("clicked()"), self.getServices)
def handleServices(self, package, exception, results):
# Handle request and fill the textEdit in ui
if not exception:
serviceName, serviceDesc, serviceState = results
self.ui.textServices.append("%s - %s - %s - %s" % (package, serviceName, serviceDesc, serviceState))
def getServices(self):
# Get service list from comar link
def main():
app = QtGui.QApplication(sys.argv)
DBusQtMainLoop(set_as_default = True)
win = Window()
if __name__ == "__main__":
<ui version="4.0" >
<widget class="QWidget" name="mainForm" >
<property name="geometry" >
<property name="windowTitle" >
<string>Qt4 &amp; COMAR</string>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QTextEdit" name="textServices" />
<item row="1" column="0" >
<widget class="QPushButton" name="buttonServices" >
<property name="text" >
<string>Get Services</string>
<layoutdefault spacing="6" margin="11" />
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment