View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009675ParaViewBugpublic2009-10-07 12:152016-08-12 09:57
ReporterChris Cameron 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version3.4 
Target VersionFixed in Version 
Summary0009675: Output window overwrites current selection instead of appending to end of document
DescriptionWhen the output window receives new text it typically appends this text to the end of the output window.

However: If a user selects a new cursor position or selects any text in the output window, and THEN new text is added to the output window, this new text will output at the cursor position, and replace the selection if there was one.

The offending code appears to be this, in pqConsoleWidget.cxx

void pqConsoleWidget::printString(const QString& Text)
{
  this->Implementation->textCursor().movePosition(QTextCursor::End);
  this->Implementation->textCursor().insertText(Text);
  this->Implementation->InteractivePosition = this->Implementation->documentEnd();
  this->Implementation->ensureCursorVisible();
}

The problem is that textCursor() returns a COPY of the text cursor, so although the text is still inserted (I think because it has a pointer to the text document), the effects of movePosition(QTextCursor::End) are lost.

I have had success by replacing that code with this:

void pqConsoleWidget::printString(const QString& Text)
{
  this->Implementation->append(Text);
  this->Implementation->InteractivePosition = this->Implementation->documentEnd();
  this->Implementation->ensureCursorVisible();
}

It works because this->Implementation is a QTextEdit, and QTextEdit has an append method which does what was intended by the former code block.

Alternatively, I guess you could make a local variable of textCursor(), then call this->Implementation->setTextCursor() as well.
TagsNo tags attached.
Project
Topic Name
Type
Attached Files

 Relationships

  Notes
(0037727)
Kitware Robot (administrator)
2016-08-12 09:57

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2009-10-07 12:15 Chris Cameron New Issue
2016-08-12 09:57 Kitware Robot Note Added: 0037727
2016-08-12 09:57 Kitware Robot Status expired => closed
2016-08-12 09:57 Kitware Robot Resolution open => moved
2016-08-12 09:57 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team