Lines 51-61
Link Here
|
51 |
this->sortContactModel.setSortRole(ContactModel::NameRole); |
51 |
this->sortContactModel.setSortRole(ContactModel::NameRole); |
52 |
this->sortContactModel.sort(0, Qt::AscendingOrder); |
52 |
this->sortContactModel.sort(0, Qt::AscendingOrder); |
53 |
|
53 |
|
54 |
this->messageCount=0; |
54 |
this->messageCount=0; |
55 |
|
55 |
|
56 |
this->qmlView = new QDeclarativeView; |
56 |
this->qmlView = new QQuickView; |
57 |
this->qmlViewCtx = this->qmlView->rootContext(); |
57 |
this->qmlViewCtx = this->qmlView->rootContext(); |
58 |
if (QFile::exists("qml/messageView.qml")) |
58 |
if (QFile::exists("qml/messageView.qml")) |
59 |
this->qmlView->setSource(QUrl::fromLocalFile("qml/messageView.qml")); |
59 |
this->qmlView->setSource(QUrl::fromLocalFile("qml/messageView.qml")); |
60 |
else |
60 |
else |
61 |
//this->qmlView->setSource(QUrl::fromLocalFile("../messages/qml/messageView.qml")); |
61 |
//this->qmlView->setSource(QUrl::fromLocalFile("../messages/qml/messageView.qml")); |
Lines 63-77
Link Here
|
63 |
this->qmlViewCtx->setContextProperty("threadModel", &sortThreadModel); |
63 |
this->qmlViewCtx->setContextProperty("threadModel", &sortThreadModel); |
64 |
this->qmlViewCtx->setContextProperty("contactModel", &sortContactModel); |
64 |
this->qmlViewCtx->setContextProperty("contactModel", &sortContactModel); |
65 |
this->qmlViewCtx->setContextProperty("messageModel", &sortModel); |
65 |
this->qmlViewCtx->setContextProperty("messageModel", &sortModel); |
66 |
this->qmlViewCtx->setContextProperty("myNickname", "Me"); |
66 |
this->qmlViewCtx->setContextProperty("myNickname", "Me"); |
67 |
this->qmlViewCtx->setContextProperty("contactDefault", "qrc:/icons/contactDefault.png"); |
67 |
this->qmlViewCtx->setContextProperty("contactDefault", "qrc:/icons/contactDefault.png"); |
68 |
qmlView->setResizeMode(QDeclarativeView::SizeRootObjectToView); |
68 |
qmlView->setResizeMode(QQuickView::SizeRootObjectToView); |
69 |
|
69 |
|
70 |
this->qmlViewCtx->setContextProperty("messageWidget", this); |
70 |
this->qmlViewCtx->setContextProperty("messageWidget", this); |
|
|
71 |
QWidget *container = QWidget::createWindowContainer(qmlView, this); |
72 |
container->setFocusPolicy(Qt::TabFocus); |
71 |
|
73 |
|
72 |
ui->layoutMessages->addWidget(this->qmlView,1,1); |
74 |
ui->layoutMessages->addWidget(container); |
73 |
|
75 |
|
74 |
//QSettings settings; |
76 |
//QSettings settings; |
75 |
//this->sdk = settings.value("sdkPath").toString(); |
77 |
//this->sdk = settings.value("sdkPath").toString(); |
76 |
this->tcpServer.listen(QHostAddress::Any,4445); |
78 |
this->tcpServer.listen(QHostAddress::Any,4445); |
77 |
|
79 |
|