QtUiTools: Remove Q3Support.

Remove special handling of Q3ButtonGroup in form builder.
This commit is contained in:
Friedemann Kleint 2011-05-06 09:33:45 +02:00
parent ec88a76127
commit 69c4b97be2
2 changed files with 1 additions and 33 deletions

View File

@ -2255,21 +2255,6 @@ void QAbstractFormBuilder::saveComboBoxExtraInfo(QComboBox *comboBox, DomWidget
ui_widget->setElementItem(ui_items);
}
// Return the buttongroups assigned to a button except the internal one
// (with empty object name) used by Q3ButtonGroup.
static inline const QButtonGroup *formButtonGroup(const QAbstractButton *widget)
{
const QButtonGroup *buttonGroup = widget->group();
if (!buttonGroup)
return 0;
if (buttonGroup->objectName().isEmpty()) {
if (const QWidget *parent = widget->parentWidget())
if (!qstrcmp(parent->metaObject()->className(), "Q3ButtonGroup"))
return 0;
}
return buttonGroup;
}
/*!
\internal
\since 4.5
@ -2278,7 +2263,7 @@ static inline const QButtonGroup *formButtonGroup(const QAbstractButton *widget)
void QAbstractFormBuilder::saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *)
{
typedef QList<DomProperty*> DomPropertyList;
if (const QButtonGroup *buttonGroup = formButtonGroup(widget)) {
if (const QButtonGroup *buttonGroup = widget->group()) {
DomPropertyList attributes = ui_widget->elementAttribute();
DomString *domString = new DomString();
domString->setText(buttonGroup->objectName());

View File

@ -268,23 +268,6 @@ QLayout *QFormBuilder::createLayout(const QString &layoutName, QObject *parent,
if (l) {
l->setObjectName(name);
if (parentLayout) {
QWidget *w = qobject_cast<QWidget *>(parentLayout->parent());
if (w && w->inherits("Q3GroupBox")) {
l->setContentsMargins(w->style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
w->style()->pixelMetric(QStyle::PM_LayoutTopMargin),
w->style()->pixelMetric(QStyle::PM_LayoutRightMargin),
w->style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
QGridLayout *grid = qobject_cast<QGridLayout *>(l);
if (grid) {
grid->setHorizontalSpacing(-1);
grid->setVerticalSpacing(-1);
} else {
l->setSpacing(-1);
}
l->setAlignment(Qt::AlignTop);
}
}
} else {
qWarning() << QCoreApplication::translate("QFormBuilder", "The layout type `%1' is not supported.").arg(layoutName);
}