Results 1 to 18 of 18

Thread: Using QDeclarativeView::Show()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QDeclarativeView::Show()

    Does the same qml file work when called with qmlviewer?

    By the way, you can pass a remote url to QDeclarativeView::setSource() and the file will be downloaded automatically if available.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    May 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60 Maemo/MeeGo

    Default Re: Using QDeclarativeView::Show()

    yes it works separately in the QMLViewer and i have tried the other way too by placing that in a remote url, but nothing happens.

    I have attached the code here if you have time please have a look and let me know, its such a simple thing but its not happening. :-(

    Regards,
    Attached Files Attached Files

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QDeclarativeView::Show()

    You are creating a new declarative view on the stack so it gets out of scope and is destroyed immediately.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:

    proj_symbian (30th May 2011)

  5. #4
    Join Date
    May 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60 Maemo/MeeGo

    Default Re: Using QDeclarativeView::Show()

    oh yes yes that was the problem indeed thanks a lot wysota for your patience and help,

    i have one more doubt is this the correct approach i am doing or there is any better approach to update data on QML file?? I have gone through the docs but i was not able to understand.

    Regards,

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QDeclarativeView::Show()

    I don't know what is best but I don't see a point in creating a new declarative view if you just want to change the script. You can call setSource() on the existing view.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #6
    Join Date
    May 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60 Maemo/MeeGo

    Default Re: Using QDeclarativeView::Show()

    yes you are correct, but how can i get the reference of QApplicationViewer present in main.cpp to my NetworkManager class??

    I know this is a very basic question but i am not able to do that

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QDeclarativeView::Show()

    It doesn't have to be in the NM class. Emit a signal and catch it elsewhere where you have a pointer to the view at hand.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #8
    Join Date
    May 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60 Maemo/MeeGo

    Default Re: Using QDeclarativeView::Show()

    apologies but its still not clear , i have a pointer of QApplicationViewer in main.cpp only, how can i get that on my NM class, are you telling i need to emit a signal from my main.cpp but i guess thats not possible.

    a simple code example for illustration will be greatful.

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QDeclarativeView::Show()

    Quote Originally Posted by proj_symbian View Post
    apologies but its still not clear , i have a pointer of QApplicationViewer in main.cpp only, how can i get that on my NM class, are you telling i need to emit a signal from my main.cpp but i guess thats not possible.
    So create another class to encapsulate what you already have or subclass QApplicationViewer and add appropriate slot to it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 9th May 2011, 02:04
  2. Show Gif from url with QMovie
    By madlymad in forum Newbie
    Replies: 1
    Last Post: 12th November 2010, 15:56
  3. Replies: 3
    Last Post: 12th July 2010, 13:12
  4. How to not show widget
    By gQt in forum Qt Programming
    Replies: 9
    Last Post: 10th June 2010, 19:59
  5. Show in center
    By lisa in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2009, 11:42

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.