How to remove the need for UI files and build a window entirely with code?
-
Hello all, hope everything is well! Currently, I am trying to figure out how to remove the need for UI files and build an app in Qt entirely from code. Specifically, I want to be able to create an app with just header and source files. How would I do this?
-
@WesLow said in How to remove the need for UI files and build a window entirely with code?:
@sierdzio Thank you very much! Do you know of any examples of this that happen to be on the QT website?
Yeah, almost all of them do :-)
-
You just have to use all the UI classes (QHBoxLayout, QVBoxLayout, QWidget, QListView etc.) manually in C++. This is, by the way, exactly what UI files do: they are converted into C++ code by
uic
and then compiled using normal c++ compiler. -
@WesLow said in How to remove the need for UI files and build a window entirely with code?:
@sierdzio Thank you very much! Do you know of any examples of this that happen to be on the QT website?
Yeah, almost all of them do :-)