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 set callback for child widgets ?
QtWS25 Last Chance

How to set callback for child widgets ?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 395 Views
  • 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.
  • T Offline
    T Offline
    thesupershinobi
    wrote on last edited by thesupershinobi
    #1

    Hello, I would like to know how to define a callback for widgets present in a MainWindow. In my case, I would like to resize an image and position it in the center of an MdiSubWindow when the size change.

    I know how to set a callback for the MainWindow, but I did not find how to set callbacks for another widgets.

    edit :
    I found a solution, i create a subclass of widget and i can set callbacks event. It's a good practice ?!

    Thanks for your help

    1 Reply Last reply
    0
    • S Offline
      S Offline
      spobit
      wrote on last edited by
      #2

      Hi.

      Callback, why not signal and slot?

      I thinks the method can solve it.

      void QWidget::resizeEvent(QResizeEvent *event)
      
      1 Reply Last reply
      1
      • T Offline
        T Offline
        thesupershinobi
        wrote on last edited by
        #3

        Hello, thanks for your reply !

        In time, I studied and tested a lot of things. Indeed, it was better for me to use a signal and a slot.

        .I had trouble understanding that an event was different from a signal, but I understood how it worked.

        Thank you very much for your answer.

        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