Change to QTextBrowser for better HTML and link display
This commit is contained in:
1 parent
f12b50f9d0
commit
9a90811dea
1 file changed
+5
-6
+5
-6
@@ -20,7 +20,7 @@ from PySide6.QtWidgets import (
|
|||||||
QLabel, QPushButton, QTextEdit, QLineEdit, QFormLayout,
|
QLabel, QPushButton, QTextEdit, QLineEdit, QFormLayout,
|
||||||
QDialog, QDialogButtonBox, QSystemTrayIcon, QMenu,
|
QDialog, QDialogButtonBox, QSystemTrayIcon, QMenu,
|
||||||
QGroupBox, QCheckBox, QSpinBox, QComboBox, QMessageBox,
|
QGroupBox, QCheckBox, QSpinBox, QComboBox, QMessageBox,
|
||||||
QProgressBar, QSplitter, QFrame, QScrollArea
|
QProgressBar, QSplitter, QFrame, QScrollArea, QTextBrowser
|
||||||
)
|
)
|
||||||
from PySide6.QtCore import (
|
from PySide6.QtCore import (
|
||||||
Qt, QTimer, QThread, Signal, QSettings, QSize
|
Qt, QTimer, QThread, Signal, QSettings, QSize
|
||||||
@@ -460,11 +460,10 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
|
|
||||||
text_edit = QTextEdit()
|
text_browser = QTextBrowser()
|
||||||
text_edit.setHtml(html_content)
|
text_browser.setHtml(html_content)
|
||||||
text_edit.setReadOnly(True)
|
text_browser.setOpenExternalLinks(True) # Allow clicking links
|
||||||
text_edit.setOpenExternalLinks(True) # Allow clicking links
|
layout.addWidget(text_browser)
|
||||||
layout.addWidget(text_edit)
|
|
||||||
|
|
||||||
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Close)
|
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Close)
|
||||||
buttons.rejected.connect(dialog.close)
|
buttons.rejected.connect(dialog.close)
|
||||||
|
|||||||
Reference in new issue
Block a user