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. [Solved] QObject::installEventFilter(): Cannot filter events for objects in a different thread.
Forum Updated to NodeBB v4.3 + New Features

[Solved] QObject::installEventFilter(): Cannot filter events for objects in a different thread.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 6.2k 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
    smita30apr
    wrote on last edited by
    #1

    Hi,

    I am just using a single thread but I get this warning:

    QObject::installEventFilter(): Cannot filter events for objects in a different thread.

    and my application just crashes after that.

    What should I look for to fix this?

    Regards

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      Did you make sure that you construct QCoreApplication/QGuiApplication/QApplication first, before doing anything else?

      Is this code for an application or a shared library?

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        smita30apr
        wrote on last edited by
        #3
        1. Yes
        2. Application
        1 Reply Last reply
        0
        • S Offline
          S Offline
          smita30apr
          wrote on last edited by
          #4

          I will paste the backtrace if it helps:

          @
          #0 0x00007ffff5df0828 in QObject::installEventFilter (this=this@entry=0x3267ab0, obj=obj@entry=0x1e7d4c0) at kernel/qobject.cpp:1939
          #1 0x00007ffff6bbb3d1 in QAbstractItemView::commitData (this=<optimized out>, editor=0x3267ab0) at itemviews/qabstractitemview.cpp:2821
          #2 0x00007ffff6bb8788 in QAbstractItemView::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qabstractitemview.cpp:397
          #3 0x00007ffff5dea2a6 in QMetaObject::activate (sender=0x1e7d4c0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb140) at kernel/qobject.cpp:3569
          #4 0x00007ffff5dea7d7 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff706da40 QAbstractItemDelegate::staticMetaObject, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb140) at kernel/qobject.cpp:3444
          #5 0x00007ffff6cfd13f in QAbstractItemDelegate::commitData (this=<optimized out>, _t1=0x3267ab0) at .moc/moc_qabstractitemdelegate.cpp:177
          #6 0x000000000098cf12 in wli::Characters_view_delegate::commit_and_close_editor (this=0x1e7d4c0) at /home/smita/wli/src/djinni_client/qt_ui/views/script/characters_view_delegate.cpp:252
          @

          1 Reply Last reply
          0
          • S Offline
            S Offline
            smita30apr
            wrote on last edited by
            #5

            It was a memory corruption somewhere.
            Backtrace was misleading.

            Marking it as solved.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Shidharth
              wrote on last edited by Shidharth
              #6

              Hi @JKSH ,

              I have also facing this error, I am created shared library, can you please advise me to overcome this?

              JKSHJ 1 Reply Last reply
              0
              • S Shidharth

                Hi @JKSH ,

                I have also facing this error, I am created shared library, can you please advise me to overcome this?

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

                @Shidharth said in [Solved] QObject::installEventFilter(): Cannot filter events for objects in a different thread.:

                Hi @JKSH ,

                I have also facing this error, I am created shared library, can you please advise me to overcome this?

                Hi @Shidharth, please start a new thread and provide more details. Even better, try to provide example code that produces this error.

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

                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