Results 1 to 3 of 3

Thread: How to change size of the Widget in another Widget

  1. #1
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default How to change size of the Widget in another Widget

    Hello,
    I have problem with changing size of the widget which is located in another widget.
    I have tried using resize(), setSize() methods but this dont work at all, dont have any more ideas.

    I have also second question, i want to add to my widget second layer for example on first layer i wanna draw coordinate system and on the second graph for it, and i dont know how to do it.

    Please help
    Best Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to change size of the Widget in another Widget

    I have problem with changing size of the widget which is located in another widget.
    Is the child widget inside a layout?
    If it is, the layout decides it size.
    If you want to force the size of the widget inside the layout, you can sue setMinimumWidth() and setMinimumHeight().

    Generally you should use setGeometry().

    i want to add to my widget second layer for example on first layer i wanna draw coordinate system and on the second graph for it, and i dont know how to do it.
    Just add a new child widget, or, draw directly on the widget where you want to have the graph.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    kaszewczyk (22nd February 2010)

  4. #3
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: How to change size of the Widget in another Widget

    Quote Originally Posted by high_flyer View Post
    Is the child widget inside a layout?
    If it is, the layout decides it size.
    1: Yes
    2: No

    i found setFixedSide() and so far siut me well

    Thanks for your replay

Similar Threads

  1. how to change the color of a top widget ?
    By feiyinziiu in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2009, 02:41
  2. Change widget type
    By drescherjm in forum Qt Tools
    Replies: 2
    Last Post: 16th April 2009, 02:03
  3. Replies: 2
    Last Post: 23rd March 2009, 17:26
  4. Fix size widget + Splitter
    By weepdoo in forum Qt Tools
    Replies: 0
    Last Post: 20th November 2008, 08:47
  5. Replies: 1
    Last Post: 4th November 2008, 22:47

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.