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. What is the equivalent of QUpdateLaterEvent in Qt 5.13
Forum Updated to NodeBB v4.3 + New Features

What is the equivalent of QUpdateLaterEvent in Qt 5.13

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 593 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.
  • MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #1

    Hi,
    I have simple camera program written in Qt 4.8 and now I want to use it to 5.13 but I have errors.

    In the code it used like below

    void CWidgetPaint::DisplayImageFromAnotherThread(LvStream* pStream, LvBuffer* pBuffer)
    {
        m_pStream = pStream;
        m_pBuffer = pBuffer;
        QRect Rect;
        Rect.setHeight(m_iSrcHeight);
        Rect.setWidth(m_iSrcWidth);
        QApplication::postEvent(this, new QUpdateLaterEvent(Rect));
        
    }
    
    
    

    And the bottom pf the page ther eis below code:

    
    //-----------------------------------------------------------------------------
    // This is needed to satisfy the linker,
    // copied from QEvent.cpp, to be checked with new QT version!
    
    
    QUpdateLaterEvent::QUpdateLaterEvent(const QRegion& paintRegion)
        : QEvent(UpdateLater), m_region(paintRegion)
    {
    }
    
    QUpdateLaterEvent::~QUpdateLaterEvent()
    {
    }
    

    Well, what is the equivalent use of this in Qt 5.13?

    Regards,
    Mucip:)

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      QUpdateLaterEvent was even a private class in Qt4 which could only be used on Linux because all symbols were exported by default there, did not work on Windows.
      What do you want to achieve with this type of event? Why not simply call QWidget::update()?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      MucipM 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        QUpdateLaterEvent was even a private class in Qt4 which could only be used on Linux because all symbols were exported by default there, did not work on Windows.
        What do you want to achieve with this type of event? Why not simply call QWidget::update()?

        MucipM Offline
        MucipM Offline
        Mucip
        wrote on last edited by Mucip
        #3

        Hi @Christian-Ehrlicher ,
        Very good question. I don't know why? The code is sample and comes from GigEPro industrial camera software.

        How can I change it as you advice?...

        By the way I use Debian Linux also...

        Regards,
        Mucip:)

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

          Hi,

          This is an educated guess: from the looks of it, that application received image data from a different thread, maybe through a callback. Hence when the image reached the GUI, it couldn't be painted directly because of said thread. Thus sending that event would trigger an update of the GUI through the next loop iteration.

          What you can do (and what could already have been done then) is to use QMetaObject::invokeMethod with a queued connection type to call update on the widget.

          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

          • Login

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