
| Current Path : /proc/thread-self/root/home/ift/52_procpy/dataninja/test/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/home/ift/52_procpy/dataninja/test/qtgraphmodel.py |
import os,re,sys,time
from PyQt5.QtWidgets import QApplication, QWidget, QProgressBar, QPushButton, QFrame, QGridLayout, QGraphicsView, QGraphicsScene, QGraphicsRectItem
from PyQt5.QtCore import QTimer
from procpy.modeler.graphmodel import Graphmodel
import PyQt5
#**************************************************************************
class GraphmodelTest (object):
def __init__ (self,*pars):
self.__class__.__dict__[pars[0]](self,pars[1:])
#**************************************************************************
def example1 (self,*pars):
app = QApplication(sys.argv)
gwidget = QFrame()
glayout = QGridLayout()
gwidget.setLayout(glayout)
gwidget1 = QWidget()
gwidget1.setStyleSheet("background-color: yellow")
self.box = QWidget(gwidget1)
self.box.setStyleSheet("background-color: blue")
self.box.resize(50,35)
self.box.move(20,20)
gwidget2 = QFrame()
gwidget2.setStyleSheet("background-color: green")
gwidget.setGeometry(300,200,200,300)
glayout.addWidget(gwidget1,0,0)
glayout.addWidget(gwidget2,1,0)
gwidget.show()
self.qtimer = QTimer()
self.qtimer.singleShot(2000,self.example1_red)
sys.exit(app.exec_())
def example1_red (self):
self.box.setStyleSheet("background-color: red")
self.qtimer.singleShot(600,self.example1_blue)
def example1_blue (self):
self.box.setStyleSheet("background-color: blue")
self.qtimer.singleShot(300,self.example1_red)
#**************************************************************************
def qtm1 (self,*pars):
app = QApplication(sys.argv)
gwidget = QGraphicsView(None)
gwidget.setGeometry(40,40,400,400)
gwidget.setStyleSheet("background-color: white")
scene = Graphmodel(None,0,0,400,300)
gwidget.setScene( scene ) # Graphmodel(None,0,0,400,300) )
gwidget.show()
sys.exit(app.exec_())
#**************************************************************************
if __name__ == "__main__":
GraphmodelTest(*tuple(sys.argv[1:]))