Building QtJsonDb from Git
| This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
English
[toc align_right="yes" depth="3"]
Building QtJsonDb from Git
Introduction
Todo.
System Requirements
QtJsonDb is one of the addons of Qt 5, hence before building qtjsondb you need to build dependent modules - qtbase, qtxmlpatterns, qtjsbackend and qtdeclarative. See Building_Qt_5_from_Git for more information.
At this moment the only supported platforms for qtjsondb are Linux and Mac OS X
Linux/X11
QtJsonDb depends on libedit and libicu(optionally):
QtJsonDb dependencies on Ubuntu/Debian:
sudo apt-get install libedit-dev
sudo apt-get install libicu-devQtJsonDb dependencies on Mandriva/ROSA/Unity:
urpmi 'pkgconfig(libedit)'
urpmi 'pkgconfig(libicu)'Mac OS X
QtJsonDb depends on libicu(optionally).
Via HomeBrew
You need to have HomeBrew installed at first.
brew install icu4cVia MacPorts
port install icuGetting the source code
First clone the QtJsonDb git repository(for example, under
~/dev/git):
git clone git://gitorious.org/qt/qtjsondb.git qtjsondbCurrent temporary patch
Only for enable collation feature based on whether ICU header files are available or not on Mac.
Mac OS X
For HomeBrew users, patch this file or download the patch directly .
git am~/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-brew.patchFor MacPorts users, patch this file or download the patch directly .
git am ~/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-macports.patchQmakeing and building
Now start to qmake and make a shadow build:
mkdir~/build/qtjsondb
cd ~/build/qtjsondb
~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.proIf you have seen following output, then the ICU was enabled successfully:
Configuration tests:
icu: yes
libedit: yesHow to run examples
Launch jsondb daemon in a terminal(the first):
cd~/dev/git/qtjsondb/examples/declarative
~/build/qt5/qtbase/bin/jsondbRun the example code in another terminal(the second):
cd~/dev/git/qtjsondb/examples/declarative/simplelistmodel
~/build/qt5/qtbase/bin/qmlscene ./simplelistmodel.qmlIf want to clean the db files after running(in the first terminal):
cd~/dev/git/qtjsondb/examples/declarative
rm *.db