Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Getting an event on calling update()
Qt 6.11 is out! See what's new in the release blog

Getting an event on calling update()

Scheduled Pinned Locked Moved Game Development
1 Posts 1 Posters 1.2k 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.
  • V Offline
    V Offline
    vtechdb
    wrote on last edited by
    #1

    We are rendering a QWidget on a transparent layer for Ogre. We wanted to get an event if update() or repaint() functions are called at any time. We added an extra event to be able to do that. We are using version 4.8.4.

    Is there any easier solution to do that?

    ViveTech

    @
    diff -r a\qcoreevent.h b\qcoreevent.h
    298,300d297
    <
    < InvisibleOnScreenUpdate = 1001,
    <
    diff -r a\qwidget.cpp b\qwidget.cpp
    1182d1181
    < m_invisibleOnScreen = false;
    1200d1198
    < m_invisibleOnScreen = false;
    1216d1213
    < m_invisibleOnScreen = false;
    9446,9455d9442
    < bool QWidget::invisibleOnScreen() const
    < {
    < return m_invisibleOnScreen;
    < }
    <
    < void QWidget::setInvisibleOnScreen( bool invisible )
    < {
    < m_invisibleOnScreen = invisible;
    < }
    <
    10481,10487d10467
    < if( invisibleOnScreen() )
    < {
    < QEvent* invisibleUpdateEvent = new QEvent(QEvent::InvisibleOnScreenUpdate);
    < QApplication::sendEvent( this, invisibleUpdateEvent );
    < return;
    < }
    <
    10523,10530c10503
    < if( invisibleOnScreen() )
    < {
    < QEvent* invisibleUpdateEvent = new QEvent(QEvent::InvisibleOnScreenUpdate);
    < QApplication::sendEvent( this, invisibleUpdateEvent );
    < return;
    < }
    <
    < if (!isVisible() || !updatesEnabled() || rgn.isEmpty() )

    if (!isVisible() || !updatesEnabled() || rgn.isEmpty())
    

    10588,10594d10560
    < if( invisibleOnScreen() )
    < {
    < QEvent* invisibleUpdateEvent = new QEvent(QEvent::InvisibleOnScreenUpdate);
    < QApplication::sendEvent( this, invisibleUpdateEvent );
    < return;
    < }
    <
    10625,10631d10590
    < if( invisibleOnScreen() )
    < {
    < QEvent* invisibleUpdateEvent = new QEvent(QEvent::InvisibleOnScreenUpdate);
    < QApplication::sendEvent( this, invisibleUpdateEvent );
    < return;
    < }
    <
    diff -r a\qwidget.h b\qwidget.h
    223,224d222
    < Q_PROPERTY(bool invisibleOnScreen READ invisibleOnScreen WRITE setInvisibleOnScreen)
    <
    717,719d714
    < bool invisibleOnScreen() const;
    < void setInvisibleOnScreen( bool invisible );
    <
    921,923d915
    <
    < private:
    < bool m_invisibleOnScreen;
    @

    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