Results 1 to 5 of 5

Thread: Inherit size from ancestor Widget/QFrame

  1. #1
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Inherit size from ancestor Widget/QFrame

    Hello there,

    my_mainwindow got an inserted QFrame as placeholder to display some pictures.
    For testing purpose i modified the 40000 Chip example to display the chips in the QGraphicsview whithin my QFrame.

    I have no layout or other "widgets" between QFrame and "view", as the QGraphicsView is called in the example.

    The Chips are shown in the QFrame. The QGraphicsView is hang up at pos 0/0, but it is bigger than the QFrame. So i cant´s see the button and left side from the QGraphicsView.

    How can i tell the View, to inherit the size of the QFrame. Even if the QFrame get streched by streching the mainwindow? I just want to fit the View in the QFrame.

    Do this belongs to the viewport of the QGraphicView?
    Is there a chapter in http://doc.trolltech.com/4.4 talking about this size/resizing issue?

    Hint are totally welcome.
    Thanx in advance

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inherit size from ancestor Widget/QFrame

    I don't exactly understand why you can't put your QGraphicsView in a layout and set it in QFrame?

  3. #3
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Inherit size from ancestor Widget/QFrame

    Hurray - Thanks a lot!

    After using is like this:

    Qt Code:
    1. QFormLayout *layout = new QFormLayout( my_QFrame );
    2. Display *display = new Display( my_QFrame ); //Display-class populates QGraphicsSceen, set up QGraphicsView and the slider/srollbar stuff
    3. layout->addWidget(display);
    4. displayWidget->setLayout(layout);
    To copy to clipboard, switch view to plain text mode 

    i can see the whole sceen.

    But there is the next problem - As you know from the 40K Chip example there are scroll bars and zoom/rotate slider next to the scene. I can see them *NOW* but they are disabled and grey shadowed.
    Some ideas?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inherit size from ancestor Widget/QFrame

    maybe these widgets have isDisbaled() == true?

  5. #5
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Inherit size from ancestor Widget/QFrame

    Nice guess.

    If there is an enabled slider included in the inserted parts, why should it get disbaled just by inserted it?

Similar Threads

  1. How to find best size for QTableWidget?
    By plamkata in forum Qt Programming
    Replies: 3
    Last Post: 24th July 2008, 19:07
  2. QT-wince and QHttp::readAll() trouble....
    By AcerExtensa in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 12th June 2008, 09:40
  3. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.