PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 575 - Strange behaviour of QTextEdit.ExtraSelection().cursor
: Strange behaviour of QTextEdit.ExtraSelection().cursor
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.0 beta2
: All All
: P3 normal
Assigned To: renato filho
:
: 614
:
  Show dependency treegraph
 
Reported: 2011-01-01 11:50 EET by Andreas Dewes
Modified: 2011-01-21 15:44 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Dewes 2011-01-01 11:50:28 EET
The "cursor" attribute in a QTextEdit.ExtraSelection() object cannot be changed
or replaced. Example:

---
from PySide.QtGui import *
from PySide.QtCore import *

import sys

if __name__ == '__main__':
  app = QApplication(sys.argv)

  textEdit = QPlainTextEdit()
  textEdit.insertPlainText("test 123")
  selection = QTextEdit.ExtraSelection()

  print "Text cursor in ExtraSelection:"

  print selection.cursor
  selection.cursor = textEdit.textCursor()
  print selection.cursor
  #selection.cursor still points to the same object as before...

  print selection.cursor.position()
  #8
  selection.cursor.setPosition(0)
  print selection.cursor.position()
  #8  

  print "Normal text cursor:"

  cursor = textEdit.textCursor()
  print cursor.position()
  #8
  cursor.setPosition(0)
  print cursor.position()
  #0
---
Comment 1 Hugo Parente Lima 2011-01-03 14:07:32 EET
There's no problem in returning the same Python object but for sure
"setPosition(0)" should set the cursor position to 0.

Thanks for reporting.
Comment 2 renato filho 2011-01-17 10:52:24 EET
fixed on shiboken commit:

commit 99760ad3ed66e619e04defcdfe05710899c7afc9
Author: Renato Araujo Oliveira Filho <renato.filho@openbossa.org>
Date:   Thu Jan 13 15:04:03 2011 -0300
Comment 3 renato filho 2011-01-21 15:44:47 EET
release beta4