[Interest] Disable Qt Concurrent in 5.1 for simple RTOS

George Seibert gseibert92 at gmail.com
Wed Oct 2 08:00:40 CEST 2013

Thanks Thiago, that was very helpful.

We're really only interested in the drawing capabilities, fonts, images,
QWidget, a few simple widgets, and a simple event queue for a small set of
hardware buttons.  The RTOS doesn't have any threading capabilities.  It
sounds like I would need to edit the .pro files to compile only what we
need, and then modify any of those classes that have threading code.  That
way I don't have to modify classes that we won't use.

Does that sound like the best way to get Qt working without threading?

On Tue, Oct 1, 2013 at 8:54 PM, Thiago Macieira
<thiago.macieira at intel.com>wrote:

> On terça-feira, 1 de outubro de 2013 19:12:59, George Seibert wrote:
> > Hi,
> >
> > Has anyone compiled Qt 5 for a simple RTOS without threading?
> >
> > I'm trying to compile Qt 5.1 for a small in-house RTOS which doesn't have
> > threading.  I've tried -no-feature-concurrent, as well as -no-concurrent
> > which isn't understood by configure, but Qt Concurrent is still reported
> as
> > "yes" at the end of running configure.
> Do you have compilation errors with QtConcurrent? If the module doesn't
> make
> sense for your OS, don't use it in your applications.
> If the compiler in your OS is too old to understand QtConcurrent's
> template-
> heavy code, you should edit the configure script and search for
> canBuildConcurrent. Right after that, there's a switch checking for OS and
> compiler which you can use to disable QtConcurrent.
> > I've used the configure switch -no-feature-thread to disable threads, but
> > I've run into compile errors regarding QThreadData.  This, after solving
> a
> > compile error in qpropertyanimation.cpp that was missing an #ifndef
> > QT_NO_THREAD around the QMutex locker.unlock() call.  The errors
> regarding
> > QThreadData are more complex (invalid use of incomplete type in
> qthread_p.h
> > and forward declaration in qobject.h).
> Qt requires threads, period. There is no support for disabling threads in
> the
> Qt code. The last version that supported building without threads was 3.3.
> The QT_NO_THREAD macro exists only as a convenience for the bootstrapped
> code
> (qmake, moc, rcc) which don't use threads, ever. They also don't use
> QObject.
> The main QtCore code, plus the rest of the modules, assumes threads are
> available and will use them.
> Some classes *require* threads to work: QFileSystemModel, QProcess, etc.
> > I'm fairly sure I can solve the compile errors, but the errors lead me to
> > believe I'm not properly disabling threads/concurrency using configure.
> > How do I disable threads and concurrency?
> To disable QtConcurrent, see above.
> You don't disable threads. At least, not without heavy modification of the
> code.
> If you need just some simple classes, you may be able to use
> libQtBootstrap.a
> (the one that moc and rcc use). Note: there's absolutely no guarantee that
> this lib works or that it will remain present in future versions.
> > Also, is there any way to disable the networking features?  According to
> > the configure help, you can disable features with the
> -no-feature-<FEATURE>
> > switch, with features listed in qfeatures.txt.  I've tried, for example,
> > -no-feature-getaddrinfo, yet it's still reported as "yes" at the end of
> > running configure.
> That's because your OS supports getaddrinfo. Why do you want to disable
> code
> that works?
> The -no-feature-<FEATURE> option exists for disabling Qt features, like
> disabling support for file dialogs, ItemViews, drag and drop, etc. It's
> not for
> OS-detection.
> Also note that the feature system is not frequently tested. I can put you
> in
> contact with someone who used to maintain that (and has recently supplied
> patches to make it work), but the Qt Project does not guarantee that Qt
> works
> or even compiles if any feature is disabled. The Qt Project only supports a
> full build of each module.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131002/f9092640/attachment.html>

More information about the Interest mailing list