Exemple #1
0
 def get_products(self):
     """
                     Get the list of all products in the database
     :return: products_list
     """
     from utils.database_utils import DatabaseConnect
     db = DatabaseConnect()
     self.products_list, self.productId_list = db.get_products(window=self.temp_window)
     return self.products_list
    def load_products_list(self):
        """
                    Creates the items of list widget to display the list of products on the window
        :return:
        """
        db = DatabaseConnect()
        self.products_list, self.productId_list, self.isEvaluated_list, self.products_dict_list = db.get_products(
            evaluate=True, window=self.temp_window)
        self.listWidget = QListWidget()
        self.btn_reset.setDisabled(True)

        index = 0
        for item in self.productId_list:
            listitem = QListWidgetItem()
            listitem.setText(self.products_list[index])
            listitem.setData(3, item)
            listitem.setData(4, self.isEvaluated_list[index])
            index += 1
            self.listWidget.addItem(listitem)
        self.listWidget.itemActivated.connect(self.list_item_event)
        self.listWidget.itemClicked.connect(self.list_item_event)
        self.scrollArea.setWidget(self.listWidget)