qmlbook / qt6book

The Qt 6 Book - A book about QML
https://www.qt.io/product/qt6/qml-book
Other
347 stars 113 forks source link

Chapter 18, CityUI needs module installation #227

Open pedro-vicente opened 1 year ago

pedro-vicente commented 1 year ago

Chapter 18, CityUI

On page 656, the module is not installed

::: TODO How to install the module? :::

The call to install must be added to main.cpp ?

#include <QApplication>
#include <QQmlApplicationEngine>

#include "fileio.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QQmlApplicationEngine engine;

    FileIO* user = new FileIO(&app);
    qmlRegisterSingletonInstance("org.example.io", 1, 0, "User", user);

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}
pedro-vicente commented 1 year ago

After this, error is

QQmlApplicationEngine failed to load component qrc:/main.qml:77:9: TableViewColumn is not a type

it seems TableViewColumn in not on Qt6

How can you do a book about Qt6 with APIs not in Qt6?

https://stackoverflow.com/questions/64403258/tableview-replacement-for-tableviewcolumn-in-qt-quick-2