Results 1 to 2 of 2

Thread: QTreeView Headers not displaying properley.

  1. #1
    Join Date
    Oct 2013
    Posts
    14
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default QTreeView Headers not displaying properley.

    Hey guys,

    Ok so my problem here is that, i have a tree view in my program but it won't show the headers i set in the model.

    Here is the model code whihc sets the headers:
    Qt Code:
    1. QStringList Headers;
    2. Headers.append(QString("Name"));
    3. Headers.append(QString("Progress"));
    4. Headers.append(QString("Rating"));
    5. Headers.append(QString("Type"));
    6. //Headers << "Name" << "Progress" << "Rating" << "Type";
    7.  
    8. DataModel->setHorizontalHeaderLabels(Headers);
    To copy to clipboard, switch view to plain text mode 

    and here is what i get when i run the program:Capture.PNG

    any ideas why?

    Also for some reason i cannot resize the columns programatically aswell

  2. #2
    Join Date
    Oct 2013
    Posts
    14
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTreeView Headers not displaying properley.

    Ok i found the solution, the problem was that i was clearing the data model so i had to set the headers again

Similar Threads

  1. Displaying a model as a QTreeView & Table.
    By gcain in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2013, 08:15
  2. QTreeView Not displaying
    By meadmaker in forum Newbie
    Replies: 4
    Last Post: 28th August 2010, 05:19
  3. Replies: 0
    Last Post: 5th July 2010, 09:05
  4. enable user editing of QTreeView headers?
    By iraytrace in forum Newbie
    Replies: 0
    Last Post: 9th October 2009, 22:25
  5. Drop indicator not displaying with QTreeView. Need help
    By bigchiller in forum Qt Programming
    Replies: 12
    Last Post: 12th March 2008, 11:38

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.