[Qt5-feedback] What is the Qt view of targets, and is it the same as QtSDKs ?
Attila Csipa
qt at csipa.in.rs
Wed Jun 15 19:46:12 CEST 2011
On Wednesday 15 June 2011 16:32:01 you wrote:
> > number of targets, but we do not target all possible combinations).
>
> I have to quite disagree. The #if Q_OS stuff compliments the build system
> and is quite required.
It will certainly have to be kept for compatibility reasons and is certainly
convenient for oneliners... BUT (always this but :). Is it *enough* ? (I'm not
trying to remove Q_OS and friends, I'm trying to find an alternative). This
tendency is not new, first was the introduction of scopes in the (q)make
system. But we can take it further - Q_OS or scoping won't really help with
resource files (unless you are willing to maintain several copies), QML files,
packaging requirements, platform policies, per distribution optimizations, etc
(coincidentally, this is also the reason why Linux distributions don't patch
with putting things into #ifdefs as that would limit the options wrt to
language, they just patch the upstream resources, whether that be c++ or
python, resource file or code).
The bottom line is that the basic idea of Qt was to hide away platform related
ifdeffing. On the desktop, this worked (and still does) pretty well, since you
only had three major platforms, Linux, Mac, Windows, and Qt never tried to
produce distribution-ready output. Unfortunately, given the number of QtSDK
targets nowadays (platforms, distros, devices, your pick) and type of
resources being used, the classic scope {} and #ifdef to me has the feeling of
just not cutting it any more.
> As with any tool, it can - of course - be misused; but it has very
> appropriate and valid uses that are not possible using other methods.
While depending on the actual case I would agree about convenience, I find "not
possible using other methods" a bit too strong of a wording :) Can you share
an example using #ifdef Q_OS_* that say, an integrated .diff approach couldn't
solve (not saying .diff is the best thing since sliced bread, just using it as
an alternative technology example that is familiar to a lot of people) ?
Best regards,
Attila Csipa
More information about the Qt5-feedback
mailing list