Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Porting from Qt4.8 to Qt5.7
Forum Updated to NodeBB v4.3 + New Features

Porting from Qt4.8 to Qt5.7

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 454 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luckless
    wrote on last edited by
    #1

    In Qt4.8 I had a class A that inherited from QDeclarativeItem. I was using a paint() (virtual function of QDeclarativeItem) function where i did all my drawings. And this QDeclarative item was placed on a QGraphicsScene. Now, while porting to Qt5.7 i found that QDeclarativeItem is deprecated. To achieve the same functionality I tried the following things:

    1. First, I tried inheriting my class from QQuickPaintedItem, which has another paint() function and tried using it. But I discovered that this paint() function was not invoked even once, probably because it requires a Scene graph. Calling update() also didn't invoke it.
      Query: Is this understanding of mine correct, that QQuickPaintedItem::paint() requires a Scene graph? If yes, can someone give me an example according to my use case, both pure Qt based and pure qml based approach.
    JKSHJ 1 Reply Last reply
    0
    • L Luckless

      In Qt4.8 I had a class A that inherited from QDeclarativeItem. I was using a paint() (virtual function of QDeclarativeItem) function where i did all my drawings. And this QDeclarative item was placed on a QGraphicsScene. Now, while porting to Qt5.7 i found that QDeclarativeItem is deprecated. To achieve the same functionality I tried the following things:

      1. First, I tried inheriting my class from QQuickPaintedItem, which has another paint() function and tried using it. But I discovered that this paint() function was not invoked even once, probably because it requires a Scene graph. Calling update() also didn't invoke it.
        Query: Is this understanding of mine correct, that QQuickPaintedItem::paint() requires a Scene graph? If yes, can someone give me an example according to my use case, both pure Qt based and pure qml based approach.
      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Luckless said in Porting from Qt4.8 to Qt5.7:

      Now, while porting to Qt5.7 i found that QDeclarativeItem is deprecated.

      QDeclarativeItem was still included in Qt 5.5. You could try porting to Qt 5.5 first, and then decide if you want to go any further.

      Note: QQuickItem is completely incompatible with QGraphicsScene.

      I was using a paint() (virtual function of QDeclarativeItem) function where i did all my drawings.

      What kind of manual painting does Class A do?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      3
      • L Offline
        L Offline
        Luckless
        wrote on last edited by
        #3

        Due to company requirements, we have to use Qt5.7 only, where I will again face the same problem that I would have faced porting from Qt4.8 to 5.7(i.e. the deprecated QDeclarativeItem.

        What kind of manual painting does Class A do?

        I am plotting n points (on a position vs time graph). The positions are updated every second. Further zooming & panning is to be provided. And this painting is currently done on a QGraphicsScene.

        JKSHJ 1 Reply Last reply
        0
        • L Luckless

          Due to company requirements, we have to use Qt5.7 only, where I will again face the same problem that I would have faced porting from Qt4.8 to 5.7(i.e. the deprecated QDeclarativeItem.

          What kind of manual painting does Class A do?

          I am plotting n points (on a position vs time graph). The positions are updated every second. Further zooming & panning is to be provided. And this painting is currently done on a QGraphicsScene.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @Luckless said in Porting from Qt4.8 to Qt5.7:

          I will again face the same problem that I would have faced porting from Qt4.8 to 5.7(i.e. the deprecated QDeclarativeItem.

          You could download the Qt Quick 1 source code and try to build it using Qt 5.7: https://code.qt.io/cgit/qt/qtquick1.git/tree/ If it works, you will be able to use QDeclarativeItem again.

          However, I don't know if any changes between Qt 5.5 and Qt 5.7 broke compatibility with QDeclarativeItem.

          I am plotting n points (on a position vs time graph). The positions are updated every second. Further zooming & panning is to be provided. And this painting is currently done on a QGraphicsScene.

          Good luck.

          Due to company requirements, we have to use Qt5.7 only

          That's a strange requirement, given that Qt 5.7 reached end-of-life in June 2017...

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved