# libQuotient (former libQMatrixClient)
<a href='https://matrix.org'><img src='https://matrix.org/docs/projects/images/made-for-matrix.png' alt='Made for Matrix' height=64 target=_blank /></a>
[![license](https://img.shields.io/github/license/quotient-im/libQuotient.svg)](https://github.com/quotient-im/libQuotient/blob/dev/COPYING)
![status](https://img.shields.io/badge/status-beta-yellow.svg)
[![release](https://img.shields.io/github/release/quotient-im/libQuotient/all.svg)](https://github.com/quotient-im/libQuotient/releases/latest)
[![](https://img.shields.io/cii/percentage/1023.svg?label=CII%20best%20practices)](https://bestpractices.coreinfrastructure.org/projects/1023/badge)
![](https://img.shields.io/github/commit-activity/y/quotient-im/libQuotient.svg)
![CI Status](https://img.shields.io/github/workflow/status/quotient-im/libQuotient/CI)
![Sonar Tech Debt](https://img.shields.io/sonar/tech_debt/quotient-im_libQuotient?server=https%3A%2F%2Fsonarcloud.io)
![Sonar Coverage](https://img.shields.io/sonar/coverage/quotient-im_libQuotient?server=https%3A%2F%2Fsonarcloud.io)
![Matrix](https://img.shields.io/matrix/quotient:matrix.org?logo=matrix)
The Quotient project aims to produce a Qt5-based SDK to develop applications
for [Matrix](https://matrix.org). libQuotient is a library that enables client
applications. It is the backbone of
[Quaternion](https://github.com/quotient-im/Quaternion),
[NeoChat](https://matrix.org/docs/projects/client/neo-chat) and other projects.
Before version 0.5.x it was called libQMatrixClient.
## Contacts
You can find Quotient developers in the Matrix room:
[#quotient:matrix.org](https://matrix.to/#/#quotient:matrix.org).
You can file issues at
[the project issue tracker](https://github.com/quotient-im/libQuotient/issues).
If you find what looks like a security issue, please use instructions
in [SECURITY.md](./SECURITY.md).
## Getting and using libQuotient
Depending on your platform, the library can be obtained from a package
management system. Recent releases of Fedora, Debian and openSUSE already have
it. Alternatively, you can build the library from the source and bundle it with
your application, as described below.
### Pre-requisites
To use libQuotient (i.e. build or run applications with it), you'll need:
- A recent Linux, macOS or Windows system (desktop versions are known to work,
and there's also limited positive experience with Android)
- Recent enough Linux examples: Debian Bullseye; Fedora 35;
openSUSE Leap 15.4; Ubuntu 22.04 LTS
- Qt 5.15 or 6 (experimental, as of libQuotient 0.7) - either Open Source or
Commercial
- QtKeychain (https://github.com/frankosterfeld/qtkeychain) - 0.12 or newer is
recommended; the build configuration of both QtKeychain and libQuotient
must use the same Qt major version
To build applications with libQuotient, you'll also need:
- CMake 3.16 or newer
- A C++ toolchain that supports at least some subset of C++20 (concepts,
in particular):
- GCC 11 (Windows, Linux, macOS), Clang 11 (Linux), Apple Clang 12 (macOS)
and Visual Studio 2019 (Windows) are the oldest officially supported
- If using E2EE (beta, as of libQuotient 0.7):
- libolm 3.2.5 or newer (the latest 3.x strongly recommended)
- OpenSSL (both 1.1.x and 3.x are known to work)
- Any build system that works with CMake should be fine; known to work are
GNU Make and ninja (recommended) on any platform, NMake and jom on Windows
The requirements to build libQuotient itself are basically the same except
that you should install development libraries for the dependencies listed above.
#### Linux
Just install the prerequisites using your preferred package manager. If your Qt
package base is fine-grained you might want to run CMake and look at error
messages. The library is entirely offscreen; however, aside from QtCore and
QtNetwork it also depends on QtGui in order to handle avatar thumbnails, without
any on-screen drawing.
#### macOS
`brew install qt qtkeychain` should get you the most recent versions of the
runtime libraries. Note that by default it installs Qt 6 and that's the only
available configuration for QtKeychain in Homebrew. If you need to go with Qt 5,
use `brew install qt@5` and build QtKeychain from the source.
You may need to add the output of `brew --prefix qt` and
`brew --prefix qtkeychain` to `CMAKE_PREFIX_PATH` (see below) to make CMake
aware of the library locations.
If using E2EE, you need to also `brew install libolm openssl@1.1` (it is
strongly recommended to have OpenSSL of the version that was used to build Qt;
as of this writing, it's 1.1.x but check https://formulae.brew.sh/formula/qt
for the most current situation). If necessary, add path prefixes for these
two to `CMAKE_PREFIX_PATH` as well.
#### Windows
Install Qt (and OpenSSL, if using E2EE) using The Qt Project official installer;
make sure to also tick the CMake box in the list of components to install unless
you already have. This will get you both the runtime libraries and the files
necessary for building libQuotient or with libQuotient. If you go this way,
you'll have to build QtKeychain from the source code.
Alternatively, you can use vcpkg to install Qt, OpenSSL 1.1, and QtKeychain.
You're not getting Qt Creator, which is a very nice IDE to deal with Qt-based
projects; but if you already use VSCode or CLion, you might prefer this route.
_If you build from the command line_: the commands in further sections imply
that `cmake` is in your `PATH`, otherwise you have to prepend those commands
with actual paths. It's a good idea to run the `qtenv2.bat` script that can
be found in `C:\Qt\<Qt version>\<toolchain>\bin` (assuming you installed Qt to
`C:\Qt`). This script adds necessary paths to `PATH`. You might not want to run
that script on system startup but it's very handy to setup the environment
before building.
_If you use a C++ IDE_: you should be able to configure CMake path and extra
options (`CMAKE_PREFIX_PATH`, in particular) in its settings. It is recommended
NOT to add the path for Qt (or any other library) to `PATH` explicitly; use
`CMAKE_PREFIX_PATH` instead and leave `PATH` unchanged. If your IDE is
Qt Creator, you shouldn't need to deal with Qt paths at all, just pick the right
kit and go straight to building.
If you're trying out E2EE, you will also need libolm. You'll have to build it
yourself - there's no official or semi-official binary library you can download.
The source code is available at https://gitlab.matrix.org/matrix-org/olm;
and you can use the same toolchain (CMake+MSVC, e.g.) you'll use for Quotient.
## Using the library
If you're just starting a project using libQuotient from scratch, you can copy
`quotest/CMakeLists.txt` to your project and change `quotest` to your
project name. If you already have an existing CMakeLists.txt, you need to insert
a `find_package(Quotient REQUIRED)` line to an appropriate place in it (use
`find_package(Quotient)` if libQuotient is not a hard dependency for you) and
then add `Quotient` to your `target_link_libraries()` line.
Building with dynamic linkage is only tested on Linux at the moment and is
a recommended way of linking your application with libQuotient on this platform.
Static linkage is the default on Windows/macOS; feel free to experiment
with dynamic linking and submit PRs if you get reusable results.
As for the actual API usage, a (very basic) overview can be found at
[the respective wiki page](https://github.com/quotient-im/libQuotient/wiki/libQuotient-overview).
Beyond that, looking at [Quotest](quotest) - the test application that comes
with libQuotient - may help you with most common use cases such as sending
messages, uploading files, setting room state etc. For more extensive usage
feel free to check out (and copy, with appropriate attribution) the source code
of [Quaternion](https://github.com/quotient-im/Quaternion) (the reference client
for libQuotient) or [NeoChat](https://invent.kde.org/network/neochat).
## Building t
没有合适的资源?快使用搜索试试~ 我知道了~
为Matrix编写跨平台客户端的Qt5库_C++_CMake_下载.zip
共307个文件
h:158个
cpp:118个
md:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 16 浏览量
2023-04-13
23:34:44
上传
评论
收藏 803KB ZIP 举报
温馨提示
为Matrix编写跨平台客户端的Qt5库_C++_CMake_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
为Matrix编写跨平台客户端的Qt5库_C++_CMake_下载.zip (307个子文件)
.clang-format 6KB
.clang-tidy 12KB
COPYING 26KB
room.cpp 133KB
connection.cpp 91KB
quotest.cpp 42KB
basejob.cpp 27KB
database.cpp 17KB
testolmaccount.cpp 17KB
keyverificationsession.cpp 17KB
roommessageevent.cpp 12KB
qolmaccount.cpp 11KB
syncdata.cpp 9KB
uri.cpp 7KB
user.cpp 7KB
downloadfilejob.cpp 6KB
avatar.cpp 6KB
content-repo.cpp 6KB
filesourceinfo.cpp 6KB
pushrules.cpp 6KB
qolminboundsession.cpp 6KB
ssosession.cpp 5KB
qolmsession.cpp 5KB
accountregistry.cpp 5KB
registration.cpp 5KB
relations.cpp 5KB
testolmsession.cpp 5KB
util.cpp 5KB
third_party_lookup.cpp 5KB
connectiondata.cpp 4KB
settings.cpp 4KB
testolmutility.cpp 4KB
e2ee_common.cpp 4KB
networkaccessmanager.cpp 4KB
qolmoutboundsession.cpp 4KB
rooms.cpp 4KB
administrative_contact.cpp 4KB
eventcontent.cpp 4KB
eventstats.cpp 4KB
list_public_rooms.cpp 4KB
uriresolver.cpp 3KB
testkeyverification.cpp 3KB
roommemberevent.cpp 3KB
mxcreply.cpp 3KB
event.cpp 3KB
keys.cpp 3KB
account-data.cpp 3KB
profile.cpp 2KB
roomevent.cpp 2KB
callevents.cpp 2KB
encryptedevent.cpp 2KB
device_management.cpp 2KB
receiptevent.cpp 2KB
create_room.cpp 2KB
tags.cpp 2KB
directory.cpp 2KB
function_traits.cpp 2KB
roompowerlevelsevent.cpp 2KB
testgroupsession.cpp 2KB
callcandidateseventtest.cpp 2KB
sso_login_redirect.cpp 2KB
space_hierarchy.cpp 2KB
pusher.cpp 2KB
encryptionevent.cpp 2KB
login.cpp 2KB
message_pagination.cpp 2KB
joining.cpp 2KB
utiltests.cpp 2KB
syncjob.cpp 2KB
mediathumbnailjob.cpp 2KB
threads_list.cpp 1KB
event_context.cpp 1KB
notifications.cpp 1KB
qolmutility.cpp 1KB
cross_signing.cpp 1KB
eventrelation.cpp 1KB
room_event_by_timestamp.cpp 1KB
peeking_events.cpp 1KB
presence.cpp 1KB
stateevent.cpp 1KB
eventitem.cpp 1KB
registration_tokens.cpp 1KB
filter.cpp 1KB
converters.cpp 1KB
banning.cpp 1KB
roomstateview.cpp 1012B
leaving.cpp 1008B
logging.cpp 1000B
roomcreateevent.cpp 990B
requestdata.cpp 984B
read_markers.cpp 913B
third_party_membership.cpp 905B
knocking.cpp 841B
logout.cpp 838B
appservice_room_directory.cpp 836B
search.cpp 794B
directchatevent.cpp 753B
room_state.cpp 752B
users.cpp 744B
report_content.cpp 742B
共 307 条
- 1
- 2
- 3
- 4
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功