Results 1 to 7 of 7

Thread: Linking of 2 QTableViews

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jul 2011
    Location
    Belgium
    Posts
    24
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linking of 2 QTableViews

    Quote Originally Posted by wysota View Post
    Connect to the QHeaderView::sectionResized() signal of one table and adjust the size of the other table's headers.
    Thanks! I've tried your solution but the wierd thing is that the signal sectionResized doenst get emitted... I've tried a couple of things but everytime when i want to use a signal, it just doens't get emitted when I resize my column. Any idea?

    The way I try to connect:

    Qt Code:
    1. QObject::connect(m_fileTableView->horizontalHeader(),SIGNAL(sectionResized(int,int,int)),m_selectionTableView,SLOT(onSectionResized(int,int,int)));
    To copy to clipboard, switch view to plain text mode 

    The onSecionResized is defined as a public slot, as it should be. In this slot, I do the following:

    Qt Code:
    1. QHeaderView* selectionHeader = m_selectionTableView->horizontalHeader();
    2. if(selectionHeader)
    3. return selectionHeader->resizeSection(index, newSize);
    4. else
    5. return ;
    To copy to clipboard, switch view to plain text mode 

    But ok, in debug mode, while using breakpoints, the slot doens't get called. So this means the signals just doens't get emitted.

    Quote Originally Posted by ChrisW67 View Post
    Seems odd to go to all this effort to duplicate the supplied selection highlighting.
    Well it does look wierd. What I have is at the left om my screen a file tree view. With this view, I go to a certain folder containing hunderds of measurement files written in a .txt file. All these measurement files are read and certain parameters are loaded into my first table view. The second table view let's me see the selected items from the first table view, but only those selected items. Now, these selected items from the first table view, are selected by a function that looks at the parameters and makes an automatic selection, it's actually a filter to all the measurement files.
    With only the selected measurement in the second table view, I create a graph.
    Last edited by Taxi; 4th October 2011 at 09:30. Reason: Adding code

Similar Threads

  1. Linking With Qt VS Add in
    By rcjohns in forum Newbie
    Replies: 2
    Last Post: 14th March 2010, 12:42
  2. Linking to a DLL
    By JohnGaby in forum Newbie
    Replies: 1
    Last Post: 14th October 2009, 19:52
  3. Match Height between 2 Adjoining QTableViews
    By ChrisW67 in forum Qt Programming
    Replies: 0
    Last Post: 14th April 2009, 03:52
  4. Linking
    By ^NyAw^ in forum General Programming
    Replies: 7
    Last Post: 30th October 2008, 17:37
  5. dll linking
    By Project25 in forum Qt Programming
    Replies: 3
    Last Post: 12th July 2007, 07:39

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
  •  
Qt is a trademark of The Qt Company.