def __init__(self, parent = None):
     QSlider.__init__(self, QtCore.Qt.Horizontal, parent)
     self.rangeChanged.connect(self.updateRange)
     self.sliderReleased.connect(self.movePressedHandle)
     
     self.setStyle(QStyleFactory.create('Plastique'))
     
     
     self.floatMin = 0
     self.floatMax = 0
     self.floatStep = 0
     
     self.lower = 0
     self.upper = 0
     self.lowerPos = 0
     self.upperPos = 0
     self.offset = 0
     self.position = 0
     self.lastPressed = QxtSpanSlider.NoHandle
     self.upperPressed = QStyle.SC_None
     self.lowerPressed = QStyle.SC_None
     self.movement = QxtSpanSlider.FreeMovement
     self.mainControl = QxtSpanSlider.LowerHandle
     self.firstMovement = False
     self.blockTracking = False
     p = self.palette()
     p.setColor(QPalette.Dark, QtGui.QColor('black'))
     self.setPalette(p)
     self.gradientLeft = self.palette().color(QPalette.Dark).lighter(100)
     self.gradientRight = self.palette().color(QPalette.Dark).darker(200)
Example #2
0
File: gui.py Project: tinavas/FSERP
 def eventFilter(self, obj, event):
     if event.type() == QEvent.Paint:
         obj.setStyle(QStyleFactory.create('Windows'))
         p = QStylePainter(obj)
         tab = QStyleOptionTabV3()
         # selected = obj.currentIndex()
         for idx in range(obj.count()):
             obj.initStyleOption(tab, idx)
             if idx == 0:
                 bg_color = QColor('#ADEBFF')
                 fg_color = QColor('black')
             elif idx == 1:
                 bg_color = QColor('#6CBED2')
                 fg_color = QColor('black')
             elif idx == 2:
                 bg_color = QColor('#0099CC')
                 fg_color = QColor('black')
             elif idx == 3:
                 bg_color = QColor('#297ACC')
                 fg_color = QColor('black')
             elif idx == 4:
                 bg_color = QColor('#006BB2')
                 fg_color = QColor('black')
             elif idx == 5:
                 bg_color = QColor('#003D7A')
                 fg_color = QColor('black')
             tab.palette.setColor(QPalette.Window, bg_color)
             tab.palette.setColor(QPalette.WindowText, fg_color)
             p.drawControl(QStyle.CE_TabBarTab, tab)
         return True
     else:
         # standard event processing
         return QObject.eventFilter(self, obj, event)
Example #3
0
    def testSetStyle(self):
        '''All this test have to do is not break with some invalid Python wrapper.'''
        def setStyleHelper(widget, style):
            widget.setStyle(style)
            widget.setPalette(style.standardPalette())
            for child in widget.children():
                if isinstance(child, QWidget):
                    setStyleHelper(child, style)

        container = QWidget()
        # QFontComboBox is used because it has an QLineEdit created in C++ inside it,
        # and if the QWidget.setStyle(style) steals the ownership of the style
        # for the C++ originated widget everything will break.
        fontComboBox = QFontComboBox(container)
        label = QLabel(container)
        label.setText('Label')
        style = QStyleFactory.create(QStyleFactory.keys()[0])
        setStyleHelper(container, style)
Example #4
0
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()
Example #5
0
    def testSetStyle(self):
        '''All this test have to do is not break with some invalid Python wrapper.'''

        def setStyleHelper(widget, style):
            widget.setStyle(style)
            widget.setPalette(style.standardPalette())
            for child in widget.children():
                if isinstance(child, QWidget):
                    setStyleHelper(child, style)

        container = QWidget()
        # QFontComboBox is used because it has an QLineEdit created in C++ inside it,
        # and if the QWidget.setStyle(style) steals the ownership of the style
        # for the C++ originated widget everything will break.
        fontComboBox = QFontComboBox(container)
        label = QLabel(container)
        label.setText('Label')
        style = QStyleFactory.create(QStyleFactory.keys()[0])
        setStyleHelper(container, style)
Example #6
0
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 = ""
Example #8
0
def main():
    """ Entry point of application

    """
    configure_logs("admin")
    args = configure_commandline_args()
    set_log_level(args.log_level)

    LOGGER.info("Application started")
    app = QApplication(sys.argv)
    # App window style options can be get by printing QStyleFactory.keys()
    QApplication.setStyle(QStyleFactory.create("GTK+"))  # Set style of Heater App to GTK
    app.setStyleSheet(STYLESHEET)
    flow_nvs_file = os.path.join(os.path.dirname(__file__), os.pardir, "libflow",
                                 "admin-libflow-nvs")
    flow_set_nvs_file(flow_nvs_file)
    dummy_controller = AdminController()
    sys.exit(app.exec_())
Example #9
0
def main():
    """ Entry point of application

    """
    configure_logs("display")
    args = configure_commandline_args()
    set_log_level(args.log_level)

    LOGGER.info("Application started")
    app = QApplication(sys.argv)
    # App window style options can be get by printing QStyleFactory.keys()
    QApplication.setStyle(QStyleFactory.create("GTK+"))  # Set style of Heater App to GTK
    app.setStyleSheet(STYLESHEET)
    flow_nvs_file = os.path.join(os.path.dirname(__file__), os.pardir, "libflow",
                                 "display-libflow-nvs")
    flow_set_nvs_file(flow_nvs_file)
    # DisplayController instance get deleted if dummy_controller reference is not used
    dummy_controller = DisplayController()
    sys.exit(app.exec_())
Example #10
0
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)
Example #11
0
from PySide.QtNetwork import QNetworkRequest ,\
    QNetworkAccessManager ,\
    QNetworkCookie , \
    QNetworkCookieJar, \
    QNetworkRequest

from PySide import QtCore
from PySide import QtGui 



import dbc_client3


app = QtGui.QApplication(sys.argv)
QApplication.setStyle(QStyleFactory.create('Cleanlooks'))

class Robot(object):
    
    def __init__(self):
        self.view = QWebView() 
        self.page = self.view.page()
        
    def start(self):
        self.view.show()
        QtCore.QObject.connect(self.view, 
                               QtCore.SIGNAL("loadFinished(bool)"), 
                               self.loaded)                            
        self.view.load(QUrl('https://login.yahoo.com/config/login_verify2?&.src=ym'))
    
    def loaded(self):
Example #12
0
            [self.db.get('/fault/{}'.format(k), 0) for k in self.faults])
        self.ui.faults_label.setStyleSheet(alert_style if alert else '')

        alert = any([
            self.db.get('/simulate/{}'.format(k), 0) for k in self.simulations
        ])
        self.ui.simulation_label.setStyleSheet(alert_style if alert else '')

    def _put_checkbox(self, key, checkbox):
        self.sync.put(key, checkbox.isChecked())
        checkbox.blockSignals(True)
        checkbox.setChecked(not checkbox.isChecked())
        checkbox.blockSignals(False)

    def _ui(self, name):
        return getattr(self.ui, name)


if __name__ == '__main__':
    from PySide.QtGui import QApplication, QStyleFactory

    app = QApplication([])
    app.setApplicationName('ARC Reactor')
    app.setStyle(QStyleFactory.create('fusion'))

    window = FrontPanel()
    window.show()

    from .sync import exec_async
    exec_async(app)