Results 1 to 3 of 3

Thread: Manage controls inside QTabWidget tabs area directly form QWidget derivated object

  1. #1

    Default Manage controls inside QTabWidget tabs area directly form QWidget derivated object

    Hi all

    I created an application using QTabWidget as main control. I have some tabs and I associated to each tab a QWidget derivated object through QT Designer (Selected tab control -> Promote to -> Name of my QWidget derivated class). This way I have my derivated class created and loaded directly using the .xml form file. Now I have an additonal need. I want to manage each control inside my tab widget direcly from the QWidget derivated control. Just to explain better I have a button control inside the tab area called "MyButton". If I created the private slot function "on_MyButton_clicked()" inside the QWidget derivated object (tha we can call "MyTabPanel" for example) it doesn't work (the function is not called if I click the button). On the contrary it work if I move and manage this function inside the main class of the window application. Is there some way to have "redirected" all the events regarding the controls inside the tab widget area to the connected QWidegt derivated object associated to the tab?

    Thank you

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Manage controls inside QTabWidget tabs area directly form QWidget derivated objec

    If I created the private slot function "on_MyButton_clicked()" inside the QWidget derivated object (tha we can call "MyTabPanel" for example) it doesn't work (the function is not called if I click the button).
    How are you making the connection?

    Is there some way to have "redirected" all the events regarding the controls inside the tab widget area to the connected QWidegt derivated object associated to the tab?
    First thing signal/slots are different from events. You can send both events and signals to any known QObject derived object. So answer your question, Yes it is possible.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3

    Default Re: Manage controls inside QTabWidget tabs area directly form QWidget derivated objec

    Hi

    Thank you for your reply. After some tries I found using QStackedWidget component can manage "internal" widgets as I need. I only have to add a "manager" like the tabs for switch between various window windgets but this is not a big problem. This allow me to use all the advantage of "automitic" signal/slot connection offered using QT Designer tool.

Similar Threads

  1. Manage japanese charanters inside QPlainText
    By Suppaman in forum Qt Programming
    Replies: 10
    Last Post: 13th December 2011, 21:22
  2. Replies: 2
    Last Post: 16th May 2011, 01:15
  3. Replies: 8
    Last Post: 23rd July 2010, 09:53
  4. counting controls in a form with its childs ?
    By hcetiner in forum Qt Programming
    Replies: 1
    Last Post: 6th April 2010, 20:14
  5. Replies: 4
    Last Post: 31st August 2006, 13:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.