How to use the taurus.external.qt.Qt.QApplication function in taurus

To help you get started, we’ve selected a few taurus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sardana-org / sardana / src / sardana / taurus / qt / qtgui / extra_hkl / reflectionslist.py View on Github external
def main():
    app = Qt.QApplication(sys.argv)
    w = ReflectionsList()
    w.show()
    sys.exit(app.exec_())
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / extra_nexus / taurusnexuswidget.py View on Github external
ret = TaurusWidget.getQtDesignerPluginInfo()
        ret['module'] = 'taurus.qt.qtgui.extra_nexus'
        ret['icon'] = ":/designer/listview.png"
        ret['container'] = False
        ret['group'] = 'Taurus Views'
        return ret
    
    
        
if __name__ == "__main__":
    import sys
    if len(sys.argv) >1:
        fname = sys.argv[1]
    else:
        fname=None
    app = Qt.QApplication(sys.argv)
    w = TaurusNeXusBrowser()
    w.openFile(fname)
    w.show()
    sys.exit(app.exec_())
github sardana-org / sardana / taurus / doc / source / devel / examples / label05.py View on Github external
import sys
from taurus.external.qt import Qt
from taurus.qt.qtgui.display import TaurusStateLabel

app = Qt.QApplication(sys.argv)
panel = Qt.QWidget()
w = TaurusStateLabel(panel)
w.setModel('sys/taurustest/1/state')
panel.show()

sys.exit(app.exec_())
github taurus-org / taurus / lib / taurus / qt / qtgui / help / assistant.py View on Github external
def main():
    import sys

    app = Qt.QApplication([])
    window = Qt.QWidget()
    layout = Qt.QHBoxLayout(window)
    goButton = Qt.QPushButton("Activate help", window)
    terminateButton = Qt.QPushButton("Close help", window)
    textEdit = Qt.QLineEdit(window)
    layout.addWidget(textEdit)
    layout.addWidget(goButton)
    layout.addWidget(terminateButton)

    def go():
        assistant = Assistant(textEdit.text(), parent=window)
        assistant.start()
        assistant.waitForStarted()
        assistant.assistantShow(Widgets.bookmarks)

    def terminate():
github taurus-org / taurus / lib / taurus / qt / qtgui / display / qled.py View on Github external
def tr(self, string):
        return Qt.QApplication.translate("Led", string, None, Qt.QApplication.UnicodeUTF8)
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / display / qled.py View on Github external
def main():
    """hello"""
    
    app = Qt.QApplication.instance()
    owns_app = app is None
    
    if owns_app:
        app = Qt.QApplication(sys.argv)
        
    w = Qt.QWidget()
    layout = Qt.QGridLayout()
    layout.setContentsMargins(2, 2, 2, 2)
    layout.setSpacing(2)
    w.setLayout(layout)
    for i, color in enumerate(LedColor.keys()):
        led = QLed()
        led.ledColor = color
        led.ledStatus = True
        layout.addWidget(led, i, 0)
        led = QLed()
        led.ledColor = color
        led.ledStatus = False
        layout.addWidget(led, i, 1)
        led = QLed()
github taurus-org / taurus / lib / taurus / qt / qtgui / container / qcontainer.py View on Github external
panelLayout.setMargin(0)
        self.setLayout(panelLayout)

        self._titleBar = titleBar = Qt.QFrame()
        panelLayout.addWidget(titleBar, 0)

        l = Qt.QHBoxLayout()
        l.setMargin(2)
        l.setSpacing(2)
        self._titleBar.setLayout(l)

        self._titleButton = Qt.QToolButton()
        self._titleButton.setStyleSheet("border: 0px")
        styleOption = Qt.QStyleOption()
        styleOption.initFrom(self._titleButton)
        style = Qt.QApplication.style()
        icon = style.standardIcon(
            Qt.QStyle.SP_DesktopIcon, styleOption, self._titleButton)
        self._titleButton.setIcon(icon)
        self._titleLabel = Qt.QLabel()
        self._upDownButton = Qt.QToolButton()
        self._upDownButton.setStyleSheet("border: 0px")
        self._upDownButton.clicked.connect(self.switchContentVisible)
        l.addWidget(self._titleButton, 0)
        l.addWidget(self._titleLabel, 1)
        l.addWidget(self._upDownButton, 0)

        self._content = content = ContentFrame()
        l = Qt.QHBoxLayout()
        l.setContentsMargins(0, 0, 0, 0)
        content.setLayout(l)
        panelLayout.addWidget(content, 1)
github taurus-org / taurus / lib / taurus / qt / qtgui / image / taurusqub.py View on Github external
def main():
    import sys
    import taurus.core.tango.img
    taurus.core.tango.img.registerExtensions()

    app = Qt.QApplication(sys.argv)
    models = sys.argv[1:]
    panel = Qt.QWidget()
    l = Qt.QHBoxLayout()
    panel.setLayout(l)
    if not models:
        from taurus.qt.qtgui.panel import TaurusModelChooser
        models, ok = TaurusModelChooser.modelChooserDlg(
            panel, [taurus.core.taurusbasetypes.TaurusElementType.Attribute])
        if not ok:
            models = []
    for model in models:
        w = TaurusQubDataImageDisplay()
        w.setModel(model)
        l.addWidget(w)

    panel.setVisible(True)
github taurus-org / taurus / lib / taurus / qt / qtgui / util / tauruswidgetfactory.py View on Github external
def _buildWidgets(self, module_name, path, recursive=True):
        import taurus.qt.qtgui.base

        if Qt.QApplication.instance() is None:
            app = Qt.QApplication([])

        elems = os.listdir(path)
        taurus_ret, qt_ret = {}, {}
        if not '__init__.py' in elems:
            return taurus_ret, qt_ret

        try:
            m = __import__(module_name, fromlist=['*'], level=0)
            dir_names = dir(m)
            for dir_name in dir_names:
                if dir_name.startswith("_"):
                    continue
                try:
                    attr = getattr(m, dir_name)
                    if issubclass(attr, Qt.QWidget):
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / panel / taurusvalue.py View on Github external
return None  
    

    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    # QT properties 
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
   
    model = Qt.pyqtProperty("QStringList", getModel, setModel, resetModel)


#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if __name__ == "__main__":
    
    import sys

    app = Qt.QApplication(sys.argv)
    form = Qt.QMainWindow()
    #ly=Qt.QVBoxLayout(form)
    #container=Qt.QWidget()
#    container = TaurusValuesFrame()
    from taurus.qt.qtgui.panel import TaurusForm
    container = TaurusForm()
    #ly.addWidget(container)
    form.setCentralWidget(container)

    try:
        from taurus.qt.qtgui.extra_pool import PoolMotorSlim, PoolChannel
        container.setCustomWidgetMap({'SimuMotor':PoolMotorSlim,
                                'Motor':PoolMotorSlim,
                                'PseudoMotor':PoolMotorSlim,
                                'PseudoCounter':PoolChannel,
                                'CTExpChannel':PoolChannel,