Qt Designer, UI Plugin, and UI Tools#297
Conversation
| []string{ | ||
| "/usr/include/x86_64-linux-gnu/qt6/QtDesigner", | ||
| }, | ||
| ExceptHeaders("qdesigner_components.h"), |
There was a problem hiding this comment.
Out of interest - did something go wrong with the binding here? This header contains createFormEditor which allows embedding the entire Designer interface inside another Qt app, like Qt Creator does 😲
There was a problem hiding this comment.
Unfortunately. It's working downstream so I know it's possible. It's part of the TODO and I included a similar note in the config-allowlist.go for another discrepancy between here and downstream.
The error:
qt-designer$ go build
# github.com/mappu/miqt/examples/libraries/qt-designer
/usr/lib/go-1.23/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/g++ @/tmp/go-link-444853855/response
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_initializeResources':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:21: undefined reference to `QDesignerComponents::initializeResources()'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_initializePlugins':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:25: undefined reference to `QDesignerComponents::initializePlugins(QDesignerFormEditorInterface*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createFormEditor':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:29: undefined reference to `QDesignerComponents::createFormEditor(QObject*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createWidgetBox':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:33: undefined reference to `QDesignerComponents::createWidgetBox(QDesignerFormEditorInterface*, QWidget*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createPropertyEditor':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:37: undefined reference to `QDesignerComponents::createPropertyEditor(QDesignerFormEditorInterface*, QWidget*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createObjectInspector':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:41: undefined reference to `QDesignerComponents::createObjectInspector(QDesignerFormEditorInterface*, QWidget*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createActionEditor':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:45: undefined reference to `QDesignerComponents::createActionEditor(QDesignerFormEditorInterface*, QWidget*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createTaskMenu':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:49: undefined reference to `QDesignerComponents::createTaskMenu(QDesignerFormEditorInterface*, QObject*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createResourceEditor':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:53: undefined reference to `QDesignerComponents::createResourceEditor(QDesignerFormEditorInterface*, QWidget*)'
/usr/bin/ld: /tmp/go-link-444853855/000748.o: in function `QDesignerComponents_createSignalSlotEditor':
/home/rcalixte/git/MIQT/qt/designer/gen_qdesigner_components.cpp:57: undefined reference to `QDesignerComponents::createSignalSlotEditor(QDesignerFormEditorInterface*, QWidget*)'
collect2: error: ld returned 1 exit status
I tried a few things but none of them stuck. I'm open to any ideas!
|
Looks great! Thanks again @rcalixte ! I think in practice you'd definitely use uic for an optimized build.
|
I see it as another tool to aid the development. Comparing with the C++ and Python outputs are great but being able to run the form vs the generated form I think has great value.
On my "when I'm done with heavy maintenance and adding modules" list of things to do is see about making custom widgets. Having spent time with the KDE Frameworks, there's no reason those modules couldn't be ported to another language if not created there entirely. How cool would it be to have native Go-only Qt modules? These families of libraries keep being a lot of fun to work on because of the "never before seen" and "no one ever thought it would happen" aspects that keep presenting themselves. |
There's a bit of a TODO here around the custom widgets but as-is, this allows for a few options to directly import forms as widgets. When combined with the support for translation (via miqt or Qt) and Qt's resource system, this puts less strain on miqt-uic.
I tweaked the sizes of the widgets just for the sake of variation but it also goes to show that the widgets are imported as regular widgets which can conflict with the definition in the form. Ultimately, the native Go structs generated by miqt-uic are still the best option for deeper widget customization/interaction.