Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.1
-
Windows 7 & MSVC 2015 , 1920x1200, 100%
-
3841a7dd49667ceabdcbc416fa1e149bed7ed86e
Description
Following code causes the application to go busy loop
#include <QApplication> #include <QPlainTextEdit> int main(int argc,char*args[]) { QApplication app(argc,args); QPlainTextEdit *comment = new QPlainTextEdit(); comment->setPlainText("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nX\nX\nX"); auto font = QFontDatabase::systemFont(QFontDatabase::FixedFont); comment->setFont(font); comment->setWordWrapMode(QTextOption::NoWrap); comment->setFixedSize(300,72); comment->show(); return app.exec(); }
Looks like the same sequence of event is posted again and again on the event loop:
QScrollBar - UpdateLater QWidget - UpdateLater QWidget - MetaCall QWidget - ZOrderChange QScrollBar - Show QWidget - Show QWidget - ShowToParent QWidget - Hide QScrollBar - Hide QWidget - HideToParent QWidget - Resize QWidget - MetaCall QWidget - ZOrderChange QWidget - Hide QScrollBar - Hide QWidget - HideToParent QScrollBar - Show QWidget - Show QWidget - ShowToParent QWidget - Resize
It looks like the QScrollBars are alternatively hiden and shown. As the event loop is 100% busy, the app is unresponsive.
This happens if there is exactly three \nX at the end of the text line and the font is FixedFont.
Attachments
Issue Links
- is duplicated by
-
QTBUG-22682 QPlainTextEdit may get stuck trying to adjust scroll bars
- Closed
- relates to
-
QTBUG-45470 Horizontal scroll bar is not shown in QListView with horizontalScrollBarPolicy and verticalScrollBarPolicy == Qt::ScrollBarAsNeeded
- Closed
-
QTBUG-56280 Resizing widget that has QScrollArea with FixedSize layout, causes infinite resize loop due to scrollbars
- Closed
-
QTBUG-20677 QPrintPreviewWidget hangs
- Open
-
QTBUG-79906 QTableWidget very high CPU usage when both horizontal and vertical scroll bars shown
- Closed