Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3851746
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:12:37+00:00 2026-05-19T17:12:37+00:00

I am using a QTreeView to display a hierarchy of items. Something like this

  • 0

I am using a QTreeView to display a hierarchy of items. Something like this

Child 1
Child 2
Child 3
   Child a
   Child b
   Child c
Child 4
   Child d

The trick is this: The children of Child 3, and Child 4 is a dynamic list. So there can be any number of children under either. I also want to be able to rename each of the nodes, but there are different rules of what is a correct name for the children of Child 3, and Child 4.

I started setting setItemDelegateForRow, but of course that doesn’t work, as the children shift up and down in the tree as others are added/removed.

I was hoping there was a way to attribute an ItemDelegate to a QStandardItem, but it doesn’t seem possible.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:12:38+00:00Added an answer on May 19, 2026 at 5:12 pm

    After a lot of investigation and thinking, we found a solution that’s not horrible.

    We add a check when the selection changes in the tree, and depending on the selection we call setItemDelegate() and pass the desired Delegate for the selected node in the tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a styled QTreeView using double-dispatch to resolve specific delegate for data items,
i m using this article http://blogs.msdn.com/delay/archive/2009/09/23/if-it-walks-like-a-duck-and-talks-like-a-duck-it-must-be-a-treegrid-a-simple-xaml-only-treegrid-ui-for-wpf.aspx to have hierarchical data... i am having treeview
I need to display images on top of each other. This can either be
The display is awful; there are some spaces between lines. I'm using a asp:treeview
i would like to have a multiple directory view while using QDirModel and qtreeview
I am using Telerik treeview in MVC3 Razor view to display tree structured information.
I am using a treeview to display projects, tasks, time entries, and the people
How do I display Items that are Checked from a treeView in a listBox
I'm trying to display a class using a treeview but nothing is displayed. I've
Ok, I have a treeview which I am using to display a number of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.