You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, January 21st 2012, 9:09am

QTreeWidget colomn question?

Is there a way to hide the expand button column or to make a child of an item have the same alignment?

2

Saturday, January 21st 2012, 10:02am

that doesnt make sense. how do you know whether it is a child or not if everything has the same alignment?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

3

Saturday, January 21st 2012, 1:02pm

What I mean is that when an item is expanded I want the items it contains to be aligned with the expanded item

This post has been edited 1 times, last edit by "dannyH" (Jan 21st 2012, 1:08pm)


4

Saturday, January 21st 2012, 4:33pm

thats what I said - everything will be at the same level.

'items it contains to be aligned with the expanded item'
items it contains = child items
expanded item = parent
to be aligned with =same level as

=> child items same level as parent


Maybe you aren't saying what you mean.

A picture might help
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

5

Saturday, January 21st 2012, 5:21pm

Heres an image of what i'm talking about:
dannyH has attached the following file:

6

Saturday, January 21st 2012, 7:53pm

right. so thats a normal tree. That is what happens when you use qtreewidget/qtreeview, isn't it?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

7

Saturday, January 21st 2012, 8:28pm

Thats why I was asking the question is there and way for the parent and the child to be aligned

8

Saturday, January 21st 2012, 9:34pm

what is the point in you showing a picture of what already happens?! what information does that give anyone? how does that help explain what you want that is different?

THE PARENT ALIGNED WITH THE CHILD MAKES NO SENSE FOR A TREE. THAT IS A STRAIGHT LIST!!

and with that, I'm out. </dragons den>
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

9

Saturday, January 21st 2012, 10:08pm

Are you not listening?

What i need is a expandable list which is all aligned

that is what i was asking

Junior

Professional

  • "Junior" is male

Posts: 1,622

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

10

Wednesday, January 25th 2012, 5:11pm

You can do:

Source code

1
2
3
 treeView->setIndentation(0);  // children will align to parent
 treeView->setRootIsDecorated(false); // turn off expands button
 treeView->setExpandsOnDoubleClick(true);

11

Thursday, January 26th 2012, 7:30pm

Thanks for your help Junior, you were much more helpful than Amleto.