Results 1 to 5 of 5

Thread: component->loadUrl throws error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: component->loadUrl throws error

    Quote Originally Posted by ChriD View Post
    I tried it to load in a loader and all samples below work!
    Good to know.
    The URIs looked fine already,

    Quote Originally Posted by ChriD View Post
    The error i get:
    I was more thinking along the lines of the errors reported by QQmlComponent::errors(), but you are hitting an assert.
    Are you sure that viewController.getAppEngine().data() is a valid QQmlEngine pointer?

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    ChriD (1st February 2016)

  3. #2
    Join Date
    Dec 2015
    Location
    Austria
    Posts
    23
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Default Re: component->loadUrl throws error

    Well,

    It was a similar nasty mistake :-)

    The viewController is the parent object of the view class and i used the wrong cast
    Qt Code:
    1. View::ViewController viewController = qobject_cast<View::ViewController>(this->parent()); // of course wrong because parent() returns a pointer
    2. View::ViewController *viewController = qobject_cast<View::ViewController*>(this->parent()); // this is correct...
    To copy to clipboard, switch view to plain text mode 
    In fact there was no Compiler error and the Controller and the engine object was filled, but pointed anywhere in the memory
    It works now!


    Thank You!

Similar Threads

  1. Qt 5 QSystemTrayIcon throws error message on Mac OS X
    By janusz in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2013, 14:55
  2. Replies: 3
    Last Post: 5th May 2012, 05:03
  3. Replies: 7
    Last Post: 3rd December 2010, 05:02
  4. py2app-deployed PyQt app -- throws QObject threading error
    By tory108 in forum Installation and Deployment
    Replies: 4
    Last Post: 20th January 2009, 20:16
  5. QThread + QTimer + skype4Com throws exception
    By sadjoker in forum Newbie
    Replies: 1
    Last Post: 22nd December 2008, 14:24

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.