Commits

cuciferus committed 62f0878

acu evauluarea deschide analize si sa inchide
si dupa ce sa inchid analizele reapare evaluarea
asta cu QMainWindow si QDialog

Comments (0)

Files changed (7)

         QtGui.QDialog.__init__(self,parent)
         self.setWindowTitle('Analize '+self.nume)
         self.cnp=cnp
+        self.parent=parent
 
         self.centralWidget=QtGui.QWidget(self)
         self.setObjectName('Analize')
         self.test=QtGui.QDockWidget('grafic',self)
         self.test.setFloating(True)
+        self.test.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea |\
+            QtCore.Qt.RightDockWidgetArea|QtCore.Qt.BottomDockWidgetArea)
 
 
 
         self.connect(self.adaugaPrinteaza,QtCore.SIGNAL('clicked()'),lambda:self.baga_analize(1))
         self.connect(self.evaluari,QtCore.SIGNAL('currentIndexChanged(int)'),self.populeaza)
         self.connect(self.bagaAltaAnaliza,QtCore.SIGNAL('clicked()'),self.alteAnalize)
+        self.parent.hide()
         self.show()
-    def closeEvent(self):
+    def closeEvent(self,event):
+        self.test.close()
+        self.parent.show()
+
        #aici tre sa refac dialogu dinainte 
-       pass
 
     def focusin(self):
         print QtGui.QApplication.focusWidget().objectName

analize.pyc

Binary file modified.
 from PyQt4 import QtCore
 from PyQt4 import QtSql
 from test import Analize_widget, Recomandari
+#from main import Evaluare
 from math import pow
 
 class DataDelegate(QtGui.QStyledItemDelegate):
         self.setObjectName('Analize')
         self.test=QtGui.QDockWidget('grafic',self)
         self.test.setFloating(True)
+        self.test.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea |\
+            QtCore.Qt.RightDockWidgetArea|QtCore.Qt.BottomDockWidgetArea)
 
 
 
         self.connect(self.adaugaPrinteaza,QtCore.SIGNAL('clicked()'),lambda:self.baga_analize(1))
         self.connect(self.evaluari,QtCore.SIGNAL('currentIndexChanged(int)'),self.populeaza)
         self.connect(self.bagaAltaAnaliza,QtCore.SIGNAL('clicked()'),self.alteAnalize)
+        self.parent.hide()
         self.show()
-    def closeEvent(self):
+    def closeEvent(self,event):
+        self.test.close()
+        self.parent.show()
+
        #aici tre sa refac dialogu dinainte 
 
     def focusin(self):
         layout.addWidget(self.adaugaEvaluare_sga)
         layout.addWidget(self.adaugaEvaluare_adresa)
         self.centralWidget.setLayout(layout)
+        self.layout=QtGui.QGridLayout()
+        self.layout.addWidget(self.centralWidget)
+        self.setLayout(self.layout)
         self.connect(self.adauga, QtCore.SIGNAL('clicked()'), self.pacient)
         self.connect(self.cautat,QtCore.SIGNAL('textChanged(const QString &)'), self.textChangedHandler)
         #self.connect(self.cautat,QtCore.SIGNAL('returnPressed()'),self.cauta,QtCore.SLOT('click()'))
             cnp=continut[0].text().split('\t')[1]
         else:
             a=QtGui.QErrorMessage(self)
-            a.showMessage(QtCore.QString('selecteazasi tu pa cineva sau adauga\
+            a.showMessage(QtCore.QString('selecteaza si tu pa cineva sau adauga\
             pacient'))
             a.exec_()
             return
 
         if tip=="pre":
-            self.hide()
+            #self.hide()
             self.analize=Analize(self.query,nume,cnp,self)
-            
-            self.show()
+            #self.show()
+
         if tip=="sga":
             self.hide()
             self.sga=SGA(self.query,nume,cnp,self)
         layout.addWidget(self.adaugaEvaluare_sga)
         layout.addWidget(self.adaugaEvaluare_adresa)
         self.centralWidget.setLayout(layout)
+        self.layout=QtGui.QGridLayout()
+        self.layout.addWidget(self.centralWidget)
+        self.setLayout(self.layout)
         self.connect(self.adauga, QtCore.SIGNAL('clicked()'), self.pacient)
         self.connect(self.cautat,QtCore.SIGNAL('textChanged(const QString &)'), self.textChangedHandler)
         #self.connect(self.cautat,QtCore.SIGNAL('returnPressed()'),self.cauta,QtCore.SLOT('click()'))
             cnp=continut[0].text().split('\t')[1]
         else:
             a=QtGui.QErrorMessage(self)
-            a.showMessage(QtCore.QString('selecteazasi tu pa cineva sau adauga\
+            a.showMessage(QtCore.QString('selecteaza si tu pa cineva sau adauga\
             pacient'))
             a.exec_()
             return
 
         if tip=="pre":
             self.hide()
-            self.analize=Analize(self.query,nume,cnp)
-            
+            self.analize=Analize(self.query,nume,cnp,self)
             self.show()
+
         if tip=="sga":
             self.hide()
             self.sga=SGA(self.query,nume,cnp,self)
     a.show()
     sys.exit(app.exec_())
 
-class Recomandari(QtGui.QTextEdit):
+class Recomandari(QtGui.QTextBrowser):
     def __init__(self,parent=None):
         QtGui.QTextEdit.__init__(self,parent)
     def contextMenuEvent(self,event):
Binary file modified.