Changeset View
Changeset View
Standalone View
Standalone View
src/screenshotdialog.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 80 | { | |||
---|---|---|---|---|---|
81 | m_dialog->setupUi(this); | 81 | m_dialog->setupUi(this); | ||
82 | 82 | | |||
83 | connect(m_dialog->buttonBox, &QDialogButtonBox::accepted, this, &ScreenshotDialog::accept); | 83 | connect(m_dialog->buttonBox, &QDialogButtonBox::accepted, this, &ScreenshotDialog::accept); | ||
84 | connect(m_dialog->buttonBox, &QDialogButtonBox::rejected, this, &ScreenshotDialog::reject); | 84 | connect(m_dialog->buttonBox, &QDialogButtonBox::rejected, this, &ScreenshotDialog::reject); | ||
85 | connect(m_dialog->takeScreenshotButton, &QPushButton::clicked, this, [this] () { | 85 | connect(m_dialog->takeScreenshotButton, &QPushButton::clicked, this, [this] () { | ||
86 | QTimer::singleShot(1000 * m_dialog->delaySpinBox->value(), this, &ScreenshotDialog::takeScreenshot); | 86 | QTimer::singleShot(1000 * m_dialog->delaySpinBox->value(), this, &ScreenshotDialog::takeScreenshot); | ||
87 | }); | 87 | }); | ||
88 | 88 | | |||
89 | connect(m_dialog->areaComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this] (int index) { | 89 | connect(m_dialog->areaComboBox, | ||
90 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) | ||||
91 | QOverload<int, const QString&>::of(&QComboBox::currentIndexChanged), | ||||
92 | #else | ||||
93 | QOverload<int>::of(&QComboBox::currentIndexChanged), | ||||
94 | #endif | ||||
95 | this, [this] (int index) { | ||||
90 | m_dialog->includeBordersCheckbox->setEnabled(index == 2); | 96 | m_dialog->includeBordersCheckbox->setEnabled(index == 2); | ||
91 | }); | 97 | } | ||
98 | ); | ||||
92 | 99 | | |||
93 | m_dialog->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); | 100 | m_dialog->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); | ||
94 | 101 | | |||
95 | setWindowTitle(i18n("Request screenshot")); | 102 | setWindowTitle(i18n("Request screenshot")); | ||
96 | } | 103 | } | ||
97 | 104 | | |||
98 | ScreenshotDialog::~ScreenshotDialog() | 105 | ScreenshotDialog::~ScreenshotDialog() | ||
99 | { | 106 | { | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |