Questions tagged [qtextbrowser]

QTextBrowser is a Qt widget providing a rich text browser with hypertext navigation capability.

QTextBrowser class extends QTextEdit in read-only mode adding some navigation functionality. This allows users follow links in hypertext documents.

Official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

141 questions
17
votes
1 answer

How to make links clickable in a QTextEdit?

Is there a way to make links clickable in a QTextEdit? I know I can use a QTextBrowser and connect to anchorClicked but I'd rather keep the editing and viewing all in one widget, and have clickable links when I set the widget to read-only mode. Is…
dF.
  • 74,139
  • 30
  • 130
  • 136
11
votes
4 answers

How to get non-blocking/real-time behavior from Python logging module? (output to PyQt QTextBrowser)

Description: I have written a custom log handler for capturing log events and writing them to a QTextBrowser object (working sample code shown below). Issue: Pressing the button invokes someProcess(). This writes two strings to the logger object.…
Gilead
  • 1,263
  • 10
  • 21
6
votes
2 answers

How to append text in a QTextBrowser in QT?

I have created a QTextBrowser to display a large amount of data (actually displaying the run time log), which is dynamically generated in another processes. I have found out that I can use fopen("log.html","a") to append data to an actually log…
iloahz
  • 4,491
  • 8
  • 23
  • 31
6
votes
1 answer

QTextBrowser or QWebView?

I need to render some HTML content (created by the application) and I'm wondering whether I should use QTextBrowser or QWebView. Although they seem quite similar, the doc doesn't discuss the differences between then. I guess QWebView is almost a…
laurent
  • 88,262
  • 77
  • 290
  • 428
5
votes
1 answer

PyQT4 QTextBrowser auto-scroll

I need a little help here. I have this QTextBrowser where I redirect all stdout to it. self.console_window = QtGui.QTextBrowser() self.console_window.setReadOnly(True) What I need now is to auto scroll to the bottom so I can see what is happening…
Tiago São José
  • 292
  • 3
  • 5
  • 12
5
votes
3 answers

How to make a Qt interactive text editing widget

I want to develop an application with two main widgets one is a text editor and the other one is for graphic viewer. The basic idea is to let the user hover over any block of code in the text area and the associated part of the drawing gets…
Mahmoud Hassan
  • 598
  • 1
  • 3
  • 15
4
votes
2 answers

How to print multiple instances of QTextBrowser into one PDF file?

the QT application I'm working on comes with a tutorial. Each chapter is a stand-alone HTML file, each file can span multiple pages. Now I want to print them into one single PDF file (with page numbers). My naive approach was this, but it's…
hez
  • 907
  • 1
  • 8
  • 20
4
votes
1 answer

QTextBrowser - how to identify image from mouse click position

I'm using a QTextBrowser to display rich text including a number of images, each of them specified with a HTML tag and added as resources using QTextDocument::addResource(). What I'd like to be able to do is, in a context menu handler (i.e.…
user2760608
  • 141
  • 2
4
votes
1 answer

QTextBrowser doesn´t display image from html file (Windows 7)

I´m using a QTextBrowser to display an external html document (and its image resources) which is placed in the same directory as the application. Everything works fine exept that images are not displayed properly. Instead of the actual picture there…
Peter
  • 41
  • 3
3
votes
1 answer

PyQt5 QTextBrowser - setText - Alignment issue?

I am trying to make a simple GUI console using PyQt5. On trying to print the text using QTextBrowser - setText, it loses alignment and looks bad. but the text is aligned in my python console I am using the setText function to display my data…
pawan kumar
  • 33
  • 1
  • 6
3
votes
1 answer

Dynamic update of QTextBrowser in a Qdialog from a file(that gets updated by another job)

I have a log file that gets updated while the job is running. I want the text content displayed in the text browser, and that should be updated dynamically. .h file public: void fillloginfo(); void initializeQTimer(); void…
3
votes
1 answer

How to select all the occurrences in QTextBrowser

The code creates QTextBrowser window filled with the lines of text. I would like to select all the words matching "Long Line" How to achieve it? from PyQt4 import QtCore, QtGui app = QtGui.QApplication([]) view = QtGui.QTextBrowser() for i in…
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
3
votes
1 answer

How do I remove the space between QPlainTextEdit and its contents?

I'm using C++ and Qt on Windows to create a simple application which outputs some data to the screen using a QPlainTextEdit. The problem is that there is a small internal margin between the QPlainTextEdit's border and the text as shown here: The…
YmFzZTY0
  • 109
  • 1
  • 9
2
votes
1 answer

QTextBrowser shows markdown on Mac but not on Windows

I'm building an app with Qt (pyside6) and packaging it with Pyinstaller. Everything works great on mac when running it through pycharm or when packaged, but the QTextBrowser doesn't render the sourced markdown file when it's running on my windows 10…
Moony
  • 37
  • 4
2
votes
2 answers

Track text insertion in QTextBrowser

I am making an application and using QTextBrowser to show messages. It should parse ascii colors, so my class (say MessageBoard) is inheriting from QTextBrowser. I can replace ascii color code and set MessageBoard's text color according to the ascii…
Keshav Sahu
  • 98
  • 2
  • 8
1
2 3
9 10