StateIcon improvements
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <QDesignerFormWindowCursorInterface>
|
||||
#include <QDesignerFormWindowInterface>
|
||||
#include <QExtensionManager>
|
||||
#include <QTimer>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <private/qtresourceview_p.h>
|
||||
|
||||
@@ -133,7 +134,14 @@ bool StateIconPlugin::isInitialized() const {
|
||||
|
||||
|
||||
QWidget * StateIconPlugin::createWidget(QWidget * parent) {
|
||||
return new StateIcon(parent);
|
||||
auto * ret = new StateIcon(parent);
|
||||
QDesignerFormWindowInterface * formWindow = QDesignerFormWindowInterface::findFormWindow(parent);
|
||||
if (formWindow) {
|
||||
connect(formWindow, &QDesignerFormWindowInterface::resourceFilesChanged, ret, [ret] {
|
||||
QTimer::singleShot(0, ret, [ret] { ret->loadStates(ret->saveStates()); });
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user