Results 1 to 12 of 12

Thread: How to set QHeaderViews are siblings

  1. #1
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default How to set QHeaderViews are siblings

    Hi I would like to set one qheaderview understack of other , so how could i make two QHeaderViews are siblings each other.
    I created like
    QHeaderView *m_header = new QHeaderView(Qt::Horizantal,this)
    QHeaderView *m_headerN = new QHeaderView(Qt::Horizantal,this)

    but when i apply m_headerN ->stackUnder(m_header ) it's not working . Could any one suggest me .

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    Weird, this sounds a lot like your earlier question here http://www.qtcentre.org/threads/6151...neath-of-Other

    What is the difference?

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,316
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to set QHeaderViews are siblings

    If you ask the same confused question enough times, in different ways, maybe someone will figure out what you're really trying to do?

    QHeaderView *m_header = new QHeaderView(Qt::Horizantal,this)
    QHeaderView *m_headerN = new QHeaderView(Qt::Horizantal,this)
    I would be interested to know how you get this to compile. If you're going to paste code, paste the actual code, not something made up on the spot, and use [CODE] tags.

  4. #4
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    Hi I Posted all my code on http://www.qtcentre.org/threads/6112...-of-QTableview link with code tags , my problem is setup some columns from left side act like freezed ,am able to freez the columns but the headers are overlapped on one other , means the second tableview header under stack of 1st tableview header , but it's act opposite , when i search in forum we only handle stackunder when the both headers are siblings . so i tried above way but it's not working .

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set QHeaderViews are siblings

    It is not possible to control stacking order of widgets which are not siblings. If you want to have total control over headers of different views then hide the original headers of both views, instantiate new set of headers outside the views, provide some glue code that will synchronize the custom headers with the original ones and you are good to go.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    Hi How could i set headers outside of the views ?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set QHeaderViews are siblings

    The same way you set any widget outside any other widget, by not making it its child.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    you mean can i take two header views and set them into layout on top of views ?
    like :
    QHeaderView *m_header= new QHeaderView();
    QHeaderView *m_header1 = new QHeaderView();
    m_header->setModel(model());
    m_header1 ->setModel(model());
    layout->addWidget(m_header);
    layout->addWidget(m_header1 );

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set QHeaderViews are siblings

    I don't think putting them in a layout will do you much good.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    Hi I have one more issue with frozen columns , when i given dynamic number of columns other than one column it's freezing , but when i click on columns the values are changing i mean the columns are moving .


    Added after 1 51 minutes:


    Hi FrozenColumn example not working , it's only working for one column , it's not working for more columns . could any one suggest me where can i do changes for multiple columns , the columns are dynamically coming how many number of columns come to frozenview.
    Last edited by RameshNani; 5th February 2015 at 15:31.

  11. #11
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to set QHeaderViews are siblings

    You need to read the Frozen Column example and understand how it works then the problem becomes easier.

    Attached is a modified version of the Qt5 example with a custom header and two frozen columns. Look for <<<<<< in the code.

    Hopefully this will put an end to all four threads on this topic:
    Attached Files Attached Files

  12. #12
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set QHeaderViews are siblings

    Thanks Chris it's fixing all my issues .

Similar Threads

  1. Replies: 2
    Last Post: 3rd September 2014, 14:31
  2. Replies: 1
    Last Post: 27th July 2013, 00:35
  3. Z-index of an item is only applied to siblings
    By humbleguru in forum Qt Quick
    Replies: 0
    Last Post: 20th January 2011, 18:20
  4. modal that excludes parent's siblings
    By mortoray in forum Qt Programming
    Replies: 3
    Last Post: 16th October 2010, 12:33

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.