Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Qt modules #14

Closed
stloeffler opened this issue Apr 13, 2012 · 8 comments
Closed

Missing Qt modules #14

stloeffler opened this issue Apr 13, 2012 · 8 comments

Comments

@stloeffler
Copy link
Contributor

The following modules are not available after make qt:
QtHelp, QtDesigner, QtUiTools, Phonon

E.g., putting


in a source file produces a "file not found" error during compilation (even with CONFIG += uitools in the .pro file).

@mabrand
Copy link
Member

mabrand commented Apr 14, 2012

Phonon cannot be built with -static. I'll have to look into the other ones. It might be obvious, but would you mind explaining the use case for cross-building the other modules you mentioned?

@stloeffler
Copy link
Contributor Author

OK, thanks for looking into this.
QtUiTools provides the QUiLoader class (http://qt-project.org/doc/qt-4.8/quiloader.html) which can be used to create widgets dynamically from .ui files at runtime. TeXworks, for example, uses that to provide scripts (e.g., written in QtScript) the ability to create widgets (due to the nature of scripts, this needs to be done dynamically at run-time).
For that, I used the following patch so far:

--- mingw-cross-env-2.18.orig/src/qt.mk 2010-06-16 19:04:40.000000000 +0200
+++ mingw-cross-env-2.18/src/qt.mk      2010-06-24 21:40:26.999785528 +0200
@@ -80,4 +80,7 @@
     cd               '$(1)/test-qt' && '$(TARGET)-qmake'
     $(MAKE)       -C '$(1)/test-qt' -j '$(JOBS)'
     $(INSTALL) -m755 '$(1)/test-qt/release/test-qt.exe' '$(PREFIX)/$(TARGET)/bin/'
+
-    cd '$(1)/tools/designer/src/uitools' && $(TARGET)-qmake
-    $(MAKE) -C '$(1)/tools/designer/src/uitools' -j 1 install
  endef```
  It simply builds the files required for TeXworks. But maybe there is a better way...

QtHelp (http://qt-project.org/doc/qt-4.8/qthelp.html) provides access to help files produced by the Qt help collection generator (which can be used to create a help file similar to .chm on Windows). That can then be viewed in QtAssistant, or embedded into an application using the QHelpEngine class (which is part of the QtHelp module), e.g., to display it inline, or to provide "What's This" kind of help. I haven't used it in any production-ready application yet myself, though.

Finally, the QtDesigner module (http://qt-project.org/doc/qt-4.8/qtdesigner.html) contains mainly classes to compile plugins (e.g., new widgets, tools, or whatever) of QtDesigner, as I understand it. It also provides a QFormBuilder class which seems to have a similar purpose as QUiLoader above. I haven't used the QtDesigner module, yet, however, and don't intend to in the near future. I just provided it for the sake of completeness.

All other modules (including Qt3Support) seem to work fine (though most of them I only tested by including the respective header files).

@mabrand
Copy link
Member

mabrand commented Apr 20, 2012

I added uitools based on your diff in 7a626e5. Could you check that?

@stloeffler
Copy link
Contributor Author

Looking good, thanks for applying (I didn't recompile Qt, though, as that takes several hours on my machine; maybe I find the time next week).
FWIW, the following lines seem to work for building the QtHelp and QtDesigner modules (I only tested if a program including the headers compiles and the libs are found; I didn't actually use any functions provided by the modules):

# Build (and install) the QtDesigner module
cd '$(1)/tools/designer/src/lib' && '$(1)/bin/qmake' lib.pro
$(MAKE) -C '$(1)/tools/designer/src/lib' -j '$(JOBS)' install

# Build (and install) the QtHelp module
cd '$(1)/tools/assistant/lib' && '$(1)/bin/qmake' lib.pro
$(MAKE) -C '$(1)/tools/assistant/lib' -j '$(JOBS)' install

@mabrand
Copy link
Member

mabrand commented Apr 21, 2012

Would you mind testing that these libraries can actually be linked to an application successfully and that it runs?

See also #23 about static qtwebkit apparently being futile now. I tried to build tools/assistant but linking failed because of missing symbols in webcore and/or QtWebKit. Haven't checked yet whether tools/assistant/lib introduces dependencies on qtwebkit. Also don't know if these dependencies still exist if Qt is configure with -no-webkit.

@stloeffler
Copy link
Contributor Author

Using QtHelp works if one also builds

cd '$(1)/tools/assistant/lib/fulltextsearch' && '$(1)/bin/qmake' lib.pro
$(MAKE) -C '$(1)/tools/assistant/lib/fulltextsearch' -j '$(JOBS)' install

(for whatever twisted reason, that is not included when just building in tools/assistant/lib). It works fine, presumably due to the fact that it essentially provides access to the underlying file structure (including managing the table of contents index, search, etc.), but does not actually display any (html) help files. That is left to the caller. So webkit may limit the actual use in some cases, but IMO should not prevent building.

Regarding the QtDesigner module: when building a test program using the QFormBuilder class, I actually get a few undefined reference to _imp___ZN12QFormBuilderC1Ev'` errors. It works as expected, however, if I add

DEFINES += QT_DESIGNER_STATIC

to the .pro file. Obviously, this is not elegant. We could obviously add it in some central location (e.g., in $(PREFIX)/$(TARGET)/include/QtCore/qglobal.h), but that would be a rather ugly hack. I'm not sure how this is supposed to be handled (after all, we are not installing all of the tools as might be the "typical use case") or if this is indeed a Qt bug, though.

@mabrand
Copy link
Member

mabrand commented Apr 23, 2012

I think 4cf652d adds everything you mentioned and more. Everything links fine now that we no longer build qtwebkit. Could you check that it works for you?

@stloeffler
Copy link
Contributor Author

Hi. Thanks for that - if the tools can be built entirely that saves some trouble ;).
I tested QtUiLoader, QtHelp, and QtDesigner with short test programs (on a fresh MXE clone) and they all compiled, linked, and ran fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants