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
2
votes
1 answer

Disable Carriage Return (Enter Key Press) in QPlainTextEdit()

This is what my example looks like: The text area is a QPlainTextEdit() object because I want the text to wrap to the second line. I think this is the best widget choice. The user will only enter a maximum number of 90 characters in this box so I…
Jarad
  • 17,409
  • 19
  • 95
  • 154
2
votes
2 answers

QPlainTextEdit is RightToLeft but displays LeftToRight

I made a view with QPlainTextEdit and set setLayoutDirection(QtCore.Qt.RightToLeft). The output of self.plaintxt.isRightToLeft()is 1 but in the plain text view, persian and english text are displayed from left. What is happen in my…
mng97
  • 75
  • 9
2
votes
1 answer

Transparently get backspace event in PyQt

I want to detect when backspace is pressed in a QPlainTextEdit widget. I have the following code: def keyPressEvent(self, event): if event.key() == QtCore.Qt.Key_Backspace: print("Backspace pressed") (in a class inherited…
Jachdich
  • 782
  • 8
  • 23
2
votes
1 answer

How to set horizontal overflow for QPlainTextEdit?

I'm trying to use a QPlainTextEdit but by default it go back at the next line when one is too long. Is there anyway way to do a horizontal overflow (so to have a scrollbar instead and that the line continue 'endlessly') ?
Xwilarg
  • 364
  • 1
  • 6
  • 16
2
votes
0 answers

QPlainTextEdit notify/hook when selection is about to be removed

I have a QPlainTextEdit, and I need to get a notification whenever it has selected text which is about to be removed (the reason being I want to backup it). So I need to be notified when the text is about to be changed, but not changed yet (so no…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
1 answer

Display terminal output with tqdm in QPlainTextEdit

I'm trying to find a way of getting, along with other prints, the result/evolution of a progress bar in a pyqt application, for example in a QPlainTextEdit widget. The problem I'm facing, is that progress bars can use some more advanced carriage…
beesleep
  • 1,322
  • 8
  • 18
2
votes
1 answer

QPlainTextEdit ignores most of the text block formats

I wanted to increase spacing between paragraphs (text blocks) in QPlainTextEdit, to no avail. After experimenting I found that though some format properties (e.g., background color) take effect, others (e.g., margins) are ignored. I found this bug…
Maximko
  • 627
  • 8
  • 20
2
votes
1 answer

Subclass of QPlainText does not expand to fill the layout

I do not understand why the CodeEditor example from the Qt website does not appear to work as expected. Every time I run the code it displays it like this, really small and not expanding to take up all the available space. Does anyone have any idea…
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
2
votes
1 answer

QPlainTextEdit with multiple colours on a line

tl;dr: QPlainTextEdit::appendPlainText(QString) appends a newline to my text widget. QPlainTextEdit::insertPlainText(QString) doesn't seem affected by setCurrentCharFormat(). Is there a way to append text while listening to the current…
Stewart
  • 4,356
  • 2
  • 27
  • 59
2
votes
1 answer

QPlainTextEdit and QCompleter focus issue

I have read through the QCompleter docs (https://doc.qt.io/qt-5/qcompleter.html) and I've tried to implement QCompleter for a QPlainTextEdit. Now I've got it to work like this: But the problem with that is, if you start writing a word that is in…
user8513021
2
votes
2 answers

qt plaintextedit change message color

I'm trying to color a text depending on message, i tried a lot of stuff but they change all text color not just the message that i need , exactly that one that's an error. if(Something) text = tr(""); if(SomethingElse) text =…
2
votes
1 answer

How can I make Qt use a user-defined class?

I'd like to user a user-defined class rather Qt's generated in the Ui_MainWindow class so that I can use that control on Qt's GUI Designer. For example, currently it's defined as this: class Ui_MainWindow { public: QPlainTextEdit *list; //…
Jack
  • 16,276
  • 55
  • 159
  • 284
2
votes
2 answers

Adding event to the context menu in QPlainTextEdit

This is my Context Menu after right click on QPlainTextEdit. I want to add function to load data from file in Context Menu. Can I? How?
Artur Lodklif
  • 83
  • 1
  • 9
2
votes
1 answer

PyQt QPlainTextEdit: How to replace right-click with key combination

How do I substitute "right-click" in the following snippet with a key combo (for example Ctrl-S)? I searched google and Qt manuals but still have no idea how to do it. I am new to Qt. Any help will be greatly appreciated. (P.S. to @ekhumoro: I…
mike
  • 113
  • 2
  • 10
2
votes
1 answer

Python: Get keystrokes from QPlainTextWidget created by Qt Designer

I need to read the keystrokes typed into a QPlainTextWidget from a form created by Qt Designer. I know that I can read the entire resulting text with QPlainTextWidget.toPlainText(), but I need to read the letters individually as they're typed. (I'm…
trinkner
  • 374
  • 4
  • 15
1 2
3
9 10