Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Qt QColor a part of QtGUI - possible workarounds?

Tags:

qt

qtgui

I'm building a commandline version of an an application that utilizes QColor for cross-platform handling of color data.

For some reason, this datatype is a part of QtGUI even thou it doesn't have anything to do with Widgets - any way to get this class without linking with GUI?

like image 569
qdot Avatar asked Sep 12 '12 14:09

qdot


1 Answers

Probably because it includes all the hooks into the QPainter class to draw colors. Yes in a perfect design it would be possible to abstract all that away, but Qt is mostly a gui library and time is money.

But since it's open source you can just copy the Qcolor .h/.cpp and modif them yourself. If you only need the color space conversion routines you can probably just use the.h

Note: Qt is LGPL so the source to any modifications to the Qt code (but not your own app) must be offered to any users of your app.

like image 192
Martin Beckett Avatar answered Oct 21 '22 07:10

Martin Beckett