示例#1
0
    def init_form(self):
        self._form = QWidget()
        layout = QVBoxLayout()

        if _api.USED_API == _api.QT_API_PYQT5:
            layout.setContentsMargins(0, 0, 0, 0)
        elif _api.USED_API == _api.QT_API_PYQT4:
            layout.setMargin(0)

        self._form.setLayout(layout)
        self._app = vv.use('pyqt5')
        self._app.Create()
        self._first = True

        Figure = self._app.GetFigureClass()
        self._fig = Figure(self._form)
        vv.figure(self._fig.nr)

        policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        widget = self._fig._widget
        widget.setSizePolicy(policy)
        widget.setMinimumSize(100, 100)

        layout.addWidget(widget)

        self._colorMap = vv.CM_AUTUMN
        self._colors_limits = None
        super(ControlVisVisVolume, self).init_form()
示例#2
0
    def init_form(self):
        vlayout = QVBoxLayout()

        if _api.USED_API == _api.QT_API_PYQT5:
            vlayout.setContentsMargins(0, 0, 0, 0)
        elif _api.USED_API == _api.QT_API_PYQT4:
            vlayout.setMargin(0)

        self.setLayout(vlayout)

        self._scroll = QScrollBar(QtCore.Qt.Horizontal)

        scrollarea = QScrollArea()
        scrollarea.setMinimumHeight(140)
        scrollarea.setWidgetResizable(True)

        self._events_widget = EventsWidget(scroll=self._scroll)
        scrollarea.setWidget(self._events_widget)

        self._scroll.actionTriggered.connect(self.__scroll_changed)

        vlayout.addWidget(scrollarea)  # The timeline widget
        vlayout.addWidget(self._scroll)  # Add scroll

        self._scroll.setMaximum(0)
        self._scroll.setSliderPosition(0)
示例#3
0
    def __init__(self, *args, **kwargs):
        title = kwargs.get('title', args[0] if len(args) > 0 else '')

        parent_win = kwargs.get('parent_win', None)
        win_flag = kwargs.get('win_flag', None)

        if parent_win is not None and win_flag is None:
            win_flag = QtCore.Qt.Dialog

        QFrame.__init__(self) if parent_win is None else QFrame.__init__(
            self, parent_win, win_flag)

        # self.setObjectName(self.__class__.__name__)

        layout = QVBoxLayout()
        self.setLayout(layout)

        if AnyQt.USED_API == 'pyqt5':
            layout.setContentsMargins(0, 0, 0, 0)
        else:
            layout.setMargin(0)

        self.title = title
        self.has_progress = False

        self._mainmenu = []
        self._splitters = []
        self._tabs = []
        self._formset = None
        self._formLoaded = False
        self.uid = id(self)

        self.setAccessibleName('BaseWidget')
    def __init__(self, *args, **kwargs):
        QWidget.__init__(self)
        layout = QVBoxLayout()

        if _api.USED_API == _api.QT_API_PYQT5:
            layout.setContentsMargins(0, 0, 0, 0)
        elif _api.USED_API == _api.QT_API_PYQT4:
            layout.setMargin(0)

        self.form.setLayout(layout)

        ControlBase.__init__(self, *args, **kwargs)
        self.value = kwargs.get('default', None)
示例#5
0
    def __init__(self, *args, **kwargs):
        QWidget.__init__(self)
        layout = QVBoxLayout()

        if conf.PYFORMS_USE_QT5:
            layout.setContentsMargins(0, 0, 0, 0)
        else:
            layout.setMargin(0)

        self.form.setLayout(layout)

        ControlBase.__init__(self, *args, **kwargs)
        self.value = kwargs.get('default', None)
	def __init__(self, label='', default=None):
		QWidget.__init__(self)
		layout = QVBoxLayout()

		if conf.PYFORMS_USE_QT5:
			layout.setContentsMargins(0,0,0,0)
		else:
			layout.setMargin(0)


		self.form.setLayout(layout)

		ControlBase.__init__(self, label)
		self.value = default
示例#7
0
    def init_form(self):
        self._form = QWidget()
        layout = QVBoxLayout()

        if _api.USED_API == _api.QT_API_PYQT5:
            layout.setContentsMargins(0, 0, 0, 0)
        else:
            layout.setMargin(0)

        self._form.setLayout(layout)
        self._app = vv.use('pyqt5')
        self._app.Create()

        Figure = self._app.GetFigureClass()
        self._fig = Figure(self._form)

        policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        widget = self._fig._widget
        widget.setSizePolicy(policy)

        layout.addWidget(widget)
示例#8
0
    def __init__(self, *args, **kwargs):
        title = kwargs.get('title', args[0] if len(args) > 0 else '')

        parent_win = kwargs.get('parent_win',
                                kwargs.get('parent_widget', None))
        win_flag = kwargs.get('win_flag', None)

        self._parent_widget = parent_win

        if parent_win is not None and win_flag is None:
            win_flag = QtCore.Qt.Dialog

        QFrame.__init__(self) if parent_win is None else QFrame.__init__(
            self, parent_win, win_flag)

        layout = QVBoxLayout()
        self.setLayout(layout)

        if _api.USED_API == _api.QT_API_PYQT5:
            layout.setContentsMargins(0, 0, 0, 0)
        elif _api.USED_API == _api.QT_API_PYQT4:
            layout.setMargin(0)

        self.title = title

        self.title = title
        self.has_progress = False

        self.toolbar = []
        self._mainmenu = []
        self._splitters = []
        self.vlayouts = []
        self.hlayouts = []
        self._tabs = []
        self._formset = None
        self._formLoaded = False
        self.uid = id(self)

        self.setAccessibleName('BaseWidget')
示例#9
0
    def value(self, value):
        ControlBase.label.fset(self, value)

        for item in range(self.form.count(), -1, -1):
            self.form.removeItem(item)

        for item in value:
            if isinstance(item, tuple):
                widget = QFrame(self.form)
                layout = QVBoxLayout()

                if _api.USED_API == _api.QT_API_PYQT5:
                    layout.setContentsMargins(0, 0, 0, 0)
                elif _api.USED_API == _api.QT_API_PYQT4:
                    layout.setMargin(0)

                widget.setLayout(layout)

                for e in item[1]:
                    if isinstance(e, tuple):
                        hwidget = QFrame(self.form)
                        hlayout = QHBoxLayout()

                        if _api.USED_API == _api.QT_API_PYQT5:
                            hlayout.setContentsMargins(0, 0, 0, 0)
                        elif _api.USED_API == _api.QT_API_PYQT4:
                            hlayout.setMargin(0)

                        hwidget.setLayout(hlayout)
                        for ee in e:
                            hlayout.addWidget(ee.form)
                        widget.layout().addWidget(hwidget)
                    else:
                        widget.layout().addWidget(e.form)
                self.form.addItem(widget, item[0])
            else:
                self.form.addItem(item.form, item.label)
示例#10
0
    def init_form(self):
        # Get the current path of the file
        rootPath = os.path.dirname(__file__)

        vlayout = QVBoxLayout()
        hlayout = QHBoxLayout()

        if _api.USED_API == _api.QT_API_PYQT5:
            hlayout.setContentsMargins(0, 0, 0, 0)
            vlayout.setContentsMargins(0, 0, 0, 0)
        elif _api.USED_API == _api.QT_API_PYQT4:
            hlayout.setMargin(0)
            vlayout.setMargin(0)

        self.setLayout(vlayout)

        # Add scroll area
        scrollarea = QScrollArea()
        self._scrollArea = scrollarea
        scrollarea.setMinimumHeight(140)
        scrollarea.setWidgetResizable(True)
        scrollarea.keyPressEvent = self.__scrollAreaKeyPressEvent
        scrollarea.keyReleaseEvent = self.__scrollAreaKeyReleaseEvent

        vlayout.addWidget(scrollarea)

        # The timeline widget
        self._time = widget = TimelineWidget(self)
        widget._scroll = scrollarea
        scrollarea.setWidget(widget)

        # Timeline zoom slider
        slider = QSlider(QtCore.Qt.Horizontal)
        slider.setFocusPolicy(QtCore.Qt.NoFocus)
        slider.setMinimum(1)
        slider.setMaximum(100)
        slider.setValue(10)
        slider.setPageStep(1)
        slider.setTickPosition(QSlider.NoTicks)  # TicksBothSides
        slider.valueChanged.connect(self.__scaleSliderChange)

        slider_label_zoom_in = QLabel()
        slider_label_zoom_out = QLabel()
        slider_label_zoom_in.setPixmap(
            conf.PYFORMS_PIXMAP_EVENTTIMELINE_ZOOM_IN)
        slider_label_zoom_out.setPixmap(
            conf.PYFORMS_PIXMAP_EVENTTIMELINE_ZOOM_OUT)

        self._zoomLabel = QLabel("100%")
        hlayout.addWidget(self._zoomLabel)
        hlayout.addWidget(slider_label_zoom_out)
        hlayout.addWidget(slider)
        hlayout.addWidget(slider_label_zoom_in)

        # Import/Export Buttons
        btn_import = QPushButton("Import")

        btn_import.setIcon(conf.PYFORMS_ICON_EVENTTIMELINE_IMPORT)
        btn_import.clicked.connect(self.__open_import_win_evt)
        btn_export = QPushButton("Export")

        btn_export.setIcon(conf.PYFORMS_ICON_EVENTTIMELINE_EXPORT)
        btn_export.clicked.connect(self.__export)
        hlayout.addWidget(btn_import)
        hlayout.addWidget(btn_export)

        vlayout.addLayout(hlayout)