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 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
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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 last edited by R4leY
        #3

        all widgets are childrens another widget .

        mrjjM 1 Reply Last reply
        0
        • R R4leY

          all widgets are childrens another widget .

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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 last edited by
            #5

            OnClick on widget display new Dialog.

            mrjjM 1 Reply Last reply
            0
            • R R4leY

              OnClick on widget display new Dialog.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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

              • Login

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