Skip to content

Qt Designer, UI Plugin, and UI Tools#297

Merged
mappu merged 10 commits intomappu:masterfrom
rcalixte:forms_modules
Jan 2, 2026
Merged

Qt Designer, UI Plugin, and UI Tools#297
mappu merged 10 commits intomappu:masterfrom
rcalixte:forms_modules

Conversation

@rcalixte
Copy link
Contributor

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.

[]string{
"/usr/include/x86_64-linux-gnu/qt6/QtDesigner",
},
ExceptHeaders("qdesigner_components.h"),
Copy link
Owner

@mappu mappu Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😲

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@mappu
Copy link
Owner

mappu commented Dec 22, 2025

Looks great! Thanks again @rcalixte !

I think in practice you'd definitely use uic for an optimized build.

  • Using designer libraries at runtime could be more convenient for avoiding an extra codegen step, so it's definitely interesting to have this as an option.
  • We could also expand the automated testing for miqt-uic to compare against the libdesigner-generated widgets.
  • But I think the intended- and coolest- possible use of this library would be to embed it in a new Miqt IDE (or a Nim/Zig IDE...).

@rcalixte
Copy link
Contributor Author

We could also expand the automated testing for miqt-uic to compare against the libdesigner-generated widgets.

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.

But I think the intended- and coolest- possible use of this library would be to embed it in a new Miqt IDE (or a Nim/Zig IDE...).

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.

@mappu mappu merged commit 0668c0d into mappu:master Jan 2, 2026
10 checks passed
@rcalixte rcalixte deleted the forms_modules branch January 2, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants