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. Creating Slots for numerous loadProgress signals of an array of QWebEnginePage objects.
Forum Updated to NodeBB v4.3 + New Features

Creating Slots for numerous loadProgress signals of an array of QWebEnginePage objects.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 155 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.
  • D Offline
    D Offline
    desun_evan
    wrote on 17 Oct 2023, 20:29 last edited by
    #1

    I have a QList<QWebEnginePage*>that is connected to QWebEnginePage::loadProgress with connect(qListContainer[i], &QWebEnginePage::loadProgress, this, &MainWindow::loadProgressSlot)
    This is accomplished with a for()loop for every QWebEnginePage*in my QList

    I want to create a slot for every connected QWebEnginePage. I cannot foresee how many slots I will need. Is there a way to create these slots iteratively? Is there a better solution for individually connecting the &QWebEnginePage::loadProgresssignal to multiple slots updating individual progress bars?

    Thanks.

    M 1 Reply Last reply 17 Oct 2023, 20:59
    0
    • D desun_evan
      17 Oct 2023, 20:29

      I have a QList<QWebEnginePage*>that is connected to QWebEnginePage::loadProgress with connect(qListContainer[i], &QWebEnginePage::loadProgress, this, &MainWindow::loadProgressSlot)
      This is accomplished with a for()loop for every QWebEnginePage*in my QList

      I want to create a slot for every connected QWebEnginePage. I cannot foresee how many slots I will need. Is there a way to create these slots iteratively? Is there a better solution for individually connecting the &QWebEnginePage::loadProgresssignal to multiple slots updating individual progress bars?

      Thanks.

      M Offline
      M Offline
      mpergand
      wrote on 17 Oct 2023, 20:59 last edited by mpergand
      #2

      @desun_evan
      In MainWindow::loadProgressSlot()
      you can test the sender of the signal and update your progress bars accordingly:

      if(sender()==qListContainer[0]) update progressbar0
      else...

      D 1 Reply Last reply 17 Oct 2023, 21:01
      1
      • M mpergand
        17 Oct 2023, 20:59

        @desun_evan
        In MainWindow::loadProgressSlot()
        you can test the sender of the signal and update your progress bars accordingly:

        if(sender()==qListContainer[0]) update progressbar0
        else...

        D Offline
        D Offline
        desun_evan
        wrote on 17 Oct 2023, 21:01 last edited by desun_evan
        #3

        @mpergand I will try this, thank you.

        Update:
        Works fine, I was unware of sender() of QObject. Thanks!

        1 Reply Last reply
        0
        • D desun_evan has marked this topic as solved on 18 Oct 2023, 13:05

        1/3

        17 Oct 2023, 20:29

        • Login

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