def onAbout(self): msgBox = QMessageBox(self) msgBox.setIconPixmap(QPixmap(":/images/sherlock.png")) msgBox.setWindowTitle(_translate("MainWindow", "Pythonthusiast", None)) msgBox.setText(_translate("MainWindow", "Well Watson, isn't it obvious to you that Qt rocks?", None)) msgBox.setStandardButtons(QMessageBox.Ok) msgBox.exec_()
def choose_color(): color = QColorDialog().getColor() msgbox = QMessageBox() if color.isValid(): pixmap = QPixmap(50, 50) pixmap.fill(color) msgbox.setWindowTitle(u'Selected Color') msgbox.setIconPixmap(pixmap) else: msgbox.setWindowTitle(u'No Color was Selected') msgbox.exec_()
def choose_color(): # Select color color = QColorDialog().getColor() # Report about result of selection in QMessageBox dialog msgbox = QMessageBox() if color.isValid(): # Create a memory image 50x50 filled with selected color to display # as a icon in the msgbox dialog pixmap = QPixmap(50, 50) pixmap.fill(color) msgbox.setWindowTitle(u'Selected Color') msgbox.setIconPixmap(pixmap) else: msgbox.setWindowTitle(u'No Color was Selected') msgbox.exec_()
def process_clicked(self): dict_result = {} list_file_name = [] for index in xrange(self.ui.listWidget.count()): arquivo = self.ui.listWidget.item(index).text() list_file_name.append(arquivo) list_of_tuples_mass_and_windows = [] for index in xrange(self.ui.treeWidget.topLevelItemCount()): item = self.ui.treeWidget.topLevelItem(index) list_of_tuples_mass_and_windows.append( (float(item.text(0)), float(item.text(1)), float(item.text(2).split(",")[0]), str(item.text(2).split(",")[1]))) list_of_tuples_mass_and_windows_thresould = self.RemoveRepetidosLista( list_of_tuples_mass_and_windows) find_peaks = ImportThermoFile( list_of_tuples_mass_and_windows_thresould, list_file_name, dict_result) find_peaks.start() find_peaks.join() icon_reader = QIcon(":/icons/images/find.png") icon_readerII = QPixmap(":/icons/images/find.png") message = QMessageBox() if len(dict_result.keys()) > 0: try: MzMatches_To_Report(dict_result) message.setIconPixmap(icon_readerII) message.setText('Success') message.setWindowIcon(icon_reader) message.setWindowTitle("Success") message.exec_() except: message.setIconPixmap(icon_readerII) message.setText('Ups something went wrong') message.setWindowIcon(icon_reader) message.setWindowTitle("Success") message.exec_() else: message.setIconPixmap(icon_readerII) message.setText('Sorry no matches found') message.setWindowIcon(icon_reader) message.setWindowTitle("No matches") message.exec_()