QwtDynGridLayout.3 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. .TH "QwtDynGridLayout" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtDynGridLayout \- The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_dyngrid_layout\&.h>\fP
  11. .PP
  12. Inherits QLayout\&.
  13. .SS "Public Member Functions"
  14. .in +1c
  15. .ti -1c
  16. .RI "\fBQwtDynGridLayout\fP (QWidget *, int margin=0, int spacing=\-1)"
  17. .br
  18. .ti -1c
  19. .RI "\fBQwtDynGridLayout\fP (int spacing=\-1)"
  20. .br
  21. .ti -1c
  22. .RI "virtual \fB~QwtDynGridLayout\fP ()"
  23. .br
  24. .RI "Destructor\&. "
  25. .ti -1c
  26. .RI "virtual void \fBinvalidate\fP ()"
  27. .br
  28. .RI "Invalidate all internal caches\&. "
  29. .ti -1c
  30. .RI "void \fBsetMaxColumns\fP (uint \fBmaxColumns\fP)"
  31. .br
  32. .ti -1c
  33. .RI "uint \fBmaxColumns\fP () const"
  34. .br
  35. .RI "Return the upper limit for the number of columns\&. "
  36. .ti -1c
  37. .RI "uint \fBnumRows\fP () const"
  38. .br
  39. .ti -1c
  40. .RI "uint \fBnumColumns\fP () const"
  41. .br
  42. .ti -1c
  43. .RI "virtual void \fBaddItem\fP (QLayoutItem *)"
  44. .br
  45. .RI "Add an item to the next free position\&. "
  46. .ti -1c
  47. .RI "virtual QLayoutItem * \fBitemAt\fP (int index) const"
  48. .br
  49. .ti -1c
  50. .RI "virtual QLayoutItem * \fBtakeAt\fP (int index)"
  51. .br
  52. .ti -1c
  53. .RI "virtual int \fBcount\fP () const"
  54. .br
  55. .ti -1c
  56. .RI "void \fBsetExpandingDirections\fP (Qt::Orientations)"
  57. .br
  58. .ti -1c
  59. .RI "virtual Qt::Orientations \fBexpandingDirections\fP () const"
  60. .br
  61. .RI "Returns whether this layout can make use of more space than \fBsizeHint()\fP\&. "
  62. .ti -1c
  63. .RI "QList< QRect > \fBlayoutItems\fP (const QRect &, uint \fBnumColumns\fP) const"
  64. .br
  65. .ti -1c
  66. .RI "virtual int \fBmaxItemWidth\fP () const"
  67. .br
  68. .ti -1c
  69. .RI "virtual void \fBsetGeometry\fP (const QRect &rect)"
  70. .br
  71. .ti -1c
  72. .RI "virtual bool \fBhasHeightForWidth\fP () const"
  73. .br
  74. .ti -1c
  75. .RI "virtual int \fBheightForWidth\fP (int) const"
  76. .br
  77. .ti -1c
  78. .RI "virtual QSize \fBsizeHint\fP () const"
  79. .br
  80. .ti -1c
  81. .RI "virtual bool \fBisEmpty\fP () const"
  82. .br
  83. .ti -1c
  84. .RI "uint \fBitemCount\fP () const"
  85. .br
  86. .ti -1c
  87. .RI "virtual uint \fBcolumnsForWidth\fP (int width) const"
  88. .br
  89. .RI "Calculate the number of columns for a given width\&. "
  90. .in -1c
  91. .SS "Protected Member Functions"
  92. .in +1c
  93. .ti -1c
  94. .RI "void \fBlayoutGrid\fP (uint \fBnumColumns\fP, QVector< int > &rowHeight, QVector< int > &colWidth) const"
  95. .br
  96. .ti -1c
  97. .RI "void \fBstretchGrid\fP (const QRect &rect, uint \fBnumColumns\fP, QVector< int > &rowHeight, QVector< int > &colWidth) const"
  98. .br
  99. .in -1c
  100. .SH "Detailed Description"
  101. .PP
  102. The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&.
  103. \fBQwtDynGridLayout\fP takes the space it gets, divides it up into rows and columns, and puts each of the widgets it manages into the correct cell(s)\&. It lays out as many number of columns as possible (limited by \fBmaxColumns()\fP)\&.
  104. .SH "Constructor & Destructor Documentation"
  105. .PP
  106. .SS "QwtDynGridLayout::QwtDynGridLayout (QWidget * parent, int margin = \fC0\fP, int spacing = \fC\-1\fP)\fC [explicit]\fP"
  107. .PP
  108. \fBParameters\fP
  109. .RS 4
  110. \fIparent\fP Parent widget
  111. .br
  112. \fImargin\fP Margin
  113. .br
  114. \fIspacing\fP Spacing
  115. .RE
  116. .PP
  117. .SS "QwtDynGridLayout::QwtDynGridLayout (int spacing = \fC\-1\fP)\fC [explicit]\fP"
  118. .PP
  119. \fBParameters\fP
  120. .RS 4
  121. \fIspacing\fP Spacing
  122. .RE
  123. .PP
  124. .SH "Member Function Documentation"
  125. .PP
  126. .SS "void QwtDynGridLayout::addItem (QLayoutItem * item)\fC [virtual]\fP"
  127. .PP
  128. Add an item to the next free position\&.
  129. .PP
  130. \fBParameters\fP
  131. .RS 4
  132. \fIitem\fP Layout item
  133. .RE
  134. .PP
  135. .SS "uint QwtDynGridLayout::columnsForWidth (int width) const\fC [virtual]\fP"
  136. .PP
  137. Calculate the number of columns for a given width\&. The calculation tries to use as many columns as possible ( limited by \fBmaxColumns()\fP )
  138. .PP
  139. \fBParameters\fP
  140. .RS 4
  141. \fIwidth\fP Available width for all columns
  142. .RE
  143. .PP
  144. \fBReturns\fP
  145. .RS 4
  146. Number of columns for a given width
  147. .RE
  148. .PP
  149. \fBSee also\fP
  150. .RS 4
  151. \fBmaxColumns()\fP, \fBsetMaxColumns()\fP
  152. .RE
  153. .PP
  154. .SS "int QwtDynGridLayout::count () const\fC [virtual]\fP"
  155. .PP
  156. \fBReturns\fP
  157. .RS 4
  158. Number of items in the layout
  159. .RE
  160. .PP
  161. .SS "Qt::Orientations QwtDynGridLayout::expandingDirections () const\fC [virtual]\fP"
  162. .PP
  163. Returns whether this layout can make use of more space than \fBsizeHint()\fP\&. A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions\&.
  164. .PP
  165. \fBReturns\fP
  166. .RS 4
  167. Orientations, where the layout expands
  168. .RE
  169. .PP
  170. \fBSee also\fP
  171. .RS 4
  172. \fBsetExpandingDirections()\fP
  173. .RE
  174. .PP
  175. .SS "bool QwtDynGridLayout::hasHeightForWidth () const\fC [virtual]\fP"
  176. .PP
  177. \fBReturns\fP
  178. .RS 4
  179. true: \fBQwtDynGridLayout\fP implements \fBheightForWidth()\fP\&.
  180. .RE
  181. .PP
  182. \fBSee also\fP
  183. .RS 4
  184. \fBheightForWidth()\fP
  185. .RE
  186. .PP
  187. .SS "int QwtDynGridLayout::heightForWidth (int width) const\fC [virtual]\fP"
  188. .PP
  189. \fBReturns\fP
  190. .RS 4
  191. The preferred height for this layout, given a width\&.
  192. .RE
  193. .PP
  194. \fBSee also\fP
  195. .RS 4
  196. \fBhasHeightForWidth()\fP
  197. .RE
  198. .PP
  199. .SS "bool QwtDynGridLayout::isEmpty () const\fC [virtual]\fP"
  200. .PP
  201. \fBReturns\fP
  202. .RS 4
  203. true if this layout is empty\&.
  204. .RE
  205. .PP
  206. .SS "QLayoutItem * QwtDynGridLayout::itemAt (int index) const\fC [virtual]\fP"
  207. Find the item at a specific index
  208. .PP
  209. \fBParameters\fP
  210. .RS 4
  211. \fIindex\fP Index
  212. .RE
  213. .PP
  214. \fBReturns\fP
  215. .RS 4
  216. Item at a specific index
  217. .RE
  218. .PP
  219. \fBSee also\fP
  220. .RS 4
  221. \fBtakeAt()\fP
  222. .RE
  223. .PP
  224. .SS "uint QwtDynGridLayout::itemCount () const"
  225. .PP
  226. \fBReturns\fP
  227. .RS 4
  228. number of layout items
  229. .RE
  230. .PP
  231. .SS "void QwtDynGridLayout::layoutGrid (uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const\fC [protected]\fP"
  232. Calculate the dimensions for the columns and rows for a grid of numColumns columns\&.
  233. .PP
  234. \fBParameters\fP
  235. .RS 4
  236. \fInumColumns\fP Number of columns\&.
  237. .br
  238. \fIrowHeight\fP Array where to fill in the calculated row heights\&.
  239. .br
  240. \fIcolWidth\fP Array where to fill in the calculated column widths\&.
  241. .RE
  242. .PP
  243. .SS "QList< QRect > QwtDynGridLayout::layoutItems (const QRect & rect, uint numColumns) const"
  244. Calculate the geometries of the layout items for a layout with numColumns columns and a given rectangle\&.
  245. .PP
  246. \fBParameters\fP
  247. .RS 4
  248. \fIrect\fP Rect where to place the items
  249. .br
  250. \fInumColumns\fP Number of columns
  251. .RE
  252. .PP
  253. \fBReturns\fP
  254. .RS 4
  255. item geometries
  256. .RE
  257. .PP
  258. .SS "uint QwtDynGridLayout::maxColumns () const"
  259. .PP
  260. Return the upper limit for the number of columns\&. 0 means unlimited, what is the default\&.
  261. .PP
  262. \fBReturns\fP
  263. .RS 4
  264. Upper limit for the number of columns
  265. .RE
  266. .PP
  267. \fBSee also\fP
  268. .RS 4
  269. \fBsetMaxColumns()\fP
  270. .RE
  271. .PP
  272. .SS "int QwtDynGridLayout::maxItemWidth () const\fC [virtual]\fP"
  273. .PP
  274. \fBReturns\fP
  275. .RS 4
  276. the maximum width of all layout items
  277. .RE
  278. .PP
  279. .SS "uint QwtDynGridLayout::numColumns () const"
  280. .PP
  281. \fBReturns\fP
  282. .RS 4
  283. Number of columns of the current layout\&.
  284. .RE
  285. .PP
  286. \fBSee also\fP
  287. .RS 4
  288. \fBnumRows()\fP
  289. .RE
  290. .PP
  291. \fBWarning\fP
  292. .RS 4
  293. The number of columns might change whenever the geometry changes
  294. .RE
  295. .PP
  296. .SS "uint QwtDynGridLayout::numRows () const"
  297. .PP
  298. \fBReturns\fP
  299. .RS 4
  300. Number of rows of the current layout\&.
  301. .RE
  302. .PP
  303. \fBSee also\fP
  304. .RS 4
  305. \fBnumColumns()\fP
  306. .RE
  307. .PP
  308. \fBWarning\fP
  309. .RS 4
  310. The number of rows might change whenever the geometry changes
  311. .RE
  312. .PP
  313. .SS "void QwtDynGridLayout::setExpandingDirections (Qt::Orientations expanding)"
  314. Set whether this layout can make use of more space than \fBsizeHint()\fP\&. A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions\&. The default value is 0\&.
  315. .PP
  316. \fBParameters\fP
  317. .RS 4
  318. \fIexpanding\fP Or'd orientations
  319. .RE
  320. .PP
  321. \fBSee also\fP
  322. .RS 4
  323. \fBexpandingDirections()\fP
  324. .RE
  325. .PP
  326. .SS "void QwtDynGridLayout::setGeometry (const QRect & rect)\fC [virtual]\fP"
  327. Reorganizes columns and rows and resizes managed items within a rectangle\&.
  328. .PP
  329. \fBParameters\fP
  330. .RS 4
  331. \fIrect\fP Layout geometry
  332. .RE
  333. .PP
  334. .SS "void QwtDynGridLayout::setMaxColumns (uint maxColumns)"
  335. Limit the number of columns\&.
  336. .PP
  337. \fBParameters\fP
  338. .RS 4
  339. \fImaxColumns\fP upper limit, 0 means unlimited
  340. .RE
  341. .PP
  342. \fBSee also\fP
  343. .RS 4
  344. \fBmaxColumns()\fP
  345. .RE
  346. .PP
  347. .SS "QSize QwtDynGridLayout::sizeHint () const\fC [virtual]\fP"
  348. Return the size hint\&. If \fBmaxColumns()\fP > 0 it is the size for a grid with \fBmaxColumns()\fP columns, otherwise it is the size for a grid with only one row\&.
  349. .PP
  350. \fBReturns\fP
  351. .RS 4
  352. Size hint
  353. .RE
  354. .PP
  355. \fBSee also\fP
  356. .RS 4
  357. \fBmaxColumns()\fP, \fBsetMaxColumns()\fP
  358. .RE
  359. .PP
  360. .SS "void QwtDynGridLayout::stretchGrid (const QRect & rect, uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const\fC [protected]\fP"
  361. Stretch columns in case of expanding() & QSizePolicy::Horizontal and rows in case of expanding() & QSizePolicy::Vertical to fill the entire rect\&. Rows and columns are stretched with the same factor\&.
  362. .PP
  363. \fBParameters\fP
  364. .RS 4
  365. \fIrect\fP Bounding rectangle
  366. .br
  367. \fInumColumns\fP Number of columns
  368. .br
  369. \fIrowHeight\fP Array to be filled with the calculated row heights
  370. .br
  371. \fIcolWidth\fP Array to be filled with the calculated column widths
  372. .RE
  373. .PP
  374. \fBSee also\fP
  375. .RS 4
  376. setExpanding(), expanding()
  377. .RE
  378. .PP
  379. .SS "QLayoutItem * QwtDynGridLayout::takeAt (int index)\fC [virtual]\fP"
  380. Find the item at a specific index and remove it from the layout
  381. .PP
  382. \fBParameters\fP
  383. .RS 4
  384. \fIindex\fP Index
  385. .RE
  386. .PP
  387. \fBReturns\fP
  388. .RS 4
  389. Layout item, removed from the layout
  390. .RE
  391. .PP
  392. \fBSee also\fP
  393. .RS 4
  394. \fBitemAt()\fP
  395. .RE
  396. .PP
  397. .SH "Author"
  398. .PP
  399. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.