Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
So you added the files to the resource, but forgot to change the path when loading main.qml?
Cheers,
_
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
I made a third project respecting this time the name "QtQuickCalculator". I included also the two files .cpp and .h about the viewers. Now the Application Output becomes exactly the same I had at the beginning of the thread. Here it is:
Starting /home/sylvain/build-QtQuickCalculator-Qt_5_5_1_in_PATH_qt5_invalid-Debug/QtQuickCalculator...
QML debugging is enabled. Only use this in a safe environment.
qrc:/main.qml:47:35: Unable to assign QQuickRectangle to QQuickAnchorLine
So there is apparently a syntax error. I added already to add left, right, bottom, top, center without any success.
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
Quote:
Originally Posted by
sylas
qrc:/main.qml:47:35: Unable to assign QQuickRectangle to QQuickAnchorLine
So there is apparently a syntax error. I added already to add left, right, bottom, top, center without any success.
Apparently you are back at your oridinal problem.
An anchor line property needs a compatible anchor line assignment, not an item.
There are vertical and horizontal lines http://doc.qt.io/qt-5/qtquick-positioning-anchors.html so compatible means a vertical line for a vertical anchor or a horizontal line for a horizontal anchor.
Cheers,
_
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
I don't find your reply. Maybe you consider it is enough with this thread. However I tell you that I repaired the error. I have now two projects which give me the same "application Output" message, the one I give on the title of my thread. I don't see how to repair this "syntax error". Cheers
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
Finished the problem with syntax. Iadded : .horizontalCenter. Finished the probllem with file not found. I wrote a new path. Now I have two projects one simple without vewers, the other with viewers. But no one shows any calculator upon 'run".
So it seems something is wrong in Main.cpp. I give you below the two codes:
Code:
//main.cpp of quickcalc project
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("/home/sylvain/quickcalc/main.qml"));
//viewer.showExpanded();//origin
viewer.show();
}
And the other:
Code:
//main.cpp of quickc project
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.
load(QUrl(QStringLiteral
("qrc:/main.qml")));
return app.exec();
}
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
Apparently I don't see the calculator because there is nowhere any window in the main.qml . So I must construct one. isn't it ? How is it possible this calculator i so incomplete ? Regards
Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine
Quote:
Originally Posted by
sylas
Finished the problem with syntax. Iadded : .horizontalCenter.
We had that days ago already.
Quote:
Originally Posted by
sylas
So it seems something is wrong in Main.cpp.
It is interesting how you find new ways of introducing problems.
First main.cpp is missing the application start, second main.cpp is OK but requires a QML file with a top level window element.
Quote:
Originally Posted by
sylas
Apparently I don't see the calculator because there is nowhere any window in the main.qml . So I must construct one. isn't it ? How is it possible this calculator i so incomplete ?
I though you had it already working with qmlscene?
Cheers,
_