Changeset View
Changeset View
Standalone View
Standalone View
lib/crop/cropwidget.cpp
Show First 20 Lines • Show All 277 Lines • ▼ Show 20 Line(s) | 266 | { | |||
---|---|---|---|---|---|
278 | d->advancedWidget->layout()->setMargin(0); | 278 | d->advancedWidget->layout()->setMargin(0); | ||
279 | 279 | | |||
280 | connect(d->preserveAspectRatioCheckBox, &QCheckBox::toggled, this, &CropWidget::applyRatioConstraint); | 280 | connect(d->preserveAspectRatioCheckBox, &QCheckBox::toggled, this, &CropWidget::applyRatioConstraint); | ||
281 | 281 | | |||
282 | d->initRatioComboBox(); | 282 | d->initRatioComboBox(); | ||
283 | 283 | | |||
284 | connect(d->mCropTool, &CropTool::rectUpdated, this, &CropWidget::setCropRect); | 284 | connect(d->mCropTool, &CropTool::rectUpdated, this, &CropWidget::setCropRect); | ||
285 | 285 | | |||
286 | connect(d->leftSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CropWidget::slotPositionChanged); | 286 | connect(d->leftSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &CropWidget::slotPositionChanged); | ||
287 | connect(d->topSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CropWidget::slotPositionChanged); | 287 | connect(d->topSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &CropWidget::slotPositionChanged); | ||
288 | connect(d->widthSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CropWidget::slotWidthChanged); | 288 | connect(d->widthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &CropWidget::slotWidthChanged); | ||
289 | connect(d->heightSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CropWidget::slotHeightChanged); | 289 | connect(d->heightSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &CropWidget::slotHeightChanged); | ||
290 | 290 | | |||
291 | d->initDialogButtonBox(); | 291 | d->initDialogButtonBox(); | ||
292 | 292 | | |||
293 | // We need to listen for both signals because the combobox is multi-function: | 293 | // We need to listen for both signals because the combobox is multi-function: | ||
294 | // Text Changed: required so that manual ratio entry is detected (index doesn't change) | 294 | // Text Changed: required so that manual ratio entry is detected (index doesn't change) | ||
295 | // Index Changed: required so that choosing an item with the same text is detected (e.g. going from US Letter portrait | 295 | // Index Changed: required so that choosing an item with the same text is detected (e.g. going from US Letter portrait | ||
296 | // to US Letter landscape) | 296 | // to US Letter landscape) | ||
297 | connect(d->ratioComboBox, &QComboBox::editTextChanged, this, &CropWidget::slotRatioComboBoxChanged); | 297 | connect(d->ratioComboBox, &QComboBox::editTextChanged, this, &CropWidget::slotRatioComboBoxChanged); | ||
298 | connect(d->ratioComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CropWidget::slotRatioComboBoxChanged); | 298 | connect(d->ratioComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &CropWidget::slotRatioComboBoxChanged); | ||
299 | 299 | | |||
300 | // Don't do this before signals are connected, otherwise the tool won't get | 300 | // Don't do this before signals are connected, otherwise the tool won't get | ||
301 | // initialized | 301 | // initialized | ||
302 | d->initSpinBoxes(); | 302 | d->initSpinBoxes(); | ||
303 | 303 | | |||
304 | setCropRect(d->mCropTool->rect()); | 304 | setCropRect(d->mCropTool->rect()); | ||
305 | } | 305 | } | ||
306 | 306 | | |||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |