24 q_ptr->resize(q_ptr->size() + QSize(extensionWidthHint, 0));
26 q_ptr->setMinimumSize(1, 1);
27 q_ptr->resize(q_ptr->size() - QSize(extensionWidthHint, 0));
28 q_ptr->setMinimumSize(0, 0);
160QtGradientDialog::QtGradientDialog(QWidget *parent)
161 : QDialog(parent), d_ptr(
new QtGradientDialogPrivate())
165 d_ptr->m_ui.setupUi(
this);
166 QPushButton *button = d_ptr->m_ui.buttonBox->button(QDialogButtonBox::Ok);
168 button->setAutoDefault(
false);
169 button = d_ptr->m_ui.buttonBox->button(QDialogButtonBox::Cancel);
171 button->setAutoDefault(
false);
172 connect(d_ptr->m_ui.gradientEditor, &QtGradientEditor::aboutToShowDetails,
173 d_ptr.data(), &QtGradientDialogPrivate::slotAboutToShowDetails);
290QGradient QtGradientDialog::getGradient(
bool *ok,
const QGradient &initial, QWidget *parent,
const QString &caption)
292 QtGradientDialog dlg(parent);
293 if (!caption.isEmpty())
294 dlg.setWindowTitle(caption);
295 dlg.setGradient(initial);
296 const int res = dlg.exec();
298 *ok = (res == QDialog::Accepted) ?
true :
false;
300 if (res == QDialog::Accepted)
301 return dlg.gradient();