Skip to content

Instantly share code, notes, and snippets.

@erap129
Created January 15, 2022 15:33
Show Gist options
  • Select an option

  • Save erap129/90445c26b267fdd89f09ab135a0e574f to your computer and use it in GitHub Desktop.

Select an option

Save erap129/90445c26b267fdd89f09ab135a0e574f to your computer and use it in GitHub Desktop.
select_image_button = QPushButton('Select Image')
process_image_button = QPushButton('Process!')
select_image_button.clicked.connect(self.choose_source_image)
process_image_button.clicked.connect(self.process_image)
for btn in [select_image_button, process_image_button]:
btn.setFixedHeight(30)
btn.setFixedWidth(100)
self.r_select = QSpinBox()
self.g_select = QSpinBox()
self.b_select = QSpinBox()
self.threshold_select = QSpinBox()
for start_val, prefix, spinbox in zip([30, 1, 72, 152], ['Threshold', 'R', 'G', 'B'],
[self.threshold_select, self.r_select, self.g_select, self.b_select]):
spinbox.setPrefix(f'{prefix}:')
spinbox.setMinimum(0)
spinbox.setMaximum(255)
spinbox.setValue(start_val)
spinbox.setFixedWidth(130)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment