No Description

class_q_c_p_item_pixmap.tex 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. \hypertarget{class_q_c_p_item_pixmap}{}\section{Referencia de la Clase Q\+C\+P\+Item\+Pixmap}
  2. \label{class_q_c_p_item_pixmap}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  3. An arbitrary pixmap.
  4. Diagrama de herencias de Q\+C\+P\+Item\+Pixmap\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=4.000000cm]{class_q_c_p_item_pixmap}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Métodos públicos}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_pixmap_aa6de42a37261b21a5480e7da122345c3}{Q\+C\+P\+Item\+Pixmap} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)
  14. \item
  15. \hypertarget{class_q_c_p_item_pixmap_a73dea89e0eb45127a2705e2c7991b8d8}{}Q\+Pixmap {\bfseries pixmap} () const \label{class_q_c_p_item_pixmap_a73dea89e0eb45127a2705e2c7991b8d8}
  16. \item
  17. \hypertarget{class_q_c_p_item_pixmap_a54026b89dff3c60376c2360f01b6fb83}{}bool {\bfseries scaled} () const \label{class_q_c_p_item_pixmap_a54026b89dff3c60376c2360f01b6fb83}
  18. \item
  19. \hypertarget{class_q_c_p_item_pixmap_ac5b95c097169e107a61eebbb7c77523c}{}Qt\+::\+Aspect\+Ratio\+Mode {\bfseries aspect\+Ratio\+Mode} () const \label{class_q_c_p_item_pixmap_ac5b95c097169e107a61eebbb7c77523c}
  20. \item
  21. \hypertarget{class_q_c_p_item_pixmap_ab2b821c80cfade589472e933b9c4361f}{}Q\+Pen {\bfseries pen} () const \label{class_q_c_p_item_pixmap_ab2b821c80cfade589472e933b9c4361f}
  22. \item
  23. \hypertarget{class_q_c_p_item_pixmap_af8e839d7c7b84e214608feda3caec2bc}{}Q\+Pen {\bfseries selected\+Pen} () const \label{class_q_c_p_item_pixmap_af8e839d7c7b84e214608feda3caec2bc}
  24. \item
  25. void \hyperlink{class_q_c_p_item_pixmap_a726b69ea4025edf48f9b29b6450548a7}{set\+Pixmap} (const Q\+Pixmap \&pixmap)
  26. \item
  27. void \hyperlink{class_q_c_p_item_pixmap_aea813ff1b12163ae5d3ac182593b1d6f}{set\+Scaled} (bool scaled, Qt\+::\+Aspect\+Ratio\+Mode aspect\+Ratio\+Mode=Qt\+::\+Keep\+Aspect\+Ratio)
  28. \item
  29. void \hyperlink{class_q_c_p_item_pixmap_acdade1305edb4b5cae14f97fd132065f}{set\+Pen} (const Q\+Pen \&pen)
  30. \item
  31. void \hyperlink{class_q_c_p_item_pixmap_afc5e479e88e53740176ce77cb70dd67a}{set\+Selected\+Pen} (const Q\+Pen \&pen)
  32. \item
  33. virtual double \hyperlink{class_q_c_p_item_pixmap_a9f8436aa141fa0fb504191c882c2f4d9}{select\+Test} (const Q\+Point\+F \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
  34. \end{DoxyCompactItemize}
  35. \subsection*{Atributos públicos}
  36. \begin{DoxyCompactItemize}
  37. \item
  38. \hypertarget{class_q_c_p_item_pixmap_a43c281ef6ad46f3cf04f365289abe51a}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries top\+Left}\label{class_q_c_p_item_pixmap_a43c281ef6ad46f3cf04f365289abe51a}
  39. \item
  40. \hypertarget{class_q_c_p_item_pixmap_abcc38063f9502b876bf6615c45cc0994}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries bottom\+Right}\label{class_q_c_p_item_pixmap_abcc38063f9502b876bf6615c45cc0994}
  41. \item
  42. \hypertarget{class_q_c_p_item_pixmap_af7a156590b1d59ab21b453c430c56a7c}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries top}\label{class_q_c_p_item_pixmap_af7a156590b1d59ab21b453c430c56a7c}
  43. \item
  44. \hypertarget{class_q_c_p_item_pixmap_a72eabd0010be41a4ec1b22aa983d2aa1}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries top\+Right}\label{class_q_c_p_item_pixmap_a72eabd0010be41a4ec1b22aa983d2aa1}
  45. \item
  46. \hypertarget{class_q_c_p_item_pixmap_ac9c0fd231f9e285765978a05d13f8280}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries right}\label{class_q_c_p_item_pixmap_ac9c0fd231f9e285765978a05d13f8280}
  47. \item
  48. \hypertarget{class_q_c_p_item_pixmap_ad7da77f530868e846151eff8a28fb948}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries bottom}\label{class_q_c_p_item_pixmap_ad7da77f530868e846151eff8a28fb948}
  49. \item
  50. \hypertarget{class_q_c_p_item_pixmap_a01943e569233382b3627e24636b0fff2}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries bottom\+Left}\label{class_q_c_p_item_pixmap_a01943e569233382b3627e24636b0fff2}
  51. \item
  52. \hypertarget{class_q_c_p_item_pixmap_a8c85fcb8cb8ce292859a0499d16539b1}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$const {\bfseries left}\label{class_q_c_p_item_pixmap_a8c85fcb8cb8ce292859a0499d16539b1}
  53. \end{DoxyCompactItemize}
  54. \subsection*{Tipos protegidos}
  55. \begin{DoxyCompactItemize}
  56. \item
  57. \hypertarget{class_q_c_p_item_pixmap_a0ea7f65edb7395e02de521915f221174}{}enum {\bfseries Anchor\+Index} \{ \\*
  58. {\bfseries ai\+Top},
  59. {\bfseries ai\+Top\+Right},
  60. {\bfseries ai\+Right},
  61. {\bfseries ai\+Bottom},
  62. \\*
  63. {\bfseries ai\+Bottom\+Left},
  64. {\bfseries ai\+Left}
  65. \}\label{class_q_c_p_item_pixmap_a0ea7f65edb7395e02de521915f221174}
  66. \end{DoxyCompactItemize}
  67. \subsection*{Métodos protegidos}
  68. \begin{DoxyCompactItemize}
  69. \item
  70. \hypertarget{class_q_c_p_item_pixmap_a879e8076c2db01a38b34cfa73ec95d2f}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_item_pixmap_a879e8076c2db01a38b34cfa73ec95d2f}
  71. \item
  72. \hypertarget{class_q_c_p_item_pixmap_a88abce3c1027f371cddcf6dad35ffbb1}{}virtual Q\+Point\+F {\bfseries anchor\+Pixel\+Point} (int anchor\+Id) const \label{class_q_c_p_item_pixmap_a88abce3c1027f371cddcf6dad35ffbb1}
  73. \item
  74. \hypertarget{class_q_c_p_item_pixmap_a8bced3027b326b290726cd1979c7cfc6}{}void {\bfseries update\+Scaled\+Pixmap} (Q\+Rect final\+Rect=Q\+Rect(), bool flip\+Horz=false, bool flip\+Vert=false)\label{class_q_c_p_item_pixmap_a8bced3027b326b290726cd1979c7cfc6}
  75. \item
  76. \hypertarget{class_q_c_p_item_pixmap_a245ef0c626cab7096a810442f2f6a2d9}{}Q\+Rect {\bfseries get\+Final\+Rect} (bool $\ast$flipped\+Horz=0, bool $\ast$flipped\+Vert=0) const \label{class_q_c_p_item_pixmap_a245ef0c626cab7096a810442f2f6a2d9}
  77. \item
  78. \hypertarget{class_q_c_p_item_pixmap_af21085516585c475dc9d839e7f377233}{}Q\+Pen {\bfseries main\+Pen} () const \label{class_q_c_p_item_pixmap_af21085516585c475dc9d839e7f377233}
  79. \end{DoxyCompactItemize}
  80. \subsection*{Atributos protegidos}
  81. \begin{DoxyCompactItemize}
  82. \item
  83. \hypertarget{class_q_c_p_item_pixmap_a1396cce7f26c7b8e9512906284380c4d}{}Q\+Pixmap {\bfseries m\+Pixmap}\label{class_q_c_p_item_pixmap_a1396cce7f26c7b8e9512906284380c4d}
  84. \item
  85. \hypertarget{class_q_c_p_item_pixmap_a2ebc66e15b9f1264563d58f29ba1bc00}{}Q\+Pixmap {\bfseries m\+Scaled\+Pixmap}\label{class_q_c_p_item_pixmap_a2ebc66e15b9f1264563d58f29ba1bc00}
  86. \item
  87. \hypertarget{class_q_c_p_item_pixmap_a8fe670a529cd46a9b8afd9fc1203bc3f}{}bool {\bfseries m\+Scaled}\label{class_q_c_p_item_pixmap_a8fe670a529cd46a9b8afd9fc1203bc3f}
  88. \item
  89. \hypertarget{class_q_c_p_item_pixmap_a8dc6b6c1e106ac523efae22d5fe55bab}{}Qt\+::\+Aspect\+Ratio\+Mode {\bfseries m\+Aspect\+Ratio\+Mode}\label{class_q_c_p_item_pixmap_a8dc6b6c1e106ac523efae22d5fe55bab}
  90. \item
  91. \hypertarget{class_q_c_p_item_pixmap_acfee1124eb51a1887aaf8de10777c7a1}{}Q\+Pen {\bfseries m\+Pen}\label{class_q_c_p_item_pixmap_acfee1124eb51a1887aaf8de10777c7a1}
  92. \item
  93. \hypertarget{class_q_c_p_item_pixmap_a0949e5bb6a261fc4e9668e28e2effcfa}{}Q\+Pen {\bfseries m\+Selected\+Pen}\label{class_q_c_p_item_pixmap_a0949e5bb6a261fc4e9668e28e2effcfa}
  94. \end{DoxyCompactItemize}
  95. \subsection*{Otros miembros heredados}
  96. \subsection{Descripción detallada}
  97. An arbitrary pixmap.
  98. It has two positions, {\itshape top\+Left} and {\itshape bottom\+Right}, which define the rectangle the pixmap will be drawn in. Depending on the scale setting (\hyperlink{class_q_c_p_item_pixmap_aea813ff1b12163ae5d3ac182593b1d6f}{set\+Scaled}), the pixmap will be either scaled to fit the rectangle or be drawn aligned to the top\+Left position.
  99. If scaling is enabled and {\itshape top\+Left} is further to the bottom/right than {\itshape bottom\+Right} (as shown on the right side of the example image), the pixmap will be flipped in the respective orientations.
  100. \subsection{Documentación del constructor y destructor}
  101. \hypertarget{class_q_c_p_item_pixmap_aa6de42a37261b21a5480e7da122345c3}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  102. \index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  103. \subsubsection[{Q\+C\+P\+Item\+Pixmap}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Pixmap\+::\+Q\+C\+P\+Item\+Pixmap (
  104. \begin{DoxyParamCaption}
  105. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot}
  106. \end{DoxyParamCaption}
  107. )}\label{class_q_c_p_item_pixmap_aa6de42a37261b21a5480e7da122345c3}
  108. Creates a rectangle item and sets default values.
  109. The constructed item can be added to the plot with \hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}.
  110. \subsection{Documentación de las funciones miembro}
  111. \hypertarget{class_q_c_p_item_pixmap_a9f8436aa141fa0fb504191c882c2f4d9}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!select\+Test@{select\+Test}}
  112. \index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  113. \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Item\+Pixmap\+::select\+Test (
  114. \begin{DoxyParamCaption}
  115. \item[{const Q\+Point\+F \&}]{pos, }
  116. \item[{bool}]{only\+Selectable, }
  117. \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}}
  118. \end{DoxyParamCaption}
  119. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_pixmap_a9f8436aa141fa0fb504191c882c2f4d9}
  120. This function is used to decide whether a click hits a layerable object or not.
  121. {\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.
  122. 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.
  123. 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).
  124. 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.
  125. {\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_pixmap_a9f8436aa141fa0fb504191c882c2f4d9}{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.
  126. You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.
  127. \begin{DoxySeeAlso}{Ver también}
  128. select\+Event, deselect\+Event, \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}
  129. \end{DoxySeeAlso}
  130. Implementa \hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}.
  131. \hypertarget{class_q_c_p_item_pixmap_acdade1305edb4b5cae14f97fd132065f}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!set\+Pen@{set\+Pen}}
  132. \index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  133. \subsubsection[{set\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Pixmap\+::set\+Pen (
  134. \begin{DoxyParamCaption}
  135. \item[{const Q\+Pen \&}]{pen}
  136. \end{DoxyParamCaption}
  137. )}\label{class_q_c_p_item_pixmap_acdade1305edb4b5cae14f97fd132065f}
  138. Sets the pen that will be used to draw a border around the pixmap.
  139. \begin{DoxySeeAlso}{Ver también}
  140. \hyperlink{class_q_c_p_item_pixmap_afc5e479e88e53740176ce77cb70dd67a}{set\+Selected\+Pen}, set\+Brush
  141. \end{DoxySeeAlso}
  142. \hypertarget{class_q_c_p_item_pixmap_a726b69ea4025edf48f9b29b6450548a7}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!set\+Pixmap@{set\+Pixmap}}
  143. \index{set\+Pixmap@{set\+Pixmap}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  144. \subsubsection[{set\+Pixmap}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Pixmap\+::set\+Pixmap (
  145. \begin{DoxyParamCaption}
  146. \item[{const Q\+Pixmap \&}]{pixmap}
  147. \end{DoxyParamCaption}
  148. )}\label{class_q_c_p_item_pixmap_a726b69ea4025edf48f9b29b6450548a7}
  149. Sets the pixmap that will be displayed. \hypertarget{class_q_c_p_item_pixmap_aea813ff1b12163ae5d3ac182593b1d6f}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!set\+Scaled@{set\+Scaled}}
  150. \index{set\+Scaled@{set\+Scaled}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  151. \subsubsection[{set\+Scaled}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Pixmap\+::set\+Scaled (
  152. \begin{DoxyParamCaption}
  153. \item[{bool}]{scaled, }
  154. \item[{Qt\+::\+Aspect\+Ratio\+Mode}]{aspect\+Ratio\+Mode = {\ttfamily Qt\+:\+:KeepAspectRatio}}
  155. \end{DoxyParamCaption}
  156. )}\label{class_q_c_p_item_pixmap_aea813ff1b12163ae5d3ac182593b1d6f}
  157. Sets whether the pixmap will be scaled to fit the rectangle defined by the {\itshape top\+Left} and {\itshape bottom\+Right} positions. \hypertarget{class_q_c_p_item_pixmap_afc5e479e88e53740176ce77cb70dd67a}{}\index{Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}!set\+Selected\+Pen@{set\+Selected\+Pen}}
  158. \index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Pixmap@{Q\+C\+P\+Item\+Pixmap}}
  159. \subsubsection[{set\+Selected\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Pixmap\+::set\+Selected\+Pen (
  160. \begin{DoxyParamCaption}
  161. \item[{const Q\+Pen \&}]{pen}
  162. \end{DoxyParamCaption}
  163. )}\label{class_q_c_p_item_pixmap_afc5e479e88e53740176ce77cb70dd67a}
  164. Sets the pen that will be used to draw a border around the pixmap when selected
  165. \begin{DoxySeeAlso}{Ver también}
  166. \hyperlink{class_q_c_p_item_pixmap_acdade1305edb4b5cae14f97fd132065f}{set\+Pen}, \hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}
  167. \end{DoxySeeAlso}
  168. La documentación para esta clase fue generada a partir de los siguientes ficheros\+:\begin{DoxyCompactItemize}
  169. \item
  170. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  171. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}