예제 #1
0
 def _buildNorm(self):
     self._qgbNorm = qt.QGroupBox(parent=self)
     self._qgbNorm.setLayout(qt.QHBoxLayout())
     self._qgbNorm._qrbLinear = qt.QRadioButton('linear')
     self._qgbNorm._qrbLog = qt.QRadioButton('log')
     self._qgbNorm.layout().addWidget(self._qgbNorm._qrbLinear)
     self._qgbNorm.layout().addWidget(self._qgbNorm._qrbLog)
예제 #2
0
    def setupUi(self):
        # form layout for grid scan inputs
        layout = qt.QFormLayout()
        self.noChangeBox = qt.QRadioButton()
        layout.addRow(qt.QLabel("Export flat list of points:"), self.noChangeBox)
        self.reshapeBox = qt.QRadioButton()
        self.reshapeBox.setChecked(True)
        layout.addRow(qt.QLabel("Try reshaping the data:"), self.reshapeBox)
        self.shapeBox = qt.QLineEdit('auto')
        layout.addRow(qt.QLabel("    shape:"), self.shapeBox)
        self.resampleBox = qt.QRadioButton()
        layout.addRow(qt.QLabel("Resample the data on a grid:"), self.resampleBox)
        self.oversamplingBox = qt.QSpinBox()
        self.oversamplingBox.setValue(1)
        layout.addRow(qt.QLabel("    oversampling relative to typical step size:"), self.oversamplingBox)
        self.equalBox = qt.QCheckBox()
        self.equalBox.setChecked(True)
        layout.addRow(qt.QLabel("    equal horizontal and vertical steps"), self.equalBox)
        self.formGroupBox = qt.QGroupBox("PyMCA needs data layed out on a regular grid.")
        self.formGroupBox.setLayout(layout)

        # ok/cancel buttons
        buttonBox = qt.QDialogButtonBox(qt.QDialogButtonBox.Ok | qt.QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)

        # put everything together
        mainLayout = qt.QVBoxLayout()
        mainLayout.addWidget(self.formGroupBox)
        mainLayout.addWidget(buttonBox)
        self.setLayout(mainLayout)

        self.setWindowTitle("Export for PyMCA...")
예제 #3
0
    def addUrl(self, url, **kwargs):
        """

        :param url: 
        :param args: 
        :return: index of the created items row
        :rtype int
        """
        assert isinstance(url, DataUrl)
        row = self.rowCount()
        self.setRowCount(row + 1)

        _item = qt.QTableWidgetItem()
        _item.setText(os.path.basename(url.path()))
        _item.setFlags(qt.Qt.ItemIsEnabled | qt.Qt.ItemIsSelectable)
        self.setItem(row, self.COLUMS_INDEX['url'], _item)

        widgetImgA = qt.QRadioButton(parent=self)
        widgetImgA.setAutoExclusive(False)
        self.setCellWidget(row, self.COLUMS_INDEX['img A'], widgetImgA)
        callbackImgA = functools.partial(self._activeImgAChanged, url.path())
        widgetImgA.toggled.connect(callbackImgA)

        widgetImgB = qt.QRadioButton(parent=self)
        widgetImgA.setAutoExclusive(False)
        self.setCellWidget(row, self.COLUMS_INDEX['img B'], widgetImgB)
        callbackImgB = functools.partial(self._activeImgBChanged, url.path())
        widgetImgB.toggled.connect(callbackImgB)

        self._checkBoxes[url.path()] = {
            'img A': widgetImgA,
            'img B': widgetImgB
        }
        self.resizeColumnsToContents()
        return row
예제 #4
0
    def makeTab(self):
        tab = qt.QWidget()
        tab.color = self.color

        layout2 = qt.QHBoxLayout()
        layout2.addWidget(qt.QLabel('Symbol:'))
        tab.symbolComboBox = SymbolComboBox(tab)
        symbolDelegate = SymbolDelegate(tab)
        tab.symbolComboBox.setItemDelegate(symbolDelegate)
        tab.symbolComboBox.addItems(tuple(lineSymbolsText.keys()))
        tab.symbolComboBox.currentIndexChanged.connect(
            partial(self.comboBoxChanged, tab, "size"))
        layout2.addWidget(tab.symbolComboBox, 1)
        tab.sizeLabel = qt.QLabel('Size:')
        layout2.addWidget(tab.sizeLabel)
        tab.sizeSpinBox = qt.QDoubleSpinBox()
        tab.sizeSpinBox.setDecimals(0)
        tab.sizeSpinBox.setMaximum(10)
        tab.sizeSpinBox.setMinimum(1)
        tab.sizeSpinBox.setSingleStep(1)
        tab.sizeSpinBox.valueChanged.connect(
            partial(self.updateFromSpinBox, tab, "size"))
        layout2.addWidget(tab.sizeSpinBox, 0)

        layout3 = qt.QHBoxLayout()
        layout3.addWidget(qt.QLabel('Style:'))
        tab.styleComboBox = LineStyleComboBox(tab)
        lineStyleDelegate = LineStyleDelegate(tab)
        tab.styleComboBox.setItemDelegate(lineStyleDelegate)
        tab.styleComboBox.addItems(tuple(lineStylesText.keys()))
        tab.styleComboBox.currentIndexChanged.connect(
            partial(self.comboBoxChanged, tab, "width"))
        layout3.addWidget(tab.styleComboBox, 1)
        tab.widthLabel = qt.QLabel('Width:')
        layout3.addWidget(tab.widthLabel)
        tab.widthSpinBox = qt.QDoubleSpinBox()
        tab.widthSpinBox.setDecimals(1)
        tab.widthSpinBox.setMaximum(10)
        tab.widthSpinBox.setMinimum(0.1)
        tab.widthSpinBox.setSingleStep(0.5)
        tab.widthSpinBox.valueChanged.connect(
            partial(self.updateFromSpinBox, tab, "width"))
        layout3.addWidget(tab.widthSpinBox, 0)

        layout4 = qt.QHBoxLayout()
        tab.yAxisLabel = qt.QLabel("Y Axis:")
        tab.yAxisLeft = qt.QRadioButton("left")
        tab.yAxisRight = qt.QRadioButton("right")
        layout4.addWidget(tab.yAxisLabel)
        layout4.addWidget(tab.yAxisLeft)
        layout4.addWidget(tab.yAxisRight)
        layout4.addStretch()

        layout = qt.QVBoxLayout()
        layout.addLayout(layout3)
        layout.addLayout(layout2)
        layout.addLayout(layout4)
        tab.setLayout(layout)
        return tab
예제 #5
0
    def makeHeaderTab(self):
        self.headerNRB = qt.QRadioButton("has")
        self.headerNEdit = QLineEditSelectRB(rb=self.headerNRB)
        self.headerNEdit.setFixedWidth(28)
        self.headerNEdit.setValidator(
            qt.QIntValidator(0, cco.MAX_HEADER_LINES, self))
        self.headerNLabel2 = qt.QLabel("lines")

        self.headerSRB = qt.QRadioButton("has lines beginning with")
        self.headerSEdit = QLineEditSelectRB(rb=self.headerSRB)
        self.headerSEdit.setFixedWidth(16)

        self.headerERB = qt.QRadioButton("ends with line containing")
        self.headerEEdit = QLineEditSelectRB(rb=self.headerERB)
        self.headerEEdit.setMinimumWidth(30)

        self.headerSRB.setChecked(True)

        headerLayoutN = qt.QHBoxLayout()
        headerLayoutN.addWidget(self.headerNRB)
        headerLayoutN.addWidget(self.headerNEdit)
        headerLayoutN.addWidget(self.headerNLabel2)
        headerLayoutN.addStretch()

        headerLayoutS = qt.QHBoxLayout()
        headerLayoutS.addWidget(self.headerSRB)
        headerLayoutS.addWidget(self.headerSEdit)
        headerLayoutS.addStretch()

        headerLayoutE = qt.QHBoxLayout()
        headerLayoutE.addWidget(self.headerERB)
        headerLayoutE.addWidget(self.headerEEdit, 1)
        headerLayoutE.addStretch()

        headerLayout = qt.QVBoxLayout()
        headerLayout.setContentsMargins(2, 0, 0, 0)
        headerLayout.addLayout(headerLayoutN)
        headerLayout.addLayout(headerLayoutS)
        headerLayout.addLayout(headerLayoutE)
        headerLayout.addStretch()

        tab = qt.QWidget(self)
        tab.setLayout(headerLayout)
        tab.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Fixed)

        self.headerKW = 'skiprows', 'comments', 'lastSkipRowContains'
        self.fullHeaderKW = ['dataFormat.' + kw for kw in self.headerKW]
        self.radioButtons = self.headerNRB, self.headerSRB, self.headerERB
        self.edits = self.headerNEdit, self.headerSEdit, self.headerEEdit

        self.registerExclusivePropGroup(
            tab, [self.radioButtons, self.edits], 'header',
            props=self.fullHeaderKW, convertTypes=[int, None, None])

        return tab
예제 #6
0
    def makeColorGroup(self):
        self.colorIndividual = qt.QRadioButton("individual")
        self.colorIndividualButton = QColorLoop(self, [self.color])
        self.colorIndividualButton.clicked.connect(
            partial(self.openColorDialog, gco.COLOR_POLICY_INDIVIDUAL))
        self.colorLoop1 = qt.QRadioButton("loop1")
        self.colorLoop1Button = QColorLoop(self, gco.colorCycle1)
        self.colorLoop1Button.clicked.connect(
            partial(self.openColorDialog, gco.COLOR_POLICY_LOOP1))
        self.colorLoop2 = qt.QRadioButton("loop2")
        self.colorLoop2Button = QColorLoop(self, gco.colorCycle2)
        self.colorLoop2Button.clicked.connect(
            partial(self.openColorDialog, gco.COLOR_POLICY_LOOP2))
        self.colorGradient = qt.QRadioButton("gradient")
        gradient = gco.makeGradientCollection(self.color1, self.color2)
        self.colorGradientButton = QColorLoop(self, gradient)
        self.colorGradientButton.clicked.connect(
            partial(self.openColorDialog, gco.COLOR_POLICY_GRADIENT))
        self.colorAutoCollective = qt.QCheckBox(
            "keep collective color rule\nwhen data model changes")
        self.colorAutoCollective.setEnabled(self.isGroupSelected
                                            or self.isTopGroupSelected)
        self.colorRadioButtons = (self.colorIndividualButton, self.colorLoop1,
                                  self.colorLoop2, self.colorGradient)

        layoutC = qt.QVBoxLayout()
        layoutC.setContentsMargins(10, 0, 2, 2)
        layoutH = qt.QHBoxLayout()
        layoutH.addWidget(self.colorIndividual)
        layoutH.addWidget(self.colorIndividualButton)
        layoutC.addLayout(layoutH)
        layoutH = qt.QHBoxLayout()
        layoutH.addWidget(self.colorLoop1)
        layoutH.addWidget(self.colorLoop1Button)
        layoutC.addLayout(layoutH)
        layoutH = qt.QHBoxLayout()
        layoutH.addWidget(self.colorLoop2)
        layoutH.addWidget(self.colorLoop2Button)
        layoutC.addLayout(layoutH)
        layoutH = qt.QHBoxLayout()
        layoutH.addWidget(self.colorGradient)
        layoutH.addWidget(self.colorGradientButton)
        layoutC.addLayout(layoutH)
        layoutC.addWidget(self.colorAutoCollective)

        groupColor = qt.QGroupBox('Color:')
        groupColor.setLayout(layoutC)
        return groupColor
예제 #7
0
 def _buildActiveImageSelector(self):
     """Build the image selector widget"""
     self.image_selector = qt.QGroupBox(parent=self)
     self.image_selector.setLayout(qt.QVBoxLayout())
     self.image_selector._qr1 = qt.QRadioButton('image1')
     self.image_selector._qr1.setChecked(True)
     self.image_selector._qr2 = qt.QRadioButton('image2')
     self.image_selector._qr3 = qt.QRadioButton('image3')
     self.image_selector._qr4 = qt.QRadioButton('image4')
     self.image_selector._qr5 = qt.QRadioButton('image5')
     self.image_selector._qr6 = qt.QRadioButton('image6')
     self.image_selector.layout().addWidget(self.image_selector._qr6)
     self.image_selector.layout().addWidget(self.image_selector._qr5)
     self.image_selector.layout().addWidget(self.image_selector._qr4)
     self.image_selector.layout().addWidget(self.image_selector._qr3)
     self.image_selector.layout().addWidget(self.image_selector._qr2)
     self.image_selector.layout().addWidget(self.image_selector._qr1)
예제 #8
0
    def createOptions(self):
        panel = qt.QGroupBox()
        panel.setTitle("Options")
        layout = qt.QVBoxLayout()
        panel.setLayout(layout)
        group = qt.QButtonGroup(panel)

        radio = qt.QRadioButton(panel)
        radio.setText("Qt QFileDialog")
        radio.setProperty("Mode", Mode.DEFAULT_FILEDIALOG)
        group.addButton(radio)
        layout.addWidget(radio)

        radio = qt.QRadioButton(panel)
        radio.setText("silx ImageFileDialog")
        radio.setProperty("Mode", Mode.IMAGEFILEDIALOG)
        group.addButton(radio)
        layout.addWidget(radio)

        radio = qt.QRadioButton(panel)
        radio.setChecked(True)
        radio.setText("silx DataFileDialog")
        radio.setProperty("Mode", Mode.DATAFILEDIALOG)
        group.addButton(radio)
        layout.addWidget(radio)

        radio = qt.QRadioButton(panel)
        radio.setText("silx DataFileDialog (filter=dataset)")
        radio.setProperty("Mode", Mode.DATAFILEDIALOG_DATASET)
        group.addButton(radio)
        layout.addWidget(radio)

        radio = qt.QRadioButton(panel)
        radio.setText("silx DataFileDialog (filter=group)")
        radio.setProperty("Mode", Mode.DATAFILEDIALOG_GROUP)
        group.addButton(radio)
        layout.addWidget(radio)

        radio = qt.QRadioButton(panel)
        radio.setText("silx DataFileDialog (filter=NXentry)")
        radio.setProperty("Mode", Mode.DATAFILEDIALOG_NXENTRY)
        group.addButton(radio)
        layout.addWidget(radio)

        self.__options = group
        return panel
예제 #9
0
파일: findContours.py 프로젝트: t20100/silx
    def __createConfigurationPanel(self, parent):
        panel = qt.QWidget(parent=parent)
        layout = qt.QVBoxLayout()
        panel.setLayout(layout)

        self.__kind = qt.QButtonGroup(self)
        self.__kind.setExclusive(True)

        group = qt.QGroupBox(self)
        group.setTitle("Image")
        layout.addWidget(group)
        groupLayout = qt.QVBoxLayout(group)

        button = qt.QRadioButton(parent=panel)
        button.setText("Island")
        button.clicked.connect(self.generateIsland)
        button.setCheckable(True)
        button.setChecked(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("Gravity")
        button.clicked.connect(self.generateGravityField)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("Magnetic")
        button.clicked.connect(self.generateMagneticField)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("Spiral")
        button.clicked.connect(self.generateSpiral)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("Gradient")
        button.clicked.connect(self.generateGradient)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("Composite gradient")
        button.clicked.connect(self.generateCompositeGradient)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__kind.addButton(button)

        button = qt.QPushButton(parent=panel)
        button.setText("Generate a new image")
        button.clicked.connect(self.generate)
        groupLayout.addWidget(button)

        # Contours

        group = qt.QGroupBox(self)
        group.setTitle("Contours")
        layout.addWidget(group)
        groupLayout = qt.QVBoxLayout(group)

        button = qt.QCheckBox(parent=panel)
        button.setText("Use the plot's mask")
        button.setCheckable(True)
        button.setChecked(True)
        button.clicked.connect(self.updateContours)
        groupLayout.addWidget(button)
        self.__useMaskButton = button

        button = qt.QPushButton(parent=panel)
        button.setText("Update contours")
        button.clicked.connect(self.updateContours)
        groupLayout.addWidget(button)

        # Implementations

        group = qt.QGroupBox(self)
        group.setTitle("Implementation")
        layout.addWidget(group)
        groupLayout = qt.QVBoxLayout(group)

        self.__impl = qt.QButtonGroup(self)
        self.__impl.setExclusive(True)

        button = qt.QRadioButton(parent=panel)
        button.setText("silx")
        button.clicked.connect(self.updateContours)
        button.setCheckable(True)
        button.setChecked(True)
        groupLayout.addWidget(button)
        self.__implMerge = button
        self.__impl.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("silx with cache")
        button.clicked.connect(self.updateContours)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__implMergeCache = button
        self.__impl.addButton(button)

        button = qt.QRadioButton(parent=panel)
        button.setText("skimage")
        button.clicked.connect(self.updateContours)
        button.setCheckable(True)
        groupLayout.addWidget(button)
        self.__implSkimage = button
        self.__impl.addButton(button)
        if MarchingSquaresSciKitImage is None:
            button.setEnabled(False)
            button.setToolTip("skimage is not installed or not compatible")

        # Processing

        group = qt.QGroupBox(self)
        group.setTitle("Processing")
        layout.addWidget(group)
        group.setLayout(self.__createInfoLayout(group))

        # Processing

        group = qt.QGroupBox(self)
        group.setTitle("Custom level")
        layout.addWidget(group)
        groupLayout = qt.QVBoxLayout(group)

        label = qt.QLabel(parent=panel)
        self.__value = qt.QSlider(panel)
        self.__value.setOrientation(qt.Qt.Horizontal)
        self.__value.sliderMoved.connect(self.__updateCustomContours)
        self.__value.valueChanged.connect(self.__updateCustomContours)
        groupLayout.addWidget(self.__value)

        return panel
    def _initDrawGroupBox(self):
        """Init drawing tools widgets"""
        layout = qt.QVBoxLayout()

        self.browseAction = PanModeAction(self.plot, self.plot)
        self.addAction(self.browseAction)

        # Draw tools
        self.rectAction = qt.QAction(icons.getQIcon('shape-rectangle'),
                                     'Rectangle selection', None)
        self.rectAction.setToolTip(
            'Rectangle selection tool: (Un)Mask a rectangular region <b>R</b>')
        self.rectAction.setShortcut(qt.QKeySequence(qt.Qt.Key_R))
        self.rectAction.setCheckable(True)
        self.rectAction.triggered.connect(self._activeRectMode)
        self.addAction(self.rectAction)

        self.ellipseAction = qt.QAction(icons.getQIcon('shape-ellipse'),
                                        'Circle selection', None)
        self.ellipseAction.setToolTip(
            'Rectangle selection tool: (Un)Mask a circle region <b>R</b>')
        self.ellipseAction.setShortcut(qt.QKeySequence(qt.Qt.Key_R))
        self.ellipseAction.setCheckable(True)
        self.ellipseAction.triggered.connect(self._activeEllipseMode)
        self.addAction(self.ellipseAction)

        self.polygonAction = qt.QAction(icons.getQIcon('shape-polygon'),
                                        'Polygon selection', None)
        self.polygonAction.setShortcut(qt.QKeySequence(qt.Qt.Key_S))
        self.polygonAction.setToolTip(
            'Polygon selection tool: (Un)Mask a polygonal region <b>S</b><br>'
            'Left-click to place new polygon corners<br>'
            'Left-click on first corner to close the polygon')
        self.polygonAction.setCheckable(True)
        self.polygonAction.triggered.connect(self._activePolygonMode)
        self.addAction(self.polygonAction)

        self.pencilAction = qt.QAction(icons.getQIcon('draw-pencil'),
                                       'Pencil tool', None)
        self.pencilAction.setShortcut(qt.QKeySequence(qt.Qt.Key_P))
        self.pencilAction.setToolTip(
            'Pencil tool: (Un)Mask using a pencil <b>P</b>')
        self.pencilAction.setCheckable(True)
        self.pencilAction.triggered.connect(self._activePencilMode)
        self.addAction(self.pencilAction)

        self.drawActionGroup = qt.QActionGroup(self)
        self.drawActionGroup.setExclusive(True)
        self.drawActionGroup.addAction(self.rectAction)
        self.drawActionGroup.addAction(self.ellipseAction)
        self.drawActionGroup.addAction(self.polygonAction)
        self.drawActionGroup.addAction(self.pencilAction)

        actions = (self.browseAction, self.rectAction, self.ellipseAction,
                   self.polygonAction, self.pencilAction)
        drawButtons = []
        for action in actions:
            btn = qt.QToolButton()
            btn.setDefaultAction(action)
            drawButtons.append(btn)
        container = self._hboxWidget(*drawButtons)
        layout.addWidget(container)

        # Mask/Unmask radio buttons
        maskRadioBtn = qt.QRadioButton('Mask')
        maskRadioBtn.setToolTip(
            'Drawing masks with current level. Press <b>Ctrl</b> to unmask')
        maskRadioBtn.setChecked(True)

        unmaskRadioBtn = qt.QRadioButton('Unmask')
        unmaskRadioBtn.setToolTip(
            'Drawing unmasks with current level. Press <b>Ctrl</b> to mask')

        self.maskStateGroup = qt.QButtonGroup()
        self.maskStateGroup.addButton(maskRadioBtn, 1)
        self.maskStateGroup.addButton(unmaskRadioBtn, 0)

        self.maskStateWidget = self._hboxWidget(maskRadioBtn, unmaskRadioBtn)
        layout.addWidget(self.maskStateWidget)

        self.maskStateWidget.setHidden(True)

        # Pencil settings
        self.pencilSetting = self._createPencilSettings(None)
        self.pencilSetting.setVisible(False)
        layout.addWidget(self.pencilSetting)

        layout.addStretch(1)

        drawGroup = qt.QGroupBox('Draw tools')
        drawGroup.setLayout(layout)
        return drawGroup
예제 #11
0
    def __init__(self, parent=None):
        super(PrintGeometryWidget, self).__init__(parent)
        self.mainLayout = qt.QGridLayout(self)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.mainLayout.setSpacing(2)
        hbox = qt.QWidget()
        hboxLayout = qt.QHBoxLayout(hbox)
        hboxLayout.setContentsMargins(0, 0, 0, 0)
        hboxLayout.setSpacing(2)
        label = qt.QLabel(self)
        label.setText("Units")
        label.setAlignment(qt.Qt.AlignCenter)
        self._pageButton = qt.QRadioButton()
        self._pageButton.setText("Page")
        self._inchButton = qt.QRadioButton()
        self._inchButton.setText("Inches")
        self._cmButton = qt.QRadioButton()
        self._cmButton.setText("Centimeters")
        self._buttonGroup = qt.QButtonGroup(self)
        self._buttonGroup.addButton(self._pageButton)
        self._buttonGroup.addButton(self._inchButton)
        self._buttonGroup.addButton(self._cmButton)
        self._buttonGroup.setExclusive(True)

        # units
        self.mainLayout.addWidget(label, 0, 0, 1, 4)
        hboxLayout.addWidget(self._pageButton)
        hboxLayout.addWidget(self._inchButton)
        hboxLayout.addWidget(self._cmButton)
        self.mainLayout.addWidget(hbox, 1, 0, 1, 4)
        self._pageButton.setChecked(True)

        # xOffset
        label = qt.QLabel(self)
        label.setText("X Offset:")
        self.mainLayout.addWidget(label, 2, 0)
        self._xOffset = qt.QLineEdit(self)
        validator = qt.QDoubleValidator(None)
        self._xOffset.setValidator(validator)
        self._xOffset.setText("0.1")
        self.mainLayout.addWidget(self._xOffset, 2, 1)

        # yOffset
        label = qt.QLabel(self)
        label.setText("Y Offset:")
        self.mainLayout.addWidget(label, 2, 2)
        self._yOffset = qt.QLineEdit(self)
        validator = qt.QDoubleValidator(None)
        self._yOffset.setValidator(validator)
        self._yOffset.setText("0.1")
        self.mainLayout.addWidget(self._yOffset, 2, 3)

        # width
        label = qt.QLabel(self)
        label.setText("Width:")
        self.mainLayout.addWidget(label, 3, 0)
        self._width = qt.QLineEdit(self)
        validator = qt.QDoubleValidator(None)
        self._width.setValidator(validator)
        self._width.setText("0.9")
        self.mainLayout.addWidget(self._width, 3, 1)

        # height
        label = qt.QLabel(self)
        label.setText("Height:")
        self.mainLayout.addWidget(label, 3, 2)
        self._height = qt.QLineEdit(self)
        validator = qt.QDoubleValidator(None)
        self._height.setValidator(validator)
        self._height.setText("0.9")
        self.mainLayout.addWidget(self._height, 3, 3)

        # aspect ratio
        self._aspect = qt.QCheckBox(self)
        self._aspect.setText("Keep screen aspect ratio")
        self._aspect.setChecked(True)
        self.mainLayout.addWidget(self._aspect, 4, 1, 1, 2)