How to use the taurus.external.qt.Qt.pyqtProperty 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 taurus-org / taurus / lib / taurus / qt / qtgui / plot / taurustrend.py View on Github external
'''
        self._scrollStep = scrollStep
        
    def getScrollStep(self):
        '''returns the value of the scroll step
        
        :return: (float)
        '''
        return self._scrollStep 
    
    def resetScrollStep(self):
        '''equivalent to setScrollStep(0.2)'''
        self.setScrollStep(0.2)
    
    useArchiving = Qt.pyqtProperty("bool", getUseArchiving, setUseArchiving, resetUseArchiving)
    usePollingBuffer = Qt.pyqtProperty("bool", getUsePollingBuffer, setUsePollingBuffer, resetUsePollingBuffer)
    maxDataBufferSize = Qt.pyqtProperty("int", getMaxDataBufferSize, setMaxDataBufferSize, resetMaxDataBufferSize)
    scrollstep = Qt.pyqtProperty("double", getScrollStep, setScrollStep, resetScrollStep)
    forcedReadingPeriod = Qt.pyqtProperty("int", getForcedReadingPeriod, setForcedReadingPeriod, resetForcedReadingPeriod)
    
    

def test():
    import sys
    import taurus.qt.qtgui.application
    app = taurus.qt.qtgui.application.TaurusApplication()
    w=Qt.QWidget()
    w.setLayout(Qt.QVBoxLayout())
    s=Qt.QSplitter()
    w.layout().addWidget(s)
    t=TaurusTrend()
    l=Qt.QLabel('asdasdasdasdasd')
github taurus-org / taurus / lib / taurus / qt / qtgui / panel / taurusmodelchooser.py View on Github external
layout.addWidget(w)
        dlg.setLayout(layout)
        w.updateModels.connect(dlg.accept)
        dlg.exec_()
        return w.getListedModels(asMimeData=asMimeData), (dlg.result() == dlg.Accepted)

    @classmethod
    def getQtDesignerPluginInfo(cls):
        ret = TaurusWidget.getQtDesignerPluginInfo()
        ret['module'] = 'taurus.qt.qtgui.panel'
        ret['icon'] = "designer:listview.png"
        ret['container'] = False
        ret['group'] = 'Taurus Views'
        return ret

    singleModelMode = Qt.pyqtProperty(
        "bool", isSingleModelMode, setSingleModelMode, resetSingleModelMode)


def main(args):
    if len(sys.argv) > 1:
        host = sys.argv[1]
    else:
        host = None

    app = Qt.QApplication(args)
    print(TaurusModelChooser.modelChooserDlg(host=host))
    sys.exit()

if __name__ == "__main__":
    main(sys.argv)
github taurus-org / taurus / lib / taurus / qt / qtgui / display / tauruslcd.py View on Github external
#: .. seealso:: :ref:`model-concept`
    useParentModel = Qt.pyqtProperty("bool", TaurusBaseWidget.getUseParentModel,
                                     TaurusBaseWidget.setUseParentModel,
                                     TaurusBaseWidget.resetUseParentModel)

    #: This property holds the index inside the model value that should be
    #: displayed
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`TaurusLCD.getModelIndex`
    #:     * :meth:`TaurusLCD.setModelIndex`
    #:     * :meth:`TaurusLCD.resetModelIndex`
    #:
    #: .. seealso:: :ref:`model-concept`
    modelIndex = Qt.pyqtProperty(
        "QString", getModelIndex, setModelIndex, resetModelIndex)

    #: This property holds the foreground role.
    #: Valid values are:
    #:
    #:     #. ''/'None' - no value is displayed
    #:     #. 'value' - the value is displayed
    #:     #. 'w_value' - the write value is displayed
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`TaurusLCD.getFgRole`
    #:     * :meth:`TaurusLCD.setFgRole`
    #:     * :meth:`TaurusLCD.resetFgRole`
    fgRole = Qt.pyqtProperty("QString", getFgRole, setFgRole,
                             resetFgRole, doc="foreground role")
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / display / qpixmapwidget.py View on Github external
#:
    #:     * :meth:`QPixmapWidget.getAspectRatioMode`
    #:     * :meth:`QPixmapWidget.setAspectRatioMode`
    #:     * :meth:`QPixmapWidget.resetAspectRatioMode`
    aspectRatioMode = Qt.pyqtProperty("Qt::AspectRatioMode", getAspectRatioMode, 
                                      setAspectRatioMode, resetAspectRatioMode,
                                      doc="the widget's pixmap aspect ratio mode")

    #: This property holds the widget's pixmap transformation mode
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`QPixmapWidget.getTransformationMode`
    #:     * :meth:`QPixmapWidget.setTransformationMode`
    #:     * :meth:`QPixmapWidget.resetTransformationMode`
    transformationMode = Qt.pyqtProperty("Qt::TransformationMode", getTransformationMode, 
                                         setTransformationMode, resetTransformationMode,
                                         doc="the widget's pixmap transformation mode")
    
    #: This property holds the widget's pixmap alignment
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`QPixmapWidget.getAlignment`
    #:     * :meth:`QPixmapWidget.setAlignment`
    #:     * :meth:`QPixmapWidget.resetAlignment`
    alignment = Qt.pyqtProperty("Qt::Alignment", getAlignment, setAlignment, 
                                resetAlignment, doc="the widget's pixmap alignment")

def demo():
    "QPixmap Widget"
    import demo.qpixmapwidgetdemo
github taurus-org / taurus / lib / taurus / qt / qtgui / gauge / qmeter.py View on Github external
#:
    #:     * :meth:`QManoMeter.getShowScaleColor`
    #:     * :meth:`QManoMeter.setShowScaleColor`
    #:     * :meth:`QManoMeter.resetShowScaleColor`
    showScaleColor = Qt.pyqtProperty("bool", getShowScaleColor,
                                     setShowScaleColor, resetShowScaleColor,
                                     doc="show scale color")

    #: This property holds if should show scale ticks
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`QManoMeter.getShowScaleTicks`
    #:     * :meth:`QManoMeter.setShowScaleTicks`
    #:     * :meth:`QManoMeter.resetShowScaleTicks`
    showScaleTicks = Qt.pyqtProperty("bool", getShowScaleTicks,
                                     setShowScaleTicks, resetShowScaleTicks,
                                     doc="show scale ticks")

    #: This property holds if should show scale text
    #:
    #: **Access functions:**
    #:
    #:     * :meth:`QManoMeter.getShowScaleText`
    #:     * :meth:`QManoMeter.setShowScaleText`
    #:     * :meth:`QManoMeter.resetShowScaleText`
    showScaleText = Qt.pyqtProperty("bool", getShowScaleText,
                                    setShowScaleText, resetShowScaleText,
                                    doc="show scale text")

    #: This property holds if should show value text
    #:
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / panel / taurusform.py View on Github external
return ret
    
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    # QT properties 
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
   
    model = Qt.pyqtProperty("QStringList", getModel, 
                                                TaurusWidget.setModel, 
                                                resetModel)

    useParentModel = Qt.pyqtProperty("bool", 
                                         TaurusWidget.getUseParentModel, 
                                         TaurusWidget.setUseParentModel,
                                         TaurusWidget.resetUseParentModel)
    
    withButtons = Qt.pyqtProperty("bool", isWithButtons, 
                                                setWithButtons,
                                                resetWithButtons)
    
    modifiableByUser = Qt.pyqtProperty("bool", TaurusWidget.isModifiableByUser, 
                                               setModifiableByUser,
                                               TaurusWidget.resetModifiableByUser)
    
    compact = Qt.pyqtProperty("bool", isCompact, setCompact, resetCompact)
      
    

class TaurusCommandsForm(TaurusWidget):
    '''A form that shows commands available for a Device Server'''
    def __init__(self, parent = None, designMode = False):
        TaurusWidget.__init__(self, parent, designMode)
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / table / taurusvaluestable_ro.py View on Github external
#        return ret
                
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    # QT property definition
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

    model = Qt.pyqtProperty("QString", TaurusBaseWidget.getModel, 
                                TaurusBaseWidget.setModel, 
                                TaurusBaseWidget.resetModel)
    
    useParentModel = Qt.pyqtProperty("bool", 
                                         TaurusBaseWidget.getUseParentModel, 
                                         TaurusBaseWidget.setUseParentModel,
                                         TaurusBaseWidget.resetUseParentModel)
    
    showQuality = Qt.pyqtProperty("bool", 
                                      TaurusBaseWidget.getShowQuality,
                                      TaurusBaseWidget.setShowQuality,
                                      TaurusBaseWidget.resetShowQuality)


if __name__ == '__main__':
    import sys
    app = Qt.QApplication([])
    
    if len(sys.argv) == 2:
        model = sys.argv[1]
    else:
        model = 'bl97/pysignalsimulator/1/value1'
     
    w = TaurusValuesTable()
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / panel / taurusform.py View on Github external
resetModel)

    useParentModel = Qt.pyqtProperty("bool", 
                                         TaurusWidget.getUseParentModel, 
                                         TaurusWidget.setUseParentModel,
                                         TaurusWidget.resetUseParentModel)
    
    withButtons = Qt.pyqtProperty("bool", isWithButtons, 
                                                setWithButtons,
                                                resetWithButtons)
    
    modifiableByUser = Qt.pyqtProperty("bool", TaurusWidget.isModifiableByUser, 
                                               setModifiableByUser,
                                               TaurusWidget.resetModifiableByUser)
    
    compact = Qt.pyqtProperty("bool", isCompact, setCompact, resetCompact)
      
    

class TaurusCommandsForm(TaurusWidget):
    '''A form that shows commands available for a Device Server'''
    def __init__(self, parent = None, designMode = False):
        TaurusWidget.__init__(self, parent, designMode)
        
        self.setLayout(Qt.QVBoxLayout())
                
        self._splitter = Qt.QSplitter()
        self._splitter.setOrientation(Qt.Qt.Vertical)
        self.layout().addWidget(self._splitter)
        
        self._frame = TaurusWidget(self)
        self._frame.setLayout(Qt.QGridLayout())
github taurus-org / taurus / lib / taurus / qt / qtgui / input / tauruscombobox.py View on Github external
model = Qt.pyqtProperty("QString",
                            TaurusBaseWidget.getModel,
                            TaurusBaseWidget.setModel,
                            TaurusBaseWidget.resetModel)

    useParentModel = Qt.pyqtProperty("bool",
                                     TaurusBaseWidget.getUseParentModel,
                                     TaurusBaseWidget.setUseParentModel,
                                     TaurusBaseWidget.resetUseParentModel)

    autoApply = Qt.pyqtProperty("bool",
                                TaurusBaseWritableWidget.getAutoApply,
                                TaurusBaseWritableWidget.setAutoApply,
                                TaurusBaseWritableWidget.resetAutoApply)

    forcedApply = Qt.pyqtProperty("bool", TaurusBaseWritableWidget.getForcedApply,
                                  TaurusBaseWritableWidget.setForcedApply,
                                  TaurusBaseWritableWidget.resetForcedApply)


class TaurusAttrListComboBox(Qt.QComboBox, TaurusBaseWidget):
    """Combobox whose items reflect the items read from a 1D attribute of dtype
    str
    """

    def __init__(self, parent=None, designMode=False):
        name = self.__class__.__name__
        self.call__init__wo_kw(Qt.QComboBox, parent)
        self.call__init__(TaurusBaseWidget, name)
        self.insertEventFilter(eventfilters.IGNORE_CONFIG)
        self.setSizeAdjustPolicy(Qt.QComboBox.AdjustToContents)
        self.defineStyle()
github taurus-org / taurus / lib / taurus / qt / qtgui / container / taurusscrollarea.py View on Github external
    @classmethod
    def getQtDesignerPluginInfo(cls):
        ret = TaurusBaseContainer.getQtDesignerPluginInfo()
        if cls is TaurusScrollArea:
            ret['module'] = 'taurus.qt.qtgui.container'
            ret['group'] = 'Taurus Containers'
            ret['icon'] = "designer:scrollarea.png"
            ret['container'] = True
        return ret

    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    # QT properties
    #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

    model = Qt.pyqtProperty("QString", TaurusBaseContainer.getModel,
                            TaurusBaseContainer.setModel,
                            TaurusBaseContainer.resetModel)

    useParentModel = Qt.pyqtProperty("bool",
                                     TaurusBaseContainer.getUseParentModel,
                                     TaurusBaseContainer.setUseParentModel,
                                     TaurusBaseContainer.resetUseParentModel)

    showQuality = Qt.pyqtProperty("bool", TaurusBaseContainer.getShowQuality,
                                  TaurusBaseContainer.setShowQuality,
                                  TaurusBaseContainer.resetShowQuality)


def demo():
    "Scroll area"
    w = Qt.QWidget()