Пример #1
0
 def __init__(
     self,
     wintitle="guiqwt plot",
     icon="guiqwt.svg",
     edit=False,
     toolbar=False,
     options=None,
     parent=None,
     panels=None,
 ):
     if not PYQT5:
         QDialog.__init__(self, parent)
     self.edit = edit
     self.button_box = None
     self.button_layout = None
     if PYQT5:
         super(CurveDialog, self).__init__(
             parent,
             wintitle=wintitle,
             icon=icon,
             toolbar=toolbar,
             options=options,
             panels=panels,
         )
     else:
         CurveWidgetMixin.__init__(
             self,
             wintitle=wintitle,
             icon=icon,
             toolbar=toolbar,
             options=options,
             panels=panels,
         )
     self.setWindowFlags(Qt.Window)
     win32_fix_title_bar_background(self)
Пример #2
0
 def __init__(
     self,
     wintitle="guiqwt plot",
     icon="guiqwt.svg",
     toolbar=False,
     options=None,
     parent=None,
     panels=None,
 ):
     if PYQT5:
         super(CurveWindow, self).__init__(
             parent,
             wintitle=wintitle,
             icon=icon,
             toolbar=toolbar,
             options=options,
             panels=panels,
         )
     else:
         QMainWindow.__init__(self, parent)
         CurveWidgetMixin.__init__(
             self,
             wintitle=wintitle,
             icon=icon,
             toolbar=toolbar,
             options=options,
             panels=panels,
         )
     win32_fix_title_bar_background(self)
Пример #3
0
    def __init__(self, wintitle):
        super(Window, self).__init__()
        win32_fix_title_bar_background(self)
        self.default_tool = None
        self.plots = []
        self.itemlist = PlotItemList(None)
        self.contrast = ContrastAdjustment(None)
        self.xcsw = XCrossSection(None)
        self.ycsw = YCrossSection(None)

        self.manager = PlotManager(self)
        self.toolbar = QToolBar(_("Tools"), self)
        self.manager.add_toolbar(self.toolbar, "default")
        self.toolbar.setMovable(True)
        self.toolbar.setFloatable(True)
        self.addToolBar(Qt.TopToolBarArea, self.toolbar)

        frame = QFrame(self)
        self.setCentralWidget(frame)
        self.layout = QGridLayout()
        layout = QVBoxLayout(frame)
        frame.setLayout(layout)
        layout.addLayout(self.layout)
        self.frame = frame

        self.setWindowTitle(wintitle)
        self.setWindowIcon(get_icon("guiqwt.svg"))
Пример #4
0
    def __init__(self):
        QMainWindow.__init__(self)
        win32_fix_title_bar_background(self)
        self.setWindowTitle("Signal filtering 2 (guiqwt)")
        self.setWindowIcon(get_icon("guiqwt.svg"))

        hlayout = QHBoxLayout()
        central_widget = QWidget(self)
        central_widget.setLayout(hlayout)
        self.setCentralWidget(central_widget)
        # ---guiqwt plot manager
        self.manager = PlotManager(self)
Пример #5
0
 def __init__(
     self,
     wintitle=None,
     icon="guiqwt.svg",
     edit=True,
     toolbar=False,
     options=None,
     parent=None,
     panels=None,
     param_cols=1,
     legend_anchor="TR",
     auto_fit=False,
 ):
     if not PYQT5:
         QDialog.__init__(self, parent)
     self.edit = edit
     self.button_layout = None
     if PYQT5:
         super(FitDialog, self).__init__(
             parent,
             wintitle=wintitle,
             icon=icon,
             toolbar=toolbar,
             options=options,
             panels=panels,
             param_cols=param_cols,
             legend_anchor=legend_anchor,
             auto_fit=auto_fit,
         )
     else:
         FitWidgetMixin.__init__(
             self,
             wintitle,
             icon,
             toolbar,
             options,
             panels,
             param_cols,
             legend_anchor,
             auto_fit,
         )
     self.setWindowFlags(Qt.Window)
     win32_fix_title_bar_background(self)
Пример #6
0
 def __init__(self, nplots=150, ncols=6, nrows=5):
     super().__init__()
     win32_fix_title_bar_background(self)
     self.tabw = QTabWidget()
     self.setCentralWidget(self.tabw)
     irow, icol, itab = 0, 0, 0
     add_tab_at_next_step = True
     for iplt in range(nplots):
         if add_tab_at_next_step:
             plottab = self.add_tab(itab)
             add_tab_at_next_step = False
         plottab.add_plot(iplt, irow, icol)
         icol += 1
         if icol == ncols:
             icol = 0
             irow += 1
             if irow == nrows:
                 irow = 0
                 itab += 1
                 add_tab_at_next_step = True
                 self.refresh()
Пример #7
0
    def __init__(self,
                 parent,
                 new_size,
                 old_size,
                 text="",
                 keep_original_size=False):
        QDialog.__init__(self, parent)
        win32_fix_title_bar_background(self)

        intfunc = lambda tup: [int(val) for val in tup]
        if intfunc(new_size) == intfunc(old_size):
            self.keep_original_size = True
        else:
            self.keep_original_size = keep_original_size
        self.width, self.height = new_size
        self.old_width, self.old_height = old_size
        self.ratio = self.width / self.height

        layout = QVBoxLayout()
        self.setLayout(layout)

        formlayout = QFormLayout()
        layout.addLayout(formlayout)

        if text:
            label = QLabel(text)
            label.setAlignment(Qt.AlignHCenter)
            formlayout.addRow(label)

        self.w_edit = w_edit = QLineEdit(self)
        w_valid = QIntValidator(w_edit)
        w_valid.setBottom(1)
        w_edit.setValidator(w_valid)

        self.h_edit = h_edit = QLineEdit(self)
        h_valid = QIntValidator(h_edit)
        h_valid.setBottom(1)
        h_edit.setValidator(h_valid)

        zbox = QCheckBox(_("Original size"), self)

        formlayout.addRow(_("Width (pixels)"), w_edit)
        formlayout.addRow(_("Height (pixels)"), h_edit)
        formlayout.addRow("", zbox)

        formlayout.addRow(_("Original size:"), QLabel("%d x %d" % old_size))
        self.z_label = QLabel()
        formlayout.addRow(_("Zoom factor:"), self.z_label)

        # Button box
        self.bbox = bbox = QDialogButtonBox(QDialogButtonBox.Ok
                                            | QDialogButtonBox.Cancel)
        bbox.accepted.connect(self.accept)
        bbox.rejected.connect(self.reject)
        layout.addWidget(bbox)

        self.w_edit.setText(str(self.width))
        self.h_edit.setText(str(self.height))
        self.update_widgets()

        self.setWindowTitle(_("Resize"))

        w_edit.textChanged.connect(self.width_changed)
        h_edit.textChanged.connect(self.height_changed)
        zbox.toggled.connect(self.toggled_no_zoom)
        zbox.setChecked(self.keep_original_size)
Пример #8
0
 def __init__(self):
     QMainWindow.__init__(self)
     win32_fix_title_bar_background(self)
     self.setup()