[Interest] Two from one.
Benjamin TERRIER
b.terrier at gmail.com
Sat Feb 10 23:51:37 CET 2018
2018-02-09 14:40 GMT+01:00 william.crocker at analog.com <
william.crocker at analog.com>:
>
>
>> Think about C++ classes and files. If you have 3 classes like A, B and C,
>> it is
>> common practice
>> to have them defined in 3 header files in particular if they are complex
>> classes, even if both B and C inherits from A.
>> And hardly anyone would try to put the 3 of them in a single header file,
>> even
>> though C++ completely support having an
>> arbitrary number of classes in a single file.
>>
>>
> If I have a significant class that is best implemented with a number of
> other insignificant, one-off classes, I am not going to give each one
> their own
> file.
>
> The QRegExp class implementation (5.7) is a good example.
> The file qregexp.cc contains 10 helper structs. (struct is
> the lazy man's class.) Development of QRegExp would not have
> benefited from giving each one it's on header and source file.
>
>
What's your point?
You have found a counter example to what I said about classes and files,
and you are trying to
prove me wrong by ignoring what I wrote (*common practice* and *in
particular if they
are complex classes*).
Yet it seems we both agree that 2 complex classes (let's say QString and
QObject)
are often declared in different files and that a file can contain more than
one class
declaration, in particular if they are helper classes.
Anyway, I don't see how making this point about QRegExp support your case.
In fine, we are talking about qmake, not C++. I was merely illustrating my
point with C++.
But let's continue the comparison.
You can have "helper targets" in a .pro file too. This is done by using
`QMAKE_EXTRA_TARGETS`
and such. However, you shouldn't have 2 full complex build targets in a
single .pro file.
Not only it is bad practice, but it is not supported by qmake.
In the end, it is your project and you will do as you want.
But you have been warned: "you are creating a trap that your
future self with get stuck into" (and the QRegExp helpers won't help you
then).
Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180210/f5f55475/attachment.html>
More information about the Interest
mailing list