Results 1 to 7 of 7

Thread: Resize Widget To Desktop Size

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Resize Widget To Desktop Size

    Hi,
    I've a question for you...Is there a simple way to resize my widget to desktop size?
    I try this code but it seem don't work fine:
    Qt Code:
    1. int width = QApplication:desktop()->width();
    2. int height = QApplication:desktop()->height();
    3. mainWindow->resize(width, height);
    To copy to clipboard, switch view to plain text mode 
    Infact if I try to get the window height:
    Qt Code:
    1. int mwHeight = mainWindow->height();
    To copy to clipboard, switch view to plain text mode 
    then mwHeight is less of QApplication:desktop()->height() (about 20 pixel)

    Any idea?

    And how I can call directly the maximixe button of the title bar to do the same resize by code?
    Last edited by jpn; 23rd September 2008 at 11:16. Reason: missing [code] tags

Similar Threads

  1. Replies: 5
    Last Post: 25th May 2008, 08:22
  2. Move and resize with layout
    By waediowa in forum Qt Programming
    Replies: 0
    Last Post: 14th May 2008, 08:16
  3. Auto resize Widget to maximum avail. space
    By pospiech in forum Qt Programming
    Replies: 16
    Last Post: 15th April 2008, 14:47
  4. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  5. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07: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
  •  
Qt is a trademark of The Qt Company.