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. How to install event filter to example 100 widgets created dynamic with the same name?
Forum Updated to NodeBB v4.3 + New Features

How to install event filter to example 100 widgets created dynamic with the same name?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 779 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.
  • R Offline
    R Offline
    R4leY
    wrote on 26 Aug 2018, 11:47 last edited by
    #1

    I tried

    qApp->installeventFilter(this);
    widg->installeventFilter(this);
    

    All work only on last created widget. How do it to work on all widgets ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 26 Aug 2018, 12:36 last edited by
      #2

      And where are the 100 widgets you created? installEventFilter() can handle more than one object for sure.

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

      1 Reply Last reply
      3
      • R Offline
        R Offline
        R4leY
        wrote on 27 Aug 2018, 14:09 last edited by R4leY
        #3

        all widgets are childrens another widget .

        M 1 Reply Last reply 27 Aug 2018, 14:41
        0
        • R R4leY
          27 Aug 2018, 14:09

          all widgets are childrens another widget .

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 27 Aug 2018, 14:41 last edited by
          #4

          @R4leY
          What does the event filter do for the 100 widgets?

          1 Reply Last reply
          1
          • R Offline
            R Offline
            R4leY
            wrote on 29 Aug 2018, 12:48 last edited by
            #5

            OnClick on widget display new Dialog.

            M 1 Reply Last reply 29 Aug 2018, 13:00
            0
            • R R4leY
              29 Aug 2018, 12:48

              OnClick on widget display new Dialog.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 29 Aug 2018, 13:00 last edited by
              #6

              @R4leY
              Ok so you are using plain widget and not a subclass that
              could handle this itself?
              Should work on many widget so if only works for last, you have some sort
              of issue in the code.

              1 Reply Last reply
              0

              1/6

              26 Aug 2018, 11:47

              • Login

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