Exemplo n.º 1
0
    def initializeInstance(self):
        # Remove BlissFramework application lockfile
        #self.guiConfiguration=qt.qApp.mainWidget().configuration

        if BlissFramework.get_gui_version() == "qt3":
            from qt import qApp
            self.guiConfiguration = qApp.mainWidget().configuration     
        elif BlissFramework.get_gui_version() == "qt4":
            from PyQt4.QtGui import QApplication
            for widget in QApplication.allWidgets():
                if hasattr(widget, 'configuration'):
                    self.guiConfiguration = widget.configuration
                    break
        else:
            logging.getLogger("HWR").error('InstanceServer: % gui version not supported' % \
                                            BlissFramework.get_gui_version())

        lockfilename=os.path.join(tempfile.gettempdir(), '.%s.lock' % BlissFramework.loggingName)
        
        try:
            os.unlink(lockfilename)
        except:
            pass
        self.emit('instanceInitializing', ())
        if self.isLocal():
            self.startServer()
        else:
            self.connectToServer()
Exemplo n.º 2
0
 def __areWidgetsAlive( widget1, widget2 ):
     " True, True if QT still has the widgets "
     first = False
     second = False
     for item in QApplication.allWidgets():
         if not first and item == widget1:
             first = True
             if second:
                 return first, second
         if not second and item == widget2:
             second = True
             if first:
                 return first, second
     return first, second
Exemplo n.º 3
0
 def __areWidgetsAlive(widget1, widget2):
     " True, True if QT still has the widgets "
     first = False
     second = False
     for item in QApplication.allWidgets():
         if not first and item == widget1:
             first = True
             if second:
                 return first, second
         if not second and item == widget2:
             second = True
             if first:
                 return first, second
     return first, second
Exemplo n.º 4
0
        if not self.guardado:
            msg = QMessageBox.critical(None, "Salir",
                                       u"Se perderán los datos actuales",
                                       QMessageBox.Ok | QMessageBox.Cancel)
            if msg == QMessageBox.Cancel:
                    event.ignore()
                    return

        for ventana in self.vent_grafico:
            if ventana is not None:
                ventana.destroy()

        event.accept()


app = QApplication(sys.argv)

main = Main()
main.show()

app.exec_()

for w in app.allWidgets():
    print(w.objectName(), w)





Exemplo n.º 5
0
                self.grafico[i].setData(
                    self.timestamp[0:self.sb.channel_pointer],
                    self.sb.channel_data[i][0:self.sb.channel_pointer])

    def closeEvent(self, event):

        if not self.guardado:
            msg = QMessageBox.critical(None, "Salir",
                                       u"Se perderán los datos actuales",
                                       QMessageBox.Ok | QMessageBox.Cancel)
            if msg == QMessageBox.Cancel:
                event.ignore()
                return

        for ventana in self.vent_grafico:
            if ventana is not None:
                ventana.destroy()

        event.accept()


app = QApplication(sys.argv)

principal = Principal()
principal.show()

app.exec_()

for w in app.allWidgets():
    print(w.objectName(), w)