Exemplo n.º 1
0
class QuickViewCtrlWidget(QtWidgets.QWidget):
    def __init__(self, parent=None):
        super(QuickViewCtrlWidget, self).__init__()
        uic.loadUi(
            os.path.join(os.path.dirname(__file__), 'node_quickview.ui'), self)
        self._parent = parent
        self.initUI()
        self.pushButton_viewPlot.setEnabled(False)

    def initUI(self):
        #self.tableView_header = QtWidgets.QTableView()  # already set in the *.ui file
        self.tableView = TableView(parent=self)
        self.twWindow = None
        self.update()

    def setModels(self):
        """ Set already created models to node's widgets:
                (1) - set header model to `self.tableView_header` (MENU)
                (2) - set data table model to `self.tableView` (DATA)
        """
        #logger.debug( "setModels()")
        modelsAreSet = True
        if self.parent().getPandasDataModel() is not None:
            try:
                self.tableView_header.setModel(
                    self.parent().getPandasHeaderModel())
                if self.parent().getPandasHeaderModel().df.empty:
                    modelsAreSet &= False
            except Exception, err:
                modelsAreSet &= False
                traceback.print_exc()
                logger.info(
                    "QuickViewCtrlWidget: Unnable to set QlistView model (Selection-Menu)"
                )
            try:
                self.tableView.setModel(self.parent().getPandasDataModel())
                if self.parent().getPandasDataModel().df.empty:
                    modelsAreSet &= False
            except Exception, err:
                modelsAreSet &= False
                traceback.print_exc()
                logger.info(
                    "QuickViewCtrlWidget: Unnable to set QtableView model (Data-Table-View"
                )
Exemplo n.º 2
0
class QuickViewCtrlWidget(QtWidgets.QWidget):
    def __init__(self, parent=None):
        super(QuickViewCtrlWidget, self).__init__()
        uic.loadUi(os.path.join(os.path.dirname(__file__), 'node_quickview.ui'), self)
        self._parent = parent
        self.initUI()
        self.pushButton_viewPlot.setEnabled(False)


    def initUI(self):
        #self.tableView_header = QtWidgets.QTableView()  # already set in the *.ui file
        self.tableView = TableView(parent=self)
        self.twWindow  = None
        self.update()

    def setModels(self):
        """ Set already created models to node's widgets:
                (1) - set header model to `self.tableView_header` (MENU)
                (2) - set data table model to `self.tableView` (DATA)
        """
        #logger.debug( "setModels()")
        modelsAreSet = True
        if self.parent().getPandasDataModel() is not None:
            try:
                self.tableView_header.setModel(self.parent().getPandasHeaderModel())
                if self.parent().getPandasHeaderModel().df.empty:
                    modelsAreSet &= False
            except Exception, err:
                modelsAreSet &= False
                traceback.print_exc()
                logger.info("QuickViewCtrlWidget: Unnable to set QlistView model (Selection-Menu)")
            try:
                self.tableView.setModel(self.parent().getPandasDataModel())
                if self.parent().getPandasDataModel().df.empty:
                    modelsAreSet &= False
            except Exception, err:
                modelsAreSet &= False
                traceback.print_exc()
                logger.info("QuickViewCtrlWidget: Unnable to set QtableView model (Data-Table-View")
Exemplo n.º 3
0
 def initUI(self):
     #self.tableView_header = QtWidgets.QTableView()  # already set in the *.ui file
     self.tableView = TableView(parent=self)
     self.twWindow = None
     self.update()
Exemplo n.º 4
0
 def initUI(self):
     #self.tableView_header = QtWidgets.QTableView()  # already set in the *.ui file
     self.tableView = TableView(parent=self)
     self.twWindow  = None
     self.update()