Questions tagged [qplaintextedit]

QPlainTextEdit is class in QtGui module which provides a widget that is used to edit and display plain text.

QPlainTextEdit is class in QtGui module which provides a widget that is used to edit and display plain text.

136 questions
1
vote
2 answers

How to print a list of ints to QPlainTextEdit?

I have a list temp = [1, 2, 3, 4, 5, 6, 7, 8] I know to print to the console as strings, I would just do for i in range(0, len(temp)): temp[i] = str(temp[i]) and get 1 2 3 ... How can I do that since I don't think it can be done recursively…
geistmate
  • 525
  • 2
  • 5
  • 14
1
vote
0 answers

Get raw text from QPlainTextEdit on copy

I'd like to get raw text without style information when copying from a QPlainTextEdit. Currently when pasting into excel from a QPlainTextEdit there is style information included. I'm using PySide2. Here's an image of excel illustrating the…
DGriffin
  • 11
  • 1
  • 2
1
vote
0 answers

Append a Very Big String

When I try to add a big QString (size:104806123) to a QPlainTextEdit I get an exception :C++: std::bad_alloc void LogFileialog::add(QString &logLine) { ui.log_plainTextEdit->appendPlainText(logLine); } I also tried to append the Text to the…
Salvo Parisi
  • 119
  • 1
  • 10
1
vote
3 answers

Force QPlainTextEdit uppercase characters

I want to convert all lowercase characters as I type to uppercase in a QPlainTextEdit. In a QLineEdit I do the same via a validator, but there seems to be no validator for QPlainTextEdit. I have tried…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
1
vote
1 answer

How to add required in QPlainTextEdit?

I want to add required in my QPlainTextEdit so that when there is a blank QPlainTextEdit, the user will then be prompted that there is a blank input. This is my sample code and I want to add required in that QPlainTextEdit. self.plainTextEdit =…
1
vote
1 answer

QPlainTextEdit::toPlainText() but include newline characters from word wrap

I have a QPlainTextEdit that contains some text. Word wrap is enabled. When I retrieve the text with toPlainText() the resulting string does not contain the newline characters created from word wrap. This is because those newline characters weren't…
mrg95
  • 2,371
  • 11
  • 46
  • 89
1
vote
0 answers

Validate input text in a QPlainTextEdit

I am writing a simple editor program. How can I check the input text? For example, when the input contains "print", re-format it (color, bold, etc). How to check it continuously? def recognizer(self): while True: if "word" in…
Hunterx01
  • 39
  • 7
1
vote
0 answers

Append string to QPlainTextEdit fast and without new line, used in serialport assistant

I'm working on my serialport assistant, I want to show the data received on QPlainTextEdit, firstly, I tried "append": QByteArray serialData = mySerialPort->readAll(); ui->receiveData->appendPlainText(buf); “append”is fast,never reduce the…
StephenXu
  • 21
  • 3
1
vote
1 answer

Can I delay/bundle reactions to QPlainTextEditor.textChanged events?

I have a small IDE for a modeling language I wrote, implemented in PyQt/PySide, and am trying to implement a code navigator that let's you jump to different sections in the file being edited. The current implementation is: (1) connect to…
Michael Clerx
  • 2,928
  • 2
  • 33
  • 47
1
vote
2 answers

Qt set scroll area of a QPlainTextEdit to match that of anothers.

I for the life of me can't figure out how to do this. I have two QPlainTextEdits, with word wrapping off. I fill one using myTextEdit->document()->setPlainText(myText); Now myTextEdit has a horizontal scroll bar. Now I want my other textEdit to be…
picklechips
  • 746
  • 2
  • 8
  • 28
1
vote
0 answers

How can I disable edits for block of text in QPlainTextEdit?

I am making a component based on QPlainTextEdit. I would like to make portions of text readonly (but still allow selections, navigations and clipboard etc). I can detect the keypress event and suppress it but I need a condition to do this on. Is…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
1
vote
1 answer

How to make a line readonly in QPlainTextEdit?

I would like to make particular lines readonly in a subclassed QPlainTextEdit. I know I could override the keyPressed event and ignore it on the lines to be readonly, but I would need to filter the key event for non-editing keys (such as arrow…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
1
vote
1 answer

QPlainTextEdit thinks it's modified if it has an empty text

I'm using PyQt to build a simple IDE and getting weird errors if you load an empty file. A small example script is posted below: #!/usr/bin/env python import sys from PyQt4 import QtGui class TestApp(QtGui.QMainWindow): def __init__(self,…
Michael Clerx
  • 2,928
  • 2
  • 33
  • 47
1
vote
1 answer

Show asterisk on changes of a QTabWidget

I'm creating a multifile texteditor using tabs for the different files to edit. To do this I'm using a QTabWidget which holds the QPlainTextEdit widgets where the user can edit the text. If the user edits the text within the QPlainTextEdit I want to…
Burner
  • 71
  • 1
  • 12
1
vote
1 answer

Dedenting function in QPlainTextEdit causes segfault if last line is involved

I'm working on a source code editor that should have smart indent/dedent behaviour. However, my dedenting method seems to be causing a segmentation fault. I'd be very pleased if someone could work out why. Here's a minimal example: #!/usr/bin/env…
Michael Clerx
  • 2,928
  • 2
  • 33
  • 47