Results 1 to 3 of 3

Thread: Model/QTreeview sometimes doesn't draw

  1. #1
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Model/QTreeview sometimes doesn't draw

    I have a QTreeview that's hooked to a model that manages data from an in-house data object.

    In the model I have a list of QTreeViewItems which I basically use to keep track of parent and child counts and nodes.

    The problem is..if I open a project that already contains data the tree displays that information. However, if I start the application and the first thing I do is create a project, when I create the first data entry, nothing is displayed. I never hit the paint method for my delegate. My proxy model's filterAcceptsRow is returning true as expected. I just don't ever hit the paint method in my delegate. I've checked the row and column count and the data is being added and the rowCount menthod on my model is returning 1 as expected. The only thing I can think of is there is something I'm missing in the setup that only has an affect only in this case. Has anyone run into this issue?

    FYI: Here are the cases I'm seeing.

    1) Start app; open project with data; data displays; close project and create new project; data displays.

    2) start app; create project; NO data displays; open project with data; no data displays.

    Basically, the behavior is different depending on whether the first thing I do is open an existing/populated project or create a new project.

  2. #2
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Model/QTreeview sometimes doesn't draw

    Still debugging and what I noticed is that, in the case where I create a project:

    I use a QDialog to enter the new data for my project. I dismiss this dialog and then attempt to resize the application, it doesn't redraw my QTreeView. It draws bits of the dialog I just dismissed.

    The basic structure of the app is that it's a QMainWindow with a menubar, toolbar, and statusbar. The treeview is the central widget.

    Does this offer up any clues as to what I've done wrong.

  3. #3
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: SOLVED - Model/QTreeview sometimes doesn't draw

    After looking further into the drawing issues when I resize the application's window it appears to be a painting issue. I haven't fixed that yet, but the model view issue is off the table.

Similar Threads

  1. QTreeView draw drop indicator
    By mentalmushroom in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2011, 09:05
  2. Replies: 1
    Last Post: 10th June 2010, 05:35
  3. QPainter doesn't seem to draw QImage
    By Denarius in forum Qt Programming
    Replies: 7
    Last Post: 3rd March 2009, 14:12
  4. MyQListBoxItem doesn't draw
    By codebehind in forum Newbie
    Replies: 3
    Last Post: 4th July 2007, 15:25
  5. Replies: 2
    Last Post: 21st May 2007, 21:12

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.