def wraith(): matplotlib.rcParams['mathtext.fontset'] = 'stixsans' app = QCoreApplication.instance() app.form = Form() #style choices common to both modes QApplication.setStyle(QStyleFactory.create('Plastique')) QApplication.setPalette(QApplication.style().standardPalette()) #do it app.form.show()
def main(): matplotlib.rcParams['mathtext.fontset'] = 'stixsans' app = QApplication(sys.argv) form = Form() #style choices common to both modes QApplication.setStyle(QStyleFactory.create('Plastique')) QApplication.setPalette(QApplication.style().standardPalette()) #do it form.show() app.exec_()
def __init__(self, parent=None): QApplication.setStyle(QStyleFactory.create("Plastique")) QApplication.setPalette(QApplication.style().standardPalette()) super(MainWindow, self).__init__(None) centralwidget = QWidget(self) self.setCentralWidget(centralwidget) self.layout = QVBoxLayout(centralwidget) button = QPushButton("Set WSDL Address") button.clicked.connect(self.request_wsdl) self.layout.addWidget(button) self.toolbox = QToolBox() self.layout.addWidget(self.toolbox) self.url = ""
def log(msg, level, msgbox=False, parent="auto", stack=None): """docstring for error""" if stack is None: stack = inspect.stack()[1][0] #print inspect.stack() #print stack #print inspect.getmodule(stack) if inspect.getmodule(stack) is None: mod = inspect.stack()[1][1] else: mod = inspect.getmodule(stack).__name__ lineno = stack.f_lineno if mod == "__main__": mod = "__main__:" + os.path.basename(__main__.__file__) logging.log(level, msg, extra={"mod": mod, "line": lineno}) if msgbox: if parent == "auto": qapp = QApplication.instance() if qapp is None: qapp = QApplication([]) qapp.setStyle(QStyleFactory.create("plastique") ) palette = QPalette(QColor(62, 62, 62), QColor(62, 62, 62)) palette.setColor(palette.Highlight, QColor(255*0.6, 198*0.6, 0)) qapp.setPalette(palette) parent = qapp.activeWindow() if level == logging.DEBUG: QMessageBox.info(parent, logging.getLevelName(level).capitalize(), msg) elif level == logging.INFO: QMessageBox.information(parent, logging.getLevelName(level).capitalize(), msg) elif level == logging.WARNING: QMessageBox.warning(parent, logging.getLevelName(level).capitalize(), msg) elif level == logging.ERROR: QMessageBox.critical(parent, logging.getLevelName(level).capitalize(), msg) elif level == logging.CRITICAL: QMessageBox.critical(parent, logging.getLevelName(level).capitalize(), msg)