Results 1 to 7 of 7

Thread: access main window from function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Nov 2007
    Posts
    57
    Thanks
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: access main window from function

    Actually the example I gave was just a theoretical example.
    What I have in my program is this:

    Qt Code:
    1. //step1: calculate x and y (both numbers are OK for window size)
    2.  
    3. //step2:
    4. resize(x,y);
    5. QApplication::processEvents();
    6.  
    7. //step3: do graphics and return to step 1
    To copy to clipboard, switch view to plain text mode 
    steps 1 and 2 are in the same function, step 3 is in a different function.

    Why does this code resize the screen only the first time it passes through it? Only the first set of x and y are executed and all the following ones are ignored.
    I am doing all this to make the window wrap around a photo as I open it on the screen. Different photos are different size and I want the window size readjusted for each photo.

    I use a lot of addStretch() to make my layout. Could this be causing the problem? Maybe once a large window is made the resize function cannot shrink the window because it cannot fit the expanded stretch in the new window? I don't know if this is making sense.
    Last edited by eric; 17th January 2008 at 22:31.

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  3. QDialog - Calling Main Window Function
    By Preeteesh in forum Newbie
    Replies: 4
    Last Post: 20th June 2007, 18:41
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.