Results 1 to 10 of 10

Thread: Replacing a Layout

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    315
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanked 53 Times in 51 Posts

    Default Re: Replacing a Layout

    IMHO proper solution to your problem is writing new layout. Curently you are trying enforce grid layout to do something else then it was design for.
    Read documentation about subclassing QLayout and write new kind of layout.
    It would be nice if you specify what you are trying to achieve (this is quite comon mistake when posting new thread in forums, describing how you are trying solve some problem instead describe your primary problem/objective).

  2. #2
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Re: Replacing a Layout

    Hey,

    thank you for your support.
    As mentioned before, i am trying to readjust my labeled icons in terms of their position, as the window filemanager does (e.g.). That means, that if i resize my window to let's say 300 px in width, i want my layout to show 3 icons per row, resizing it to 400px should then show 4 icons per row etc.. In the end, it should never happen - that resizing my window results in margin growth or icon size growth.

    I now have written a custom QWidget for every labeled icon. I will try to read something about reimplementing a QLayout, as every try to either delete the widgets or replace the layout however resulted in ghost-icons and/or a horrific computation time.
    I am thankful for every help :-)!

    Greetings,
    Geki

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    101
    Thanked 15 Times in 15 Posts

    Default Re: Replacing a Layout

    Thats sounds just like what the QFLowLayout does.

  4. #4
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Re: Replacing a Layout

    It seems that jambi does not support a QFlowLayout - so i have to reimplement it - or am i missing something?

    Greetings,
    Gekirou

  5. #5
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Re: Replacing a Layout

    Hey,

    i now reimplemented a flow layout for jambi and it's working just fine. I only have an issue using a scrollbar with it - as the the flow layout should be resizeable in width, but should use a scrollbar in height. I don't really understand how i can realize this.

  6. #6
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    101
    Thanked 15 Times in 15 Posts

    Default Re: Replacing a Layout

    The scrollbars are handled by a QScrollArea. The QScrollArea has a "widget" that has to be set explicitely. This will be your custom flowlayouted widget. This works. I have done this before, also with a custom flow layout.

Similar Threads

  1. Replacing polish diacritics in the string
    By kornicameister in forum Qt Programming
    Replies: 3
    Last Post: 8th February 2011, 15:54
  2. Replacing QtScript with QML
    By inpoculis789 in forum Newbie
    Replies: 0
    Last Post: 19th July 2010, 13:59
  3. Problem replacing a value in a QList.
    By bbad68 in forum Newbie
    Replies: 4
    Last Post: 29th January 2010, 17:14
  4. Replies: 0
    Last Post: 4th March 2009, 19:27
  5. Replacing One image with another
    By merry in forum Qt Tools
    Replies: 6
    Last Post: 8th February 2007, 13:22

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.