31 : QWidget(parent), m_button(
new QToolButton(
this))
33 QLayout *layout =
new QHBoxLayout(
this);
34 layout->setContentsMargins(QMargins());
35 layout->addWidget(editor);
37 m_button->setToolButtonStyle(Qt::ToolButtonIconOnly);
38 m_button->setIcon(createIconSet(
"resetproperty.png"_L1));
39 m_button->setIconSize(QSize(8,8));
40 m_button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
41 connect(m_button, &QAbstractButton::clicked,
this, &ResetWidget::reset);
42 layout->addWidget(m_button);
43 setFocusProxy(editor);
44 setAutoFillBackground(
true);
45 setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
71 const QString &propertyName)
73 const QDesignerFormWindowInterface *form = core->formWindowManager()->activeFormWindow();
76 const QDesignerFormWindowCursorInterface *cursor = form->cursor();
77 const int selectionSize = cursor->selectedWidgetCount();
78 if (selectionSize < 2)
80 for (
int i = 0; i < selectionSize; ++i) {
81 const QDesignerPropertySheetExtension *sheet =
82 qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(),
83 cursor->selectedWidget(i));
84 const int index = sheet->indexOf(propertyName);
85 if (index >= 0 && sheet->isChanged(index))
103 m_property(property),
104 m_textLabel(
new QLabel(
this)),
105 m_iconLabel(
new QLabel(
this))
107 m_textLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
108 m_iconLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
109 QLayout *layout =
new QHBoxLayout(
this);
110 layout->setContentsMargins({});
111 layout->addWidget(m_iconLabel);
112 layout->addWidget(m_textLabel);