No Description

class_q_c_p_item_rect.tex 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. \hypertarget{class_q_c_p_item_rect}{}\section{Q\+C\+P\+Item\+Rect Class Reference}
  2. \label{class_q_c_p_item_rect}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  3. A rectangle.
  4. Inheritance diagram for Q\+C\+P\+Item\+Rect\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=4.000000cm]{class_q_c_p_item_rect}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Member Functions}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}{Q\+C\+P\+Item\+Rect} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)
  14. \item
  15. \hypertarget{class_q_c_p_item_rect_a3cb7b6de5e82cc5a3c99e9de919a55e6}{}Q\+Pen {\bfseries pen} () const \label{class_q_c_p_item_rect_a3cb7b6de5e82cc5a3c99e9de919a55e6}
  16. \item
  17. \hypertarget{class_q_c_p_item_rect_a7e701c34e72a4c25647e93fa369f395c}{}Q\+Pen {\bfseries selected\+Pen} () const \label{class_q_c_p_item_rect_a7e701c34e72a4c25647e93fa369f395c}
  18. \item
  19. \hypertarget{class_q_c_p_item_rect_a03d2d26ffcac78b25b8e90915f9c4abe}{}Q\+Brush {\bfseries brush} () const \label{class_q_c_p_item_rect_a03d2d26ffcac78b25b8e90915f9c4abe}
  20. \item
  21. \hypertarget{class_q_c_p_item_rect_a3b586228393f5c8efa78c4d2a4b25cbf}{}Q\+Brush {\bfseries selected\+Brush} () const \label{class_q_c_p_item_rect_a3b586228393f5c8efa78c4d2a4b25cbf}
  22. \item
  23. void \hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen} (const Q\+Pen \&pen)
  24. \item
  25. void \hyperlink{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}{set\+Selected\+Pen} (const Q\+Pen \&pen)
  26. \item
  27. void \hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush} (const Q\+Brush \&brush)
  28. \item
  29. void \hyperlink{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}{set\+Selected\+Brush} (const Q\+Brush \&brush)
  30. \item
  31. virtual double \hyperlink{class_q_c_p_item_rect_af13b0797079b40b73d1c7286b76f18ac}{select\+Test} (const Q\+Point\+F \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
  32. \end{DoxyCompactItemize}
  33. \subsection*{Public Attributes}
  34. \begin{DoxyCompactItemize}
  35. \item
  36. \hypertarget{class_q_c_p_item_rect_aa70feeef173489b03c3fbe906a5023c4}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries top\+Left}\label{class_q_c_p_item_rect_aa70feeef173489b03c3fbe906a5023c4}
  37. \item
  38. \hypertarget{class_q_c_p_item_rect_a409f3bfe615a7e322bb3d4d193d85b26}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries bottom\+Right}\label{class_q_c_p_item_rect_a409f3bfe615a7e322bb3d4d193d85b26}
  39. \item
  40. \hypertarget{class_q_c_p_item_rect_a96e50db552fb297d6fb62614676217bc}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries top}\label{class_q_c_p_item_rect_a96e50db552fb297d6fb62614676217bc}
  41. \item
  42. \hypertarget{class_q_c_p_item_rect_a77e0eb6e4aa6efee620d35e2c21bdad7}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries top\+Right}\label{class_q_c_p_item_rect_a77e0eb6e4aa6efee620d35e2c21bdad7}
  43. \item
  44. \hypertarget{class_q_c_p_item_rect_a7979c1915f61ad2609a9cc179c2e445e}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries right}\label{class_q_c_p_item_rect_a7979c1915f61ad2609a9cc179c2e445e}
  45. \item
  46. \hypertarget{class_q_c_p_item_rect_a99313bf2b338d9f81e19bd38082038aa}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries bottom}\label{class_q_c_p_item_rect_a99313bf2b338d9f81e19bd38082038aa}
  47. \item
  48. \hypertarget{class_q_c_p_item_rect_abd8ee63fdf81f0c74bf7ccadee8603da}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries bottom\+Left}\label{class_q_c_p_item_rect_abd8ee63fdf81f0c74bf7ccadee8603da}
  49. \item
  50. \hypertarget{class_q_c_p_item_rect_aad0ca1af0c8debfc20d7b47fc942764d}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries left}\label{class_q_c_p_item_rect_aad0ca1af0c8debfc20d7b47fc942764d}
  51. \end{DoxyCompactItemize}
  52. \subsection*{Protected Types}
  53. \begin{DoxyCompactItemize}
  54. \item
  55. \hypertarget{class_q_c_p_item_rect_af0ebba58e6bca4851c4db726691ec0d3}{}enum {\bfseries Anchor\+Index} \{ \\*
  56. {\bfseries ai\+Top},
  57. {\bfseries ai\+Top\+Right},
  58. {\bfseries ai\+Right},
  59. {\bfseries ai\+Bottom},
  60. \\*
  61. {\bfseries ai\+Bottom\+Left},
  62. {\bfseries ai\+Left}
  63. \}\label{class_q_c_p_item_rect_af0ebba58e6bca4851c4db726691ec0d3}
  64. \end{DoxyCompactItemize}
  65. \subsection*{Protected Member Functions}
  66. \begin{DoxyCompactItemize}
  67. \item
  68. \hypertarget{class_q_c_p_item_rect_a18cd583638b876cdd50f1a155ec182aa}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_item_rect_a18cd583638b876cdd50f1a155ec182aa}
  69. \item
  70. \hypertarget{class_q_c_p_item_rect_ae0973f8281fb52361b0c99ee899be07e}{}virtual Q\+Point\+F {\bfseries anchor\+Pixel\+Point} (int anchor\+Id) const \label{class_q_c_p_item_rect_ae0973f8281fb52361b0c99ee899be07e}
  71. \item
  72. \hypertarget{class_q_c_p_item_rect_afa0fb7c6328a1e197ecd537de36daf8f}{}Q\+Pen {\bfseries main\+Pen} () const \label{class_q_c_p_item_rect_afa0fb7c6328a1e197ecd537de36daf8f}
  73. \item
  74. \hypertarget{class_q_c_p_item_rect_ab0bd8e272e822ec851ba5b0c20e9200e}{}Q\+Brush {\bfseries main\+Brush} () const \label{class_q_c_p_item_rect_ab0bd8e272e822ec851ba5b0c20e9200e}
  75. \end{DoxyCompactItemize}
  76. \subsection*{Protected Attributes}
  77. \begin{DoxyCompactItemize}
  78. \item
  79. \hypertarget{class_q_c_p_item_rect_aa0d49323628d6752026056bfb52afd86}{}Q\+Pen {\bfseries m\+Pen}\label{class_q_c_p_item_rect_aa0d49323628d6752026056bfb52afd86}
  80. \item
  81. \hypertarget{class_q_c_p_item_rect_a73cc0bee61de3c67221ec8c7a76a29ed}{}Q\+Pen {\bfseries m\+Selected\+Pen}\label{class_q_c_p_item_rect_a73cc0bee61de3c67221ec8c7a76a29ed}
  82. \item
  83. \hypertarget{class_q_c_p_item_rect_a2d7f207fada27588b3a52b19234d3c2e}{}Q\+Brush {\bfseries m\+Brush}\label{class_q_c_p_item_rect_a2d7f207fada27588b3a52b19234d3c2e}
  84. \item
  85. \hypertarget{class_q_c_p_item_rect_a21b70eee59b6e19ae0bbdf037b13508f}{}Q\+Brush {\bfseries m\+Selected\+Brush}\label{class_q_c_p_item_rect_a21b70eee59b6e19ae0bbdf037b13508f}
  86. \end{DoxyCompactItemize}
  87. \subsection*{Additional Inherited Members}
  88. \subsection{Detailed Description}
  89. A rectangle.
  90. It has two positions, {\itshape top\+Left} and {\itshape bottom\+Right}, which define the rectangle.
  91. \subsection{Constructor \& Destructor Documentation}
  92. \hypertarget{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  93. \index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  94. \subsubsection[{Q\+C\+P\+Item\+Rect}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Rect\+::\+Q\+C\+P\+Item\+Rect (
  95. \begin{DoxyParamCaption}
  96. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot}
  97. \end{DoxyParamCaption}
  98. )}\label{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}
  99. Creates a rectangle item and sets default values.
  100. The constructed item can be added to the plot with \hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}.
  101. \subsection{Member Function Documentation}
  102. \hypertarget{class_q_c_p_item_rect_af13b0797079b40b73d1c7286b76f18ac}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!select\+Test@{select\+Test}}
  103. \index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  104. \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Item\+Rect\+::select\+Test (
  105. \begin{DoxyParamCaption}
  106. \item[{const Q\+Point\+F \&}]{pos, }
  107. \item[{bool}]{only\+Selectable, }
  108. \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}}
  109. \end{DoxyParamCaption}
  110. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_rect_af13b0797079b40b73d1c7286b76f18ac}
  111. This function is used to decide whether a click hits a layerable object or not.
  112. {\itshape pos} is a point in pixel coordinates on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn\textquotesingle{}t be determined, -\/1.\+0 is returned. Further, if {\itshape only\+Selectable} is true and the object is not selectable, -\/1.\+0 is returned, too.
  113. If the item is represented not by single lines but by an area like \hyperlink{class_q_c_p_item_rect}{Q\+C\+P\+Item\+Rect} or \hyperlink{class_q_c_p_item_text}{Q\+C\+P\+Item\+Text}, a click inside the area returns a constant value greater zero (typically the selection\+Tolerance of the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} multiplied by 0.\+99). If the click lies outside the area, this function returns -\/1.\+0.
  114. Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.\+e. closer than 0.\+99$\ast$selection\+Tolerance).
  115. The actual setting of the selection state is not done by this function. This is handled by the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} when the mouse\+Release\+Event occurs, and the finally selected object is notified via the select\+Event/deselect\+Event methods.
  116. {\itshape details} is an optional output parameter. Every layerable subclass may place any information in {\itshape details}. This information will be passed to select\+Event when the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} decides on the basis of this select\+Test call, that the object was successfully selected. The subsequent call to select\+Event will carry the {\itshape details}. This is useful for multi-\/part objects (like \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis}). This way, a possibly complex calculation to decide which part was clicked is only done once in \hyperlink{class_q_c_p_item_rect_af13b0797079b40b73d1c7286b76f18ac}{select\+Test}. The result (i.\+e. the actually clicked part) can then be placed in {\itshape details}. So in the subsequent select\+Event, the decision which part was selected doesn\textquotesingle{}t have to be done a second time for a single selection operation.
  117. You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.
  118. \begin{DoxySeeAlso}{See also}
  119. select\+Event, deselect\+Event, \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}
  120. \end{DoxySeeAlso}
  121. Implements \hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}.
  122. \hypertarget{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Brush@{set\+Brush}}
  123. \index{set\+Brush@{set\+Brush}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  124. \subsubsection[{set\+Brush}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Rect\+::set\+Brush (
  125. \begin{DoxyParamCaption}
  126. \item[{const Q\+Brush \&}]{brush}
  127. \end{DoxyParamCaption}
  128. )}\label{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}
  129. Sets the brush that will be used to fill the rectangle. To disable filling, set {\itshape brush} to Qt\+::\+No\+Brush.
  130. \begin{DoxySeeAlso}{See also}
  131. \hyperlink{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}{set\+Selected\+Brush}, \hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen}
  132. \end{DoxySeeAlso}
  133. \hypertarget{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Pen@{set\+Pen}}
  134. \index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  135. \subsubsection[{set\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Rect\+::set\+Pen (
  136. \begin{DoxyParamCaption}
  137. \item[{const Q\+Pen \&}]{pen}
  138. \end{DoxyParamCaption}
  139. )}\label{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}
  140. Sets the pen that will be used to draw the line of the rectangle
  141. \begin{DoxySeeAlso}{See also}
  142. \hyperlink{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}{set\+Selected\+Pen}, \hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush}
  143. \end{DoxySeeAlso}
  144. \hypertarget{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Selected\+Brush@{set\+Selected\+Brush}}
  145. \index{set\+Selected\+Brush@{set\+Selected\+Brush}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  146. \subsubsection[{set\+Selected\+Brush}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Rect\+::set\+Selected\+Brush (
  147. \begin{DoxyParamCaption}
  148. \item[{const Q\+Brush \&}]{brush}
  149. \end{DoxyParamCaption}
  150. )}\label{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}
  151. Sets the brush that will be used to fill the rectangle when selected. To disable filling, set {\itshape brush} to Qt\+::\+No\+Brush.
  152. \begin{DoxySeeAlso}{See also}
  153. \hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush}
  154. \end{DoxySeeAlso}
  155. \hypertarget{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}{}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Selected\+Pen@{set\+Selected\+Pen}}
  156. \index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
  157. \subsubsection[{set\+Selected\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Rect\+::set\+Selected\+Pen (
  158. \begin{DoxyParamCaption}
  159. \item[{const Q\+Pen \&}]{pen}
  160. \end{DoxyParamCaption}
  161. )}\label{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}
  162. Sets the pen that will be used to draw the line of the rectangle when selected
  163. \begin{DoxySeeAlso}{See also}
  164. \hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen}, \hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}
  165. \end{DoxySeeAlso}
  166. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  167. \item
  168. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  169. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}