diff --git a/src/assistant/qlitehtml b/src/assistant/qlitehtml
index 4931b7aa..908670c5 160000
--- a/src/assistant/qlitehtml
+++ b/src/assistant/qlitehtml
@@ -1 +1 @@
-Subproject commit 4931b7aa30f256c20573d283561aa432fecf8f38
+Subproject commit 908670c5b68d3bcf4712019a028079b8b2042dd4
diff --git a/src/designer/src/components/objectinspector/objectinspector.cpp b/src/designer/src/components/objectinspector/objectinspector.cpp
index c34df34f..33f34153 100644
--- a/src/designer/src/components/objectinspector/objectinspector.cpp
+++ b/src/designer/src/components/objectinspector/objectinspector.cpp
@@ -124,6 +124,7 @@ public:
QWidget *ObjectInspectorDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & option, const QModelIndex &index) const
{
+ qDebug() << __FUNCTION__ << index;
if (index.column() != ObjectInspectorModel::ObjectNameColumn)
return QStyledItemDelegate::createEditor(parent, option, index);
// Object name editor
@@ -145,6 +146,11 @@ protected:
void mouseMoveEvent (QMouseEvent * event) override;
void keyPressEvent(QKeyEvent *event) override;
+ void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) override
+ {
+ QTreeView::closeEditor(editor, hint);
+ qDebug() << __FUNCTION__ << hint;
+ }
};
void ObjectInspectorTreeView::mouseMoveEvent(QMouseEvent *event)
@@ -418,6 +424,7 @@ QObject *ObjectInspector::ObjectInspectorPrivate::objectAt(const QModelIndex &in
bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o)
{
+ qDebug() << __FUNCTION__ << o;
if (!m_core->metaDataBase()->item(o))
return false;
@@ -444,6 +451,7 @@ bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o)
void ObjectInspector::ObjectInspectorPrivate::selectIndexRange(const QModelIndexList &indexes, unsigned flags)
{
+ qDebug() << __FUNCTION__ << indexes << Qt::hex << "0x" << flags;
if (indexes.isEmpty())
return;
@@ -455,17 +463,20 @@ void ObjectInspector::ObjectInspectorPrivate::selectIndexRange(const QModelIndex
QItemSelectionModel *selectionModel = m_treeView->selectionModel();
const QModelIndexList::const_iterator cend = indexes.constEnd();
- for (QModelIndexList::const_iterator it = indexes.constBegin(); it != cend; ++it)
+ for (QModelIndexList::const_iterator it = indexes.constBegin(); it != cend; ++it) {
+ qDebug() << __FUNCTION__ << it->row() << it->data();
if (it->column() == 0) {
selectionModel->select(*it, selectFlags);
selectFlags &= ~(QItemSelectionModel::Clear|QItemSelectionModel::Current);
}
+ }
if (flags & MakeCurrent)
m_treeView->scrollTo(indexes.constFirst(), QAbstractItemView::EnsureVisible);
}
void ObjectInspector::ObjectInspectorPrivate::clear()
{
+ qDebug() << __FUNCTION__ ;
m_formFakeDropTarget = nullptr;
m_formWindow = nullptr;
}
@@ -482,6 +493,7 @@ static inline bool mainContainerIsCurrent(const QDesignerFormWindowInterface *fw
void ObjectInspector::ObjectInspectorPrivate::setFormWindow(QDesignerFormWindowInterface *fwi)
{
+ qDebug() << __FUNCTION__ << fwi;
const bool blocked = m_treeView->selectionModel()->blockSignals(true);
{
UpdateBlocker ub(m_treeView);
@@ -494,6 +506,7 @@ void ObjectInspector::ObjectInspectorPrivate::setFormWindow(QDesignerFormWindowI
void ObjectInspector::ObjectInspectorPrivate::setFormWindowBlocked(QDesignerFormWindowInterface *fwi)
{
+ qDebug() << __FUNCTION__ << fwi;
FormWindowBase *fw = qobject_cast(fwi);
const bool formWindowChanged = m_formWindow != fw;
@@ -546,6 +559,7 @@ void ObjectInspector::ObjectInspectorPrivate::setFormWindowBlocked(QDesignerForm
// Apply selection of form window cursor to object inspector, set current
void ObjectInspector::ObjectInspectorPrivate::applyCursorSelection()
{
+ qDebug() << __FUNCTION__;
const QDesignerFormWindowCursorInterface *cursor = m_formWindow->cursor();
const int count = cursor->selectedWidgetCount();
if (!count)
@@ -633,6 +647,7 @@ bool ObjectInspector::ObjectInspectorPrivate::checkManagedWidgetSelection(const
void ObjectInspector::ObjectInspectorPrivate::synchronizeSelection(const QItemSelection & selectedSelection, const QItemSelection &deselectedSelection)
{
+ qDebug() << __FUNCTION__ ;
// Synchronize form window cursor.
const QObjectVector deselected = indexesToObjects(deselectedSelection.indexes());
const QObjectVector newlySelected = indexesToObjects(selectedSelection.indexes());
@@ -768,6 +783,9 @@ ObjectInspector::ObjectInspector(QDesignerFormEditorInterface *core, QWidget *pa
connect(treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &ObjectInspector::slotSelectionChanged);
+ connect(treeView->selectionModel(), &QItemSelectionModel::currentChanged,
+ this, []() { qDebug("currentChanged"); });
+
connect(treeView->header(), &QHeaderView::sectionDoubleClicked,
this, &ObjectInspector::slotHeaderDoubleClicked);
setAcceptDrops(true);
@@ -790,11 +808,13 @@ void ObjectInspector::slotPopupContextMenu(const QPoint &pos)
void ObjectInspector::setFormWindow(QDesignerFormWindowInterface *fwi)
{
+ qDebug() << __FUNCTION__ << fwi;
m_impl->setFormWindow(fwi);
}
void ObjectInspector::slotSelectionChanged(const QItemSelection & selected, const QItemSelection &deselected)
{
+ qDebug() << __FUNCTION__ ;
m_impl->slotSelectionChanged(selected, deselected);
}
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
index 3f8c6a66..aed344bc 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp
+++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
@@ -254,6 +254,21 @@ namespace qdesigner_internal {
}
}
+ void ObjectData::format(QDebug &d) const
+ {
+ d << "ObjectData(\"" << m_objectName << "\", \"" << m_className
+ << "\", " << m_type << ", " << m_object->metaObject()->className() << ")\n";
+ }
+
+ QDebug operator<<(QDebug d, const ObjectData &o)
+ {
+ QDebugStateSaver s(d);
+ d.noquote();
+ d.nospace();
+ o.format(d);
+ return d;
+ }
+
void ObjectData::setItems(const StandardItemList &row, const ObjectInspectorIcons &icons) const
{
const QVariant object = QVariant::fromValue(m_object);
@@ -269,6 +284,7 @@ namespace qdesigner_internal {
ObjectModel &model,
const ModelRecursionContext &ctx)
{
+ qDebug() << __FUNCTION__ << object;
using ButtonGroupList = QList;
// 1) Create entry
const ObjectData entry(parent, object, ctx);
@@ -290,6 +306,7 @@ namespace qdesigner_internal {
if (!object->children().isEmpty()) {
ButtonGroupList buttonGroups;
QObjectList children = object->children();
+ qDebug() << "sorting children";
std::sort(children.begin(), children.end(), sortEntry);
for (QObject *childObject : qAsConst(children)) {
// Managed child widgets unless we had a container extension
@@ -357,6 +374,7 @@ namespace qdesigner_internal {
ObjectInspectorModel::UpdateResult ObjectInspectorModel::update(QDesignerFormWindowInterface *fw)
{
+ qDebug() << __FUNCTION__;
QWidget *mainContainer = fw ? fw->mainContainer() : nullptr;
if (!mainContainer) {
clearItems();
@@ -372,11 +390,16 @@ namespace qdesigner_internal {
const ModelRecursionContext ctx(fw->core(), separator);
createModelRecursion(fw, nullptr, mainContainer, newModel, ctx);
+ qDebug() << __FUNCTION__ << "comparing" << newModel.size() << m_model.size()
+ << "\nold" << m_model << "\nnew" << newModel;
+
if (newModel == m_model) {
+ qDebug() << __FUNCTION__ << "equal";
updateItemContents(m_model, newModel);
return Updated;
}
+ qDebug() << __FUNCTION__ << "rebuild";
rebuild(newModel);
m_model = newModel;
return Rebuilt;
@@ -407,6 +430,7 @@ namespace qdesigner_internal {
// Rebuild the tree in case the model has completely changed.
void ObjectInspectorModel::rebuild(const ObjectModel &newModel)
{
+ qDebug() << __FUNCTION__ << newModel.size();
clearItems();
if (newModel.isEmpty())
return;
@@ -426,6 +450,7 @@ namespace qdesigner_internal {
StandardItemList row = createModelRow(it->object());
it->setItems(row, m_icons);
parentItem->appendRow(row);
+ qDebug() << __FUNCTION__ << "inserting into m_objectIndexMultiMap";
m_objectIndexMultiMap.insert(it->object(), indexFromItem(row.constFirst()));
}
}
@@ -433,6 +458,7 @@ namespace qdesigner_internal {
// Update item data in case the model has the same structure
void ObjectInspectorModel::updateItemContents(ObjectModel &oldModel, const ObjectModel &newModel)
{
+ qDebug() << __FUNCTION__ << oldModel.size();
// Change text and icon. Keep a set of changed object
// as for example actions might occur several times in the tree.
using QObjectSet = QSet;
@@ -482,6 +508,7 @@ namespace qdesigner_internal {
if (!object)
return false;
// Is this a layout widget?
+ qDebug() << __FUNCTION__ << value;
const QString nameProperty = isQLayoutWidget(object) ? QStringLiteral("layoutName") : QStringLiteral("objectName");
m_formWindow->commandHistory()->push(createTextPropertyCommand(nameProperty, value.toString(), object, m_formWindow));
return true;
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
index f138253a..9955b2a5 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h
+++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
@@ -98,6 +98,8 @@ namespace qdesigner_internal {
// Update row data according to change mask
void setItemsDisplayData(const StandardItemList &row, const ObjectInspectorIcons &icons, unsigned mask) const;
+
+ void format(QDebug &d) const;
private:
void initObject(const ModelRecursionContext &ctx);
void initWidget(QWidget *w, const ModelRecursionContext &ctx);
@@ -114,6 +116,8 @@ namespace qdesigner_internal {
inline bool operator==(const ObjectData &e1, const ObjectData &e2) { return e1.equals(e2); }
inline bool operator!=(const ObjectData &e1, const ObjectData &e2) { return !e1.equals(e2); }
+ QDebug operator<<(QDebug d, const ObjectData &o);
+
using ObjectModel = QList;
// QStandardItemModel for ObjectInspector. Uses ObjectData/ObjectModel