Note that there are some explanatory texts on larger screens.

plurals
  1. POQt: scrolling complex content. Web-Browser engine. Selecting a text
    primarykey
    data
    text
    <p>Just curious about scrolling complicated content inside web browser - like application. Lets assume i am using Qt and C++. This is not "how to" question, but more like "how does it work"? Completely derived from my curiosity irrational questions.</p> <p>I did small experiment.</p> <ol> <li>Created large QWidget 800x60000 px.</li> <li>Added 300 QWidgets 800x200 px that are painting themselves using QPainter. Each widget prints its unique name to console when paintEvent() is called.</li> <li>Added (1.) to a QScrollArea 800x800.</li> <li>When scrolling, i notice redrawing only widgets that are not fully displayed on the screen. It is only 1 widget at a time (scene: <a href="http://savepic.ru/2670640.jpg" rel="nofollow">http://savepic.ru/2670640.jpg</a>). So QScrollArea (or QWidget? Who deside what widget to repaint?) is smart - we do not have CPU loaded redrawing all the 300 widgets all the time or memory consumption storing 800x60000 pixmap (-;</li> </ol> <p>Lets assume i want to use mouse to select text and other elements on my "webpage". So i want to be able to mark them (by changing background). How would i implement that? How different web browsers do that? Selecting pictures, text, tables... Should i think about tracking the mouse and drawing gray/blue/pink background boxes behind elements and my custom widgets?</p> <p>I have another experiment - displaying stack of messages. The scheme is the same, except QPainter is not used here - only QLabels, QTextExits, QPushButtons (scene: <a href="http://savepic.ru/2632728.jpg" rel="nofollow">http://savepic.ru/2632728.jpg</a>). I can set a flag SelectableByMouse for QLabel, but how do i select more than 1 message?</p> <p>You could suggest me to use some Qt HTML renderer, but this is not the answer for 'how does it work".</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload