Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
8db487eb
Kaydet (Commit)
8db487eb
authored
Kas 12, 2008
tarafından
Gökmen Göksel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* Damadın dayısından Qt4 örneği ..
üst
252fca79
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
0 deletions
+81
-0
Makefile
api/examples/qt4/Makefile
+2
-0
app.py
api/examples/qt4/app.py
+47
-0
mainform.ui
api/examples/qt4/mainform.ui
+32
-0
No files found.
api/examples/qt4/Makefile
0 → 100644
Dosyayı görüntüle @
8db487eb
all
:
pyuic4 mainform.ui
-o
mainform.py
api/examples/qt4/app.py
0 → 100755
Dosyayı görüntüle @
8db487eb
#!/usr/bin/python
# -*- 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
()
self
.
ui
.
setupUi
(
self
)
# 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
self
.
link
.
System
.
Service
.
info
(
async
=
self
.
handleServices
)
def
main
():
app
=
QtGui
.
QApplication
(
sys
.
argv
)
DBusQtMainLoop
(
set_as_default
=
True
)
win
=
Window
()
win
.
show
()
sys
.
exit
(
app
.
exec_
())
if
__name__
==
"__main__"
:
main
()
api/examples/qt4/mainform.ui
0 → 100644
Dosyayı görüntüle @
8db487eb
<ui version="4.0" >
<class>mainForm</class>
<widget class="QWidget" name="mainForm" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>459</width>
<height>343</height>
</rect>
</property>
<property name="windowTitle" >
<string>Qt4 & COMAR</string>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QTextEdit" name="textServices" />
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="buttonServices" >
<property name="text" >
<string>Get Services</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections/>
</ui>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment