Results 1 to 3 of 3

Thread: New instance of UI to inherit the current event

  1. #1
    Join Date
    Oct 2012
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New instance of UI to inherit the current event

    Hi all! I'm currently designing a UI placed on the 1st tabwidget. I get the instance of the UI in the 1st tab in order to appear on the 2nd tab having the same UI. if i had an event done in the 1st tab, how can i let the event pass into the new instance of UI in the 2nd tab???


    Added after 4 minutes:


    By the way, im using multiple instance of the UI and want to pass the event so that, what ever i made on the 1st tab, it should also appear on the 2nd tab, since they have the same ui. thanks!
    Last edited by kiboi; 23rd October 2012 at 08:33.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: New instance of UI to inherit the current event

    You can use signal-slot and connect same slot of both ui class instances to the same signals, maybe you need to do this in the parent when you create both instances - this depends on your "event" and design of your code, or maybe you need the parent to have signals for events and each tab will emit a signal to parent and that parent signal is connected to both slots that actually change the widgets...
    I think you are the one that can choose the best option for this, because you know your design and code, for us it might sound strange from beginning (same ui appear twice).

    Anyway i have to add only that you can connect signal to another signal... so the: emit signal that is connected to extra "parent" (or maybe mainwindow?) signal that is connected to both slots in each ui instance is doable and this way you don't hold cross references (or pointers) to the ui instances.

  3. #3
    Join Date
    Oct 2012
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New instance of UI to inherit the current event

    thanks! yes it sound strange... im having a progress bar for both tabs. so if i have an ongoing process in 1st tab, when i transferred to 2nd tab, the status of the progress bar must also appear and vice versa.

Similar Threads

  1. Do i have to inherit from QTcpServer?
    By p.kreker in forum Qt Programming
    Replies: 7
    Last Post: 28th June 2011, 10:25
  2. How can we inherit ui?
    By vinayaka in forum Newbie
    Replies: 5
    Last Post: 30th May 2011, 14:28
  3. About inherit
    By nesson in forum Qt Programming
    Replies: 1
    Last Post: 8th February 2011, 13:07
  4. Inherit the QAxWidget
    By MrShahi in forum Qt Programming
    Replies: 3
    Last Post: 29th April 2008, 08:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.