2016-08-27 03:56:06 +00:00
|
|
|
#ifndef QDESIGNERCOMMON_P_H
|
|
|
|
#define QDESIGNERCOMMON_P_H
|
|
|
|
|
|
|
|
#include "abstractformeditor.h"
|
|
|
|
#include "qwidget.h"
|
|
|
|
|
2017-04-26 06:28:30 +00:00
|
|
|
Q_DECLARE_METATYPE(QWidgetList)
|
|
|
|
Q_DECLARE_METATYPE(QAction*)
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
2016-08-27 03:56:06 +00:00
|
|
|
enum { FormLayoutColumns = 2 };
|
|
|
|
|
|
|
|
static const char *Geometry = "Geometry";
|
|
|
|
static const char *SplitterPosition = "SplitterPosition";
|
|
|
|
|
|
|
|
// Find the form editor in the hierarchy.
|
|
|
|
// We know that the parent of the sheet is the extension manager
|
|
|
|
// whose parent is the core.
|
|
|
|
|
|
|
|
static QDesignerFormEditorInterface *formEditorForObject(QObject *o) {
|
|
|
|
do {
|
|
|
|
if (QDesignerFormEditorInterface* core = qobject_cast<QDesignerFormEditorInterface*>(o))
|
|
|
|
return core;
|
|
|
|
o = o->parent();
|
|
|
|
} while(o);
|
|
|
|
Q_ASSERT(o);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void recursiveUpdate(QWidget *w)
|
|
|
|
{
|
|
|
|
w->update();
|
|
|
|
|
|
|
|
const QObjectList &l = w->children();
|
|
|
|
const QObjectList::const_iterator cend = l.constEnd();
|
|
|
|
for (QObjectList::const_iterator it = l.constBegin(); it != cend; ++it) {
|
|
|
|
if (QWidget *w = qobject_cast<QWidget*>(*it))
|
|
|
|
recursiveUpdate(w);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-26 06:28:30 +00:00
|
|
|
QT_END_NAMESPACE
|
2016-08-27 03:56:06 +00:00
|
|
|
|
|
|
|
#endif // QDESIGNERCOMMON_P_H
|