Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Unable to render QImage transparent on OGRE, When Transition from Qt 4.x to Qt5 with OGRE 1.8.0 to 1.11.6

Unable to render QImage transparent on OGRE, When Transition from Qt 4.x to Qt5 with OGRE 1.8.0 to 1.11.6

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
4 Posts 2 Posters 889 Views 2 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.
  • S Offline
    S Offline
    sg33
    wrote on last edited by
    #1

    I have upgraded my project from Qt4 to Qt5 and OGRE from 1.8.0 to 1.11.6. In Old version(Qt4 and OGRE 1.8.0) I am able to see 2D dimensions which I have render on OGRE view using following code but now I am unable to see 2D dimensions on OGRE view so I am not able to understand weather this issue is regarding Qt or OGRE. please suggest any solution

    // Get the pixel buffer.
    Ogre::HardwarePixelBufferSharedPtr pixelBuffer = mHudTexture->getBuffer(0,0);

    // Lock the pixel buffer and get a pixel box.
    pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
    const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock();
    Ogre::uint8* pDest = static_cast<Ogre::uint8*> (pixelBox.data);    
    
    // Construct HUD image directly in the texture buffer.
    {
    // Create empty transparent image the size of the ogre window.
    

    QImage hud(pDest, mHudTexture->getWidth(), mHudTexture->getHeight(), QImage::Format_ARGB32);
    hud.fill(Qt::transparent);

    // Use a Qt QPainter to render to the ogre texture.
    QPainter painter(&hud);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I can't answer this directly but did you saw that now Ogre officially provides Qt integration ? Did you check that ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        sg33
        wrote on last edited by sg33
        #3

        I have seen Qt integration. Only difference is that we are using base class as QWidget (because we had used Qt4.8.5 version and now we are using Qt 5.12.7) and In Qt integration they are suggested to use QWindow. Please suggest can I change QWindow by QWidget (For that I need to change all dependency).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Not directly but you can use QWidget::createWindowContainer.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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