Any way to suppress layout events after QTextBrowser.setStyleSheet?

  • Hello all,

    The following problem is causing significant problems for my app,Leo: Any help would be greatly appreciated.

    Leo's body pane is a QTextBrowser. Call it w. In general, Leo configures w using w.setStyleSheet. Such calls happen quite often during execution--much more often than in a typical app.

    Alas, w.setStyleSheet generates some kind of event, perhaps a layout-request event, that only happens much later, apparently just before idle time. This event can cause extremely unpleasant scrolling. Because the event happens so late, it is useless to save and restore scrollbar positions when calling w.setStyleSheet. Nor does calling w.blockSignals seem to help.

    Can anyone suggest a way to suppress the scrolling? Thanks!


  • Can anyone suggest a way to suppress the scrolling?

    Actually, all I was trying to do was to change the color of the border of the QTextBrowser. So the trick is to change the stylesheet of an enclosing QFrame, rather than changing the style sheet of the QTextBrowser itself. As a result, the QTextBrowser remains completely unchanged. Hurray!


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.