Results 1 to 9 of 9

Thread: Loading QDeclarativeView in QWebEngineView

  1. #1
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Loading QDeclarativeView in QWebEngineView

    I am porting from QGraphicsWebView to QWebEngineView.

    There is QDeclarativeView above QGraphicsWebView meaning QGraphicsWebView is contained in QDeclarativeView.

    I would like to know whether the same is possible (i.e.) loading QWebEngineView over QDeclarativeView.

    https://wiki.qt.io/QtWebEnginePortingFromQtWebKit
    QGraphicsWebView
    Qt WebEngine requires hardware acceleration. Since we couldn't support a web view class in a QGraphicsView unless it is attached to a QGLWidget viewport, this feature is out of scope.

    This is what I could find. I dont exactly understand what is conveyed in this link for QGraphicsView.

    Kindly let me know if it's possible to load like that or any alternative is there.

    The main idea behind using QDeclarativeView is to use QDeclarativeEngine and QDeclarativeContext to make use of the functions available in QDeclarativeView file in QML file.


    Added after 1 8 minutes:


    https://github.com/OtterBrowser/otte...ngine-Wishlist

    25. possibility to use within a QGraphicsView (without going through the need to use QGLWidget)

    How this is done?
    Last edited by ejoshva; 6th May 2015 at 12:22.

  2. #2
    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: Loading QDeclarativeView in QWebEngineView

    The QtQuick part of QtWebEngine is based on QtQuick2, so that requires a QQuickView.

    QDeclarativeView is QtQuick1, there is no QtWebEngine UI for that technology.

    Cheers,
    _

  3. #3
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Loading QDeclarativeView in QWebEngineView

    that means it can't be done ?

  4. #4
    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: Loading QDeclarativeView in QWebEngineView

    As usual with software it doesn't mean that at all. It means it hasn't be done yet.

    Any specific reason you need to stay with QtQuick1?

    Cheers,
    _

  5. #5
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Loading QDeclarativeView in QWebEngineView

    QDeclarativeEngine/QDeclarativeContext is made use of to set the context onto QML from CPP file.
    That's why I am preferring.
    Is there another way I can do this?

  6. #6
    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: Loading QDeclarativeView in QWebEngineView

    That's not an answer of my question.
    Why do you want to use QtQuick1 over QtQuick2?

    QtWebEngine has existing UI for the latter.

    Cheers,
    _

  7. #7
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Loading QDeclarativeView in QWebEngineView

    The application has already been developed with QtQuick1 and QGraphicsView.
    I am trying to port from QGraphicsWebView to QWebEngineView.

    Being new to Qt, I didn't want to change much of existing functionality was written based on QtQuick and QGraphicsView.

    Can I know how it's to be done with UI of QtWebEngine?

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

    Default Re: Loading QDeclarativeView in QWebEngineView

    If you are new to Qt then porting QtWebEngine to QGraphicsView is definitely too difficult for you.
    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. #9
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Loading QDeclarativeView in QWebEngineView

    I am porting from QGraphicsView to QWebEngineView.


    Added after 12 minutes:


    http://doc.qt.io/qt-5/qtquick-porting-qt5.html#c-code
    from this link I understand that QDeclarativeView is deprecated and QQuitView is used instead which is scenegraph oriented. So What I intended is this only.

    When I include the <QtQml> or <QQuickView>
    getting error as

    In file included from ../ssparkl/readwidget.h:21:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/QQuickView:1:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Versions/5/Headers/qquickview.h:37:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/qquickwindow.h:42:
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:62:5: error: redefinition of enumerator 'QML_HAS_ATTACHED_PROPERTIES'
    QML_HAS_ATTACHED_PROPERTIES = 0x01

    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/QQuickView:1:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Versions/5/Headers/qquickview.h:37:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/qquickwindow.h:42:
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:61:1: warning: declaration does not declare anything [-Wmissing-declarations]
    enum { /* TYPEINFO flags */
    ^~~~
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:99:5: error: redefinition of 'qmlRegisterType'
    int qmlRegisterType()

    please help me resolve this.
    Last edited by ejoshva; 7th May 2015 at 09:51.

Similar Threads

  1. Replies: 8
    Last Post: 23rd April 2015, 12:17
  2. How QDeclarativeView destruction
    By xman_ss in forum Qt Programming
    Replies: 3
    Last Post: 27th April 2012, 07:55
  3. Drag into a QDeclarativeView
    By frankiefrank in forum Qt Quick
    Replies: 1
    Last Post: 3rd October 2011, 12:12
  4. Resize QDeclarativeView
    By Globulus in forum Qt Programming
    Replies: 3
    Last Post: 29th August 2011, 17:31
  5. Using QDeclarativeView::Show()
    By proj_symbian in forum Qt Quick
    Replies: 17
    Last Post: 30th May 2011, 19:26

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.