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

QPlainTextEdit - pushing into undo stack manually

I'm building a code editor with QPlainTextEdit. As default, when I type a bunch of words in one line and then press undo, the whole line gets deleted. I'd like to push to undo stack manually on every character, so that when I click undo, previous…
LogicStuff
  • 19,397
  • 6
  • 54
  • 74
1
vote
1 answer

Show the log text in QMainWindow with MdiArea

I have developed an application in Qt with QMainWindow as a main Widget, and added Mdiarea I needed for adding QMdieSubWindows. I want know how to have a logging area like in Qt Creator. My log text is basically what is going on. As Started the…
amol01
  • 1,823
  • 4
  • 21
  • 35
1
vote
1 answer

reading a file into Qt

I wrote a Program in Qt 5.2.1 that writes some data into a file and now I want to read it and display it. ( in a text edit or any other widget) Here is my code ( the part I thought is relevant ) - But i don't get the desires result ... could you…
user121273
  • 59
  • 1
  • 2
  • 9
1
vote
1 answer

Qt - invalid use of incomplete type 'class QScrollBar' - Add horizontal scroll bar to text edit widget

The default QPlainTextEdit has only vertical scroll bar, I want to add horizontal scroll bar. I tried this (this code in the constructor of the QMainWindow class) QPlainTextEdit * editor = new QPlainTextEdit(this); QScrollBar * hScroll = new…
Sara Barlo
  • 23
  • 6
1
vote
1 answer

how to get text color from qplaintextedit?

I want get text color from plain text. i can get fontWeight and other format with charFormat() but when i debug foreground color, it's set to no color!!? Please Help Me .... sample code: QTextCursor c = textCursor(); QTextCharFormat result =…
mgh
  • 41
  • 1
  • 1
  • 3
1
vote
1 answer

Adding end line marker in QPlainTextEdit

I would like to add a vertical line that would mark 80 characters in QPlainTextEdit. I looked at docs but I couldn't see anything in docs. Do I need to paint it somehow myself?
gruszczy
  • 40,948
  • 31
  • 128
  • 181
1
vote
1 answer

QPlainTextEdit throwing std::bad_alloc

I have a program that runs a least squares fit to some data. This procedure is run in a separate thread and controlled from a dialog box. This dialog box has a QPlainTextEdit that shows fitting updates and a final report. The dialog was created in…
rpsml
  • 1,486
  • 14
  • 21
0
votes
2 answers

Displaying integer and float numbers in a QPlainTextEdit object

I want to display a numerical value in a QPlainTextEdit object. I use below code for this purpose. QString s; s.sprintf("%d", deneme); //deneme is an integer value. ui->results->setPlainText(s); Is there any other method for displaying integer and…
adba
  • 477
  • 9
  • 25
0
votes
2 answers

How to read/write a text file in qt?

I have a QPlainTextEdit in my Form and I want to read the whole Resource.txt document which is placed in Other Files of my project and after a timer ticks i want the application save the contents of the QPlainTextEdit in the document. I know it's a…
user1044359
  • 59
  • 2
  • 4
0
votes
1 answer

QContextMenu issue with QPlainTextEdit item delegat in QTableView

I have a QTableView with delegates for certain columns. The default editor for indices is QLineEdit, for the 'comment' column delegate however I chose a QPlainTextEdit. Getting that to expand and adjust to contents was a PITA on its own (see…
0
votes
0 answers

Cursor position not being set in PyQt5's QPlainTextEdit Widget

I am using PyQt5. in QPlainTextEdit widget i want to move cursor to user defined position. but trying to set position of QTextCursor object through setPosition(new_position) value gives None. Having searched a couple of examples i havent been able…
0
votes
1 answer

'Shift+Return' QShortcut in PyQt QPlainTextEdit

I'm attempting to write a small command line console in PyQt, similar to the Jupyter Qtconsole . As a simple first step I'd like to be able to execute commands when the key combination 'Shift+Return' is pressed. The code example below suggests…
cjordan1
  • 277
  • 1
  • 4
  • 11
0
votes
0 answers

I want to print an output from live run of pycharm to a simple plain text of qtdesinh

I don't have any code snippet for this question. I want to print whatever output is showing to run windows to a plain text editor I don't have any code snippet for this question. I want to print whatever output is showing to run windows to a plain…
0
votes
0 answers

How to integrate QPlainTextEdit::createStandardContextMenu() into QMainWindow::menuBar()?

I did the subject with connecting QPlainTextEdit::cursorPositionChanged() signal into my main window's slot: void MainWindow::onCursorPositionChanged() { if( d->standardEditMenu ) { d->standardEditMenu->deleteLater(); …
Igor Mironchik
  • 582
  • 4
  • 17
0
votes
1 answer

C++ Get indentation level of line in qplaintextedit subclass?

I want to make a simple text editor for coding, but I have one problem, I want to indent the lines properly. I made it so that each time the return key is pressed, the program checks the character before the cursor, If it's a '{' or a ':' then it…
ArZero-12
  • 1
  • 2