TAILIEUCHUNG - Rapid GUI Development with QtRuby phần 7

Tham khảo tài liệu 'rapid gui development with qtruby phần 7', ngoại ngữ, ngữ pháp tiếng anh phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 6. Sink or Swim the Event Loop 66 2. Assuming that the default event method has not been overridden Qt Widget s event method is executed. Otherwise the custom event method is called. 3. The default event checks for any installed event filters and sends the event to the filter if installed. 4. If the event is intercepted then we re done. Otherwise event determines what type of Qt Event it s processing and converts the Qt Event into the a new class such as Qt MouseEvent . 5. The proper specialized event method then gets called in this case that s mousePressEvent . One advantage to posting events in the event loop is that repeated events such as multiple repaint requests are folded into one event. This saves processing time. The Event Loop when a new event occurs the QtRuby application does not act on it immediately. instead the event goes into a waiting queue. The mandatory Qt Application object is the keeper of this event queue. Periodically Qt Application checks this queue and dispatches the pending events to their proper places. These events are referred to as asynchronous events. This cycle of storing the events and then acting on them is referred to as the event loop. A typical QtRuby program has only one thread of execution. This means that when the Qt Application is ready to act on the queued events it must dispatch all of them to the proper objects before it can come back to handle the next batch. ideally this process happens very quickly. if however your program has some computationally intensive code such as the opening of a large file this could lead to a slowdown of the event loop processing. BOOKLEET Report erratum Chapter 6. Sink or Swim the Event Loop 67 An alternative is to use Ruby s Thread class and breakthe operation into multiple threads of control. If your application spends a large amount of time handling a certain event it may become unresponsive to other events that occur later. To a user of a GUI program this unresponsiveness is .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.