Results 1 to 5 of 5

Thread: tab widgets, there are not differents between tabs elements!!

  1. #1
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default tab widgets, there are not differents between tabs elements!!

    Hello,

    I have a tab widget with two tabs.
    In tab1 there is a button, and tab2 have other button.

    But when I write my code, all buttons belong same class.
    Is there any way to have a form but button of tab1 belong FormClass->Tab1class->button and other button belong FormClass->Tab2Class->button.

    I am sorry if I dont explain well.

    Best regards

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: tab widgets, there are not differents between tabs elements!!

    Quote Originally Posted by webquinty View Post
    But when I write my code, all buttons belong same class.
    Is there any way to have a form but button of tab1 belong FormClass->Tab1class->button and other button belong FormClass->Tab2Class->button.
    As I understand you: no. But you can name your button: buttonInTab1 which would have the same effect. Why are you need such a hierarchy?

  3. #3
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: tab widgets, there are not differents between tabs elements!!

    Quote Originally Posted by Lykurg View Post
    As I understand you: no. But you can name your button: buttonInTab1 which would have the same effect. Why are you need such a hierarchy?
    Only to have a clear code.

    Thank you very much.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: tab widgets, there are not differents between tabs elements!!

    Well what you can do is:
    • Create a widget with desiger, call it tab1
    • Create a widget with desiger, call it tab2
    • Create the new widget with the tabwidget (tw) and for the pages promote your classes tab1 and tab2


    Then you could have such a hierarchy tw->tab1->xxx if xxx is public... So it's possible but not really recommendable.

    Only to have a clear code.
    this you can also archive with prefixes. Which is better than the solution above.

  5. #5
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: tab widgets, there are not differents between tabs elements!!

    Thank you very much for you advice.

    Best regards

Similar Threads

  1. Replies: 0
    Last Post: 1st October 2008, 16:21
  2. Upper limit on number of widgets?
    By jdiewald in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 23:00

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.