Results 1 to 7 of 7

Thread: Manually adjust geometry in custom widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Manually adjust geometry in custom widget

    I have a subclassed widget that I paint on. What I want to do is is click on a zoom in button and have the widget expand horizontally. Right now what happens is I click on zoom in and the widget stays the same size. Here is a snippet of what I am currently doing with the resizing.

    Qt Code:
    1. Chart::Chart(QWidget *parent) : QWidget(parent)
    2. {
    3. setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding);
    4. setGeometry(0,0,base_width,base_height);
    5. }
    6.  
    7. Chart::set_resize(int w, int h)
    8. {
    9. QSize size(w,h);
    10. resize(size);
    11. }
    To copy to clipboard, switch view to plain text mode 
    What am I doing wrong?
    Any suggestions?

    Thank You
    Last edited by jpn; 19th June 2008 at 04:47. Reason: missing [code] tags

Similar Threads

  1. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 17:19
  2. resizing events of a custom widget in a layout
    By Rooster in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2008, 10:52
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  4. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  5. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12

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.