Aquarius_Girl
Aquarius_Girl

Reputation: 22906

What is the name of the Qt widget used for filling text in gnome planner?

The screen shot has been attached.

There is a kind of tree shaped widget in which you can fill in details, I wish to know its name.

Do QTreeWidget or QTreeView do the trick?

Do we have such a widget in Qt (in which text can be entered at run timeenter image description here)?

Upvotes: 0

Views: 236

Answers (2)

Aquarius_Girl
Aquarius_Girl

Reputation: 22906

On some other forum I have been told that there are editable trees in Qt:
http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.html

Here we can add/remove columns and text.

Upvotes: 0

pnezis
pnezis

Reputation: 12321

The QTreWidget is used when you want to display a simple tree with standard items.

The QTreeWidget class is a convenience class that provides a standard tree widget with a classic item-based interface similar to that used by the QListView class in Qt 3. This class is based on Qt's Model/View architecture and uses a default model to hold items, each of which is a QTreeWidgetItem.

The QTreeView is used when you have more complex models and gives you more flexibility

A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the QListView class, but using the more flexible approach provided by Qt's model/view architecture.

I believe (I have not checked the corresponding code) that in the Gnome planner what you see is can be implemented QTreeView with custom QAbstractItemDelegate. Notice though but most Gnome applications use GTK and not Qt.

The QAbstractItemDelegate class is used to display and edit data items from a model.

A QAbstractItemDelegate provides the interface and common functionality for delegates in the model/view architecture. Delegates display individual items in views, and handle the editing of model data.

You should study the Qt Model/View Programming. It may has a steep learning curve but once you get familiar with it you can implement almost everything.

Upvotes: 1

Related Questions