Results 1 to 4 of 4

Thread: How to widget....

  1. #1
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to widget....

    I have a stackedWidget.Each page is designed by designer and I need to write functions for this pages?.I tried to write new classes which each of them is for one of this pages.But I couldnt combine?

    How can I do?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to widget....

    So you want to add widgets to these pages?
    Also you will need something to switch between the pages.

    Widgets can be added with QStackedWidget::addWidget or QStackedWidget::insterWidget.

    Also, you can switch between the pages with QStackedWidget::setCurrentIndex.

    I tried to write new classes which each of them is for one of this pages
    You should write custom widgets only if you need them. Otherwise use the existing widgets and layouts.

    Why don't you tell us exactly what you want to do? Maybe we can help you.

    Regards

  3. #3
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to widget....

    Thanks.
    I will explain by example.
    I created a widget(has buttons etc) and put this to page1 using designer.Now I need some functions for using this widgets items.So question is this:How can I add these functions to this widget?
    (Lets think this so:We created this widget not designer and while creating we added functions as public or private.I want to do this?)

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to widget....

    Can you post the code?

    You usually access the widgets through the UI object in your class or directly, depending how you used the UI class generated by designer for the window/dialog: subclassed it or added it as a member.

    Regards

  5. The following user says thank you to marcel for this useful post:

    hgedek (3rd August 2007)

Similar Threads

  1. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  2. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  3. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  4. Replies: 4
    Last Post: 24th March 2006, 22:50
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.