Пример #1
0
    def create_layout(self):
        layout = QtWidgets.QVBoxLayout()

        upper_toolbar = QtWidgets.QHBoxLayout()
        self.add_format_box(upper_toolbar)
        self.add_size_boxes(upper_toolbar)
        upper_toolbar.addStretch()
        self.add_flip_checkbox(upper_toolbar)
        self.add_brightness_box(upper_toolbar)

        lower_toolbar = QtWidgets.QHBoxLayout()
        self.add_address_label(lower_toolbar)
        lower_toolbar.addStretch()
        self.add_goto_button(lower_toolbar)
        self.add_redraw_button(lower_toolbar)
        self.add_save_button(lower_toolbar)

        self.image_label = QtWidgets.QLabel()
        self.image_label.setAlignment(QtCore.Qt.AlignCenter)
        scroll_area = QtWidgets.QScrollArea()
        scroll_area.setWidget(self.image_label)
        scroll_area.setWidgetResizable(True)
        layout.addLayout(upper_toolbar)
        layout.addWidget(scroll_area)
        layout.addLayout(lower_toolbar)

        return layout
Пример #2
0
 def add_brightness_box(self, layout):
     layout.addWidget(QtWidgets.QLabel('Brightness:'))
     self.brightness_box = QtWidgets.QDoubleSpinBox()
     self.brightness_box.setMinimum(0.0)
     self.brightness_box.setMaximum(100.0)
     self.brightness_box.valueChanged.connect(self.brightness_changed)
     layout.addWidget(self.brightness_box)
Пример #3
0
 def add_size_boxes(self, layout):
     self.width_box = QtWidgets.QSpinBox()
     self.width_box.setMinimum(1)
     self.width_box.setMaximum(4096)
     self.width_box.valueChanged.connect(self.width_changed)
     layout.addWidget(self.width_box)
     layout.addWidget(QtWidgets.QLabel('x'))
     self.height_box = QtWidgets.QSpinBox()
     self.height_box.setMinimum(1)
     self.height_box.setMaximum(4096)
     self.height_box.valueChanged.connect(self.height_changed)
     layout.addWidget(self.height_box)
Пример #4
0
 def add_address_label(self, layout):
     address_label1 = QtWidgets.QLabel('Address:')
     address_label2 = QtWidgets.QLabel('...')
     layout.addWidget(address_label1)
     layout.addWidget(address_label2)
     self.address_label = address_label2
Пример #5
0
 def add_address_label(self, layout):
     layout.addWidget(QtWidgets.QLabel("Address:"))
     self.address_label = QtWidgets.QLabel("...")
     self.size_label = QtWidgets.QLabel("...")
     layout.addWidget(self.address_label)
     layout.addWidget(self.size_label)