-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shared/icon-label: Prevent moc from being appended to global file #11356
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the change itself looks correct, I'm unsure whether it's a worthwhile change as it's mainly a cosmetic change.
If icon-label
is to be a "header-only" library, then it is correct to make all its function implementations inline
(which has become the only meaning of the keyword, mainly to disable the one-definition-rule for the marked functions and variables).
Obviously header-only Qt objects will then incur the compile-time cost of needing their moc
-ed code be included globally in the project.
If that is to be fixed, the entire class should be converted into a "non-header" library, its functions moved into the compilation unit and the header converted to its original purpose as a description of the class memory layout.
2501daa
to
786dd76
Compare
This makes sense. I moved the setter functions into the newly created file. |
I imagine that these files should now be named the same as the class that is defined. |
One could argue that it could keep the current name for consistency with the other elements in the |
Renames the icon-label.hpp header to IconLabel to follow the new convention of files being named the same as the class they contain.
Splits the IconLabel widget header into a header and source file. The source uses the moc_icon-label include to prevent the moc from being included in the global mocs_compilation (as described in 5eb04cd).
786dd76
to
1469951
Compare
Updated the PR to rename the file(s). Left the directory names as-is. |
Description
Like described in 5eb04cd (#11101), this prevents the
moc_icon-label.cpp
from being included in the globalmocs_compilation.cpp
file. Looks a bit ridiculous to create a new file for this, but that's just because content-wise icon-label is only a header.Motivation and Context
Oversight from #11148 due to the fact that there was no
.cpp
file where this include would usually go.How Has This Been Tested?
macOS 15
Looked at
mocs_compilation.cpp
, confirmed that<P4W7YBUBWD/moc_icon-label.cpp>
was included previously but no longer is.Types of changes
Checklist: