Results 1 to 8 of 8

Thread: QWidget positioning problem

  1. #1
    Join Date
    Jun 2009
    Posts
    10

    Default QWidget positioning problem

    Hello.
    I tried to create some widget (frame or panel, does not matter..) with children, but with some special behavior. This window will be automatically or manually dropped down or slide up under another widget.

    Let's imagine we have one widget (with layout, or not) and three buttons on it, which are located one under another (like in vertical layout). You may consider them as "button group". This "button group" is located on the bottom! of our main widget.

    Now we begin to resize that main window to a lower height. I need that "button group" to be moved with the bottom size of main window. And resizing should not be locked when a minimum size have been reached. The "button group" should move up and up, and finally should hide over the top border of our main window.

    This looks like an "anchors" which we can set in some IDE's (C++ Builder, Delphi, ...)

    You can find similar widget in the left part of windows XP's explorer. These are animated explorer task bars. They can be opened or closed. I found some examples of such widgets in for MFC, but i need the QT implementation.

    Can anyone help me with my trouble?
    Thanks ahead

  2. #2
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: QWidget positioning problem

    Can you record some video what you mean, i don't understand? For recording you can use Camtasia Studio (in windows).

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget positioning problem

    May be you are looking for QToolBox.
    You can also do similar using QTreeWidget and delegates. You can search the forum for the same.

    May be this link is also of help to you

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWidget positioning problem

    ok brother what u want to achieve is considered by some as a problem thats why Qt has desigened its layout system such that it does not shrink more than its minimum size of contents...
    may be u need to implement your custom layout.
    take a look at this example http://doc.trolltech.com/4.5/layouts-flowlayout.html

  5. #5
    Join Date
    Jun 2009
    Posts
    10

    Default Re: QWidget positioning problem

    Thanks for ideas, but a have to say a few words.

    To SABROG: Open an explorer in windows XP. Take a look on the left panel. You will see drop down panels such as: System Tasks, Other Places, Details, and may be others. I need the same behaviour. It should be an animated drop down panel with widgets.
    But i forgot to mention that it should be resizable. I have found one implementation but it uses grabWidget() to save the content of main form to a picture. It shows that picture, than hides form, and animates the picture instead of controls itself. It has some artifacts, because when we resize main form after collapsing it (the picture was stored with original width) and try to expand it, the picture scales and it does not looks good.
    You can see it here: http://qt-apps.org/content/show.php/...?content=79286
    I believe it was not so good implementation

    To aamer4yu: May be QTreeView can help me, but can it be smooth animated while closing/opening? QToolBox also can not be used, as it has no animation i need. It has a very different behaviour.

    To MrDeath: It was a very good idea. I thought about custom layout, but i try to find more simple way for a while.
    I don't want manually positioning of every widget in my form. I want to place all of them into a frame with layout, and than somehow fix them on it. And animate it.

  6. #6
    Join Date
    Jun 2009
    Posts
    10

    Default Re: QWidget positioning problem

    Does anyone have an idea?

  7. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget positioning problem

    Did you check the link I gave in previous post ? (Designing Delegates)
    You can easily modify the header item to draw arrows or anything u like...play with that example.

  8. #8
    Join Date
    Jun 2009
    Posts
    10

    Default Re: QWidget positioning problem

    ok, thanks! I'll try.

Similar Threads

  1. Dynamic updates of a QWidget in a QScrollArea
    By plamkata in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2008, 23:45
  2. Error in put one QWidget in another QWidget
    By xjtu in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2008, 16:05
  3. Problem with Parent QWidget and Buttons not working
    By VireX in forum Qt Programming
    Replies: 7
    Last Post: 11th May 2007, 22:24
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59

Tags for this Thread

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.