[ create a new paste ] login | about

Link: http://codepad.org/cavZliJZ    [ raw code | output | fork ]

C++, pasted on Jan 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
    QmlApplicationViewer *viewer(QmlApplicationViewer::create());
    QDeclarativeContext *rootCtxt = viewer->rootContext();
    QObject *QMLObject = viewer->rootObject();

    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer->setSource(QUrl("qrc:/meego/harmattan/qml/mainwindow.qml"));
    viewer->showExpanded();

    titleListModel->setTitleIterator(TitleIterator());

    Evopedia *evopedia = (static_cast<EvopediaApplication *>(qApp))->evopedia();
    foreach (LocalArchive *b, evopedia->getArchiveManager()->getDefaultLocalArchives())
       ui->languageChooser->addItem(b->getLanguage());
    /// change ui to QML
//    ui->listView->setModel(titleListModel);
    QObject* QMLtitlesView = QMLObject->findChild<QObject*>("titlesView");
    QDeclarativeContext *titlesCtxt=rootCtxt->findChild<QDeclarativeContext*>("titlesView");
//SEGFAULT HERE:
    titlesCtxt->setContextProperty("titlesModel", titleListModel);


Output:
1
2
Line 1: error: expected unqualified-id before '{' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: