flyingimmi ---- wrote:
>  Hello all,
>  
>  I'm having a couple questions that I couldn't solve for some time,
>  maybe someone is so kind to point me in the right direction.
>  
>  1.
>  Currently I'm using:
>   ---
>  item.setFlags(new ItemFlags(item.flags().value() | 
> Qt.ItemFlag.ItemIsEditable.value()));
>  ---
>  to make a QTreeWidgetItem editable. The problem is that this makes all 
> column editable  but I
>  need only one specific column to be editable.

For full control, you could use the QAbstractItemModel class. That way 
you control each individual cell.

This is non-trivial however, but if you browse the archinves back a year 
or two there should be an example or two posted by me on how to use it. 
The QTreeModel which I wrote to make tree model based life in java 
easier doesn't support multiple columns yet, so that one cannot be used.

>  2.
>  Something else I couldn't figure out how to do is:
>  Showing the last part of a text, in a QPlainTextEdit, instead of the 
> first one.
>  (The last line needs to be visible)

I believe

plainText.moveCursor(QTextCursor.MoveOperation.End);
plainText.centerCursor();

will do what you want.

>  3.
>  I want to be able to drag and drop QTreeWidgetItems inside a QTreeView.
>  I set the item to be drag and drop-enabled
>  ---
>  ui.treeWidget.dragDropMode();
>  ---
>  When a add a child (QTreeWidgetItem) I add those flags:
>  ---
>     child.setFlags(ItemFlag.ItemIsDragEnabled, ItemFlag.ItemIsDropEnabled);
>  ---
>  Am I missing something?

Look in the code of com/trolltech/demos/TreeModelTester.java for the 
drag and drop code... The QTreeModel related issues do not apply, but 
the mimedata and drag&Drop'ing is what is needed.

best regards,
Gunnar
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to