TAILIEUCHUNG - Rapid GUI Development with QtRuby phần 5

Tham khảo tài liệu 'rapid gui development with qtruby phần 5', 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ả | The sizeHint method returns a Qt Size object which is nothing more than an encapsulatedset of width and heightproperties. Enter Qt SizePolicy. This class which is also a settable property of Qt Widget using the setSizePolicy method contains the information a widget uses to determine the amount of space it will take up inside a layout. When coupled with all of the other widgets in the layout the SizePolicies are all calculated and a final overall layout is achieved. Each size policy utilizes a calculated geometry called a sizeHint . The sizeHint is a method built into Qt Widget which calculates the recommended size of the widget. A sizeHint is calculated based on the design of the widget. For example a Qt Label s sizeHint is calculated based on the text that is written on the label. This is to help ensure that all of the text always fits on the Qt Label. irb main 001 0 require Qt true irb main 002 0 app Qt ARGV Qt Application 0xb6adfb24 name irb irb main 003 0 Qt Blah nil .sizeHint Qt Size 0xb6adc44c width 30 height 17 irb main 004 0 Qt BlahBlahBlahBlahBlah nil .sizeHint Qt Size 0xb6ad86bc width 142 height 17 BOOKLEET Report erratum Chapter 5. Take the Plunge understanding layouts 44 The above shows that a sizeHint for a Qt Label is dependent on the text being displayed on the label. There are seven types of size policies Qt SizePolicy Minimum Size Maximum Preferred Fixed sizeHint sizeHint sizeHint Minimum sizeHint none sizeHint Maximum none sizeHint sizeHint Preferred none none sizeHint Minimum- Expanding sizeHint none all available space Expanding none none sizeHint will expand as necessary Ignored none none all available space These Qt SizePolicy types are set independently for both the horizontal and vertical directions. In Figure on the next page we show two different ways of sizing widgets within the same layout. on the left side we set the ver -tical Qt SizePolicy of each of the contents to MinimumExpanding which .

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.