Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27

Thread: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine

  1. #21
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  2. #22
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default 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.

  3. #23
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine

    Quote Originally Posted by sylas View Post
    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,
    _

  4. #24
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default 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

  5. #25
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default 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:
    Qt Code:
    1. //main.cpp of quickcalc project
    2. #include <QtGui/QGuiApplication>
    3. #include "qtquick2applicationviewer.h"
    4. int main(int argc, char *argv[])
    5. {
    6. QGuiApplication app(argc, argv);
    7. QtQuick2ApplicationViewer viewer;
    8. viewer.setMainQmlFile(QStringLiteral("/home/sylvain/quickcalc/main.qml"));
    9. //viewer.showExpanded();//origin
    10. viewer.show();
    11. }
    To copy to clipboard, switch view to plain text mode 

    And the other:
    Qt Code:
    1. //main.cpp of quickc project
    2. #include <QGuiApplication>
    3. #include <QQmlApplicationEngine>
    4. int main(int argc, char *argv[])
    5. {
    6. QGuiApplication app(argc, argv);
    7. QQmlApplicationEngine engine;
    8. engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

  6. #26
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default 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

  7. #27
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qrc:/main.qml:48:35: Unable to assign QQuickRectangle to QQuickAnchorLine

    Quote Originally Posted by sylas View Post
    Finished the problem with syntax. Iadded : .horizontalCenter.
    We had that days ago already.

    Quote Originally Posted by sylas View Post
    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 View Post
    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,
    _

Similar Threads

  1. Replies: 2
    Last Post: 8th August 2014, 19:08
  2. Unable to load background image in Main Window
    By bedbuffer in forum Newbie
    Replies: 0
    Last Post: 16th December 2010, 08:40
  3. Replies: 11
    Last Post: 11th August 2008, 09:14
  4. Replies: 1
    Last Post: 23rd July 2008, 10:19
  5. Replies: 15
    Last Post: 23rd March 2007, 16:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.