Configuring QtGui for only QGraphicsView

  • In the interests of minimizing binary size (and resource usage on my embedded target) I'd like to configure Qt to be as small as possible.

    We already use static linking and a minimal config.h. It occurred to me that by far the majority of code in QtGui must be QWidget and all of it's ancestors - none of which our application requires.

    Has anyone ever tried to configure Qt down this much?

  • If you don't do it already: For an embedded target, you could use the auxiliary tool qconfig: see the keyword "Fine-Tuning Features in Qt" in the Qt documentation. It is a simple GUI that lets you select and de-select the features or class you want excluded. It makes sure that class depending on an excluded class are excluded, too.

    You cannot get rid of QWidget itself, because QGraphicsView inherits QWidget. But I would expect that most of the classes derived from QWidget should disappear. If you look at src/corelib/global/qfeatures.txt and search for "# Widgets", "# Dialogs", "# ItemViews", and "# Styles", you get a pretty good idea, what can and will be removed.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.