Your SlideShare is downloading. ×
[C++ GUI Programming with Qt4] chap6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

[C++ GUI Programming with Qt4] chap6

1,263
views

Published on

C++ GUI Programming with Qt4 - Chap6

C++ GUI Programming with Qt4 - Chap6


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,263
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Ch 6 Layout Management Author: Tony
  • 2. Absolute Positioning
    • The user cannot resize the window
    • 3. Some text may be truncated
      • Unusually large font
      • 4. Translate into another language
    • The widget might have inappropriate sizes
    • 5. The positions and sizes must be calculated manually
  • 6. resizeEvent
    • Set the widgets' geometries
      • reserve the extra space for ensuring the user resizes the widget smoothly
  • 7. Layout Manager
    • QLayout
      • QHBoxLayout
      • 8. QVBoxLayout
      • 9. QGridLayout
  • 10. Margin & Spacing
    • QLayout::setContentsMargins()
    • 11. QLayout::setSpacing()
  • 12. QGridLayout
    • Add widget with matrix type
      • layout->addWidget(widget, row, column, rowSpan, columnSpan);
        • rowSpan = 1
        • 13. columnSpan = 1
    • addStretch()
      • Excess space between close button and help button
  • 14. QSizePolicy
  • 15. Preferred vs. Expanding
    • The excess space will give to the Expanding widgets.
    • 16. Preferred widgets stay at their size hint.
  • 17. MinimumExpanding & Ignored
    • They are used in older version of Qt
    • 18. Replaced by
      • Expanding
      • 19. Reimplement minimumSizeHint()
  • 20. Stretch Factor
    • Two factors to define the expanding rate
      • QSizePolicy::setHorizontalStretch ( uchar stretchFactor )
      • 21. QSizePolicy::setVerticalStretch ( uchar stretchFactor )
  • 22. QStackedLayout
    • Show the one of a set of
    • The pages are numbered from 0
    • 24. Make a specific child widget visible
      • setCurrentIndex()
  • 25. An Example of Preferences Dialog QListWidget QStackedLayout
  • 26. Splitters
    • Qsplitter class
    • 27. Contain other widgets
    • 28. Automatically placed side by side in the order in which they are created
  • 29. An Example of Splitters
  • 30. An Example of The Mail Client's Splitter Layout
  • 31. An Example of The Mail Client's Splitter Layout (cont.)
    • User resizes a window, Qsplitter normally distributes the space
      • setStretchFactor()
  • 32. Scrolling Areas
    • Simpler to use (comparison with QscrollBars)
    • 33. Call setWidget() member function
    • 34. setWidgetResizable()
    • 35. ScrollBarPolicy
      • setHorizontalScrollBarPolicy()
      • 36. setVerticalScrollBarPolicy()
  • 37.  
  • 38. Dock Windows
  • 39. Dock Windows (cont.)
  • 40. Dock Windows (cont.)
    • QDockWidget class
    • 41. SetFeatures()
      • movable, closable, and floatable
    • setAllowedAreas()
    • 42. QMainWindow::setCorner()
    • 43. Save the states
      • QMainWindow::saveState()
      • 44. QMainWindow::restoreState()
  • 45. Dock Windows (cont.)
  • 46. Tool Bar
  • 47. Tool Bar (cont.)
  • 48. Tool Bar (cont.)
  • 49. Multiple Documemt Interface (MDI)
  • 50. MDI (cont.)
    • QMidArea class
      • Create it and make it central
  • 51. MDI (cont.)
  • 52. Qt-specific Command-Line Options
    • Options
      • style
        • motif, windows, and platinum
      • font
      • 53. graphicssystem
        • raster, opengl
    • Arguments
      • QApplication::arguments()
  • 54. Qt-specific Command-Line Options
  • 55. Add a New Sub-window
  • 56. Other Sub-window Operations
    • closeActiveSubWindow()
    • 57. closeAllSubWindow()
    • 58. tileSubWindow()
    • 59. cascadeSubWindow()

×