mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
unstable
This commit is contained in:
parent
5cfa2c8e4a
commit
b28d9f8e97
3 changed files with 33 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <QQuickView>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "../components/chat/ChatModel.hpp"
|
||||
#include "../components/contacts/ContactsListProxyModel.hpp"
|
||||
#include "../components/core/CoreManager.hpp"
|
||||
#include "../components/settings/AccountSettingsModel.hpp"
|
||||
|
|
@ -70,10 +71,12 @@ void App::initContentApp () {
|
|||
}
|
||||
|
||||
void App::registerTypes () {
|
||||
// Register meta types.
|
||||
qmlRegisterUncreatableType<Presence>(
|
||||
"Linphone", 1, 0, "Presence", "Presence is uncreatable"
|
||||
);
|
||||
|
||||
// Register Application/Core.
|
||||
qmlRegisterSingletonType<App>(
|
||||
"Linphone", 1, 0, "App",
|
||||
[](QQmlEngine *, QJSEngine *) -> QObject *{
|
||||
|
|
@ -88,9 +91,13 @@ void App::registerTypes () {
|
|||
}
|
||||
);
|
||||
|
||||
// Register models.
|
||||
ContactsListProxyModel::initContactsListModel(new ContactsListModel());
|
||||
qmlRegisterType<ContactsListProxyModel>("Linphone", 1, 0, "ContactsListProxyModel");
|
||||
|
||||
qmlRegisterType<ChatModel>("Linphone", 1, 0, "ChatModel");
|
||||
|
||||
// Register singletons.
|
||||
qmlRegisterSingletonType<ContactsListModel>(
|
||||
"Linphone", 1, 0, "ContactsListModel",
|
||||
[](QQmlEngine *, QJSEngine *) -> QObject *{
|
||||
|
|
|
|||
|
|
@ -1 +1,7 @@
|
|||
#include "ChatModel.hpp"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
ChatModel::ChatModel (QObject *parent) : QObject(parent) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,28 @@
|
|||
class ChatModel : public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
Q_PROPERTY(
|
||||
QString remoteSipAddress
|
||||
READ getRemoteSipAddress
|
||||
WRITE setRemoteSipAddress
|
||||
NOTIFY remoteSipAddressChanged
|
||||
);
|
||||
|
||||
public:
|
||||
ChatModel (QObject *parent = Q_NULLPTR);
|
||||
|
||||
signals:
|
||||
void remoteSipAddressChanged (QString remote_sip_address);
|
||||
|
||||
private:
|
||||
QString getRemoteSipAddress () const {
|
||||
return m_remote_sip_address;
|
||||
}
|
||||
void setRemoteSipAddress (QString &remote_sip_address) {
|
||||
m_remote_sip_address = remote_sip_address;
|
||||
}
|
||||
|
||||
QString m_remote_sip_address;
|
||||
};
|
||||
|
||||
#endif // CHAT_MODEL_H_
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue