No Description

class_q_c_p_item_position.tex 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. \hypertarget{class_q_c_p_item_position}{}\section{Q\+C\+P\+Item\+Position Class Reference}
  2. \label{class_q_c_p_item_position}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  3. Manages the position of an item.
  4. Inheritance diagram for Q\+C\+P\+Item\+Position\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=2.000000cm]{class_q_c_p_item_position}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Types}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. enum \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{Position\+Type} \{ \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{pt\+Absolute},
  14. \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ac7d6aa89ceacb39658b0d6da061c789a}{pt\+Viewport\+Ratio},
  15. \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}{pt\+Axis\+Rect\+Ratio},
  16. \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords}
  17. \}
  18. \end{DoxyCompactItemize}
  19. \subsection*{Public Member Functions}
  20. \begin{DoxyCompactItemize}
  21. \item
  22. \hyperlink{class_q_c_p_item_position_a3efc524f37fdcd22907545eb77555ce4}{Q\+C\+P\+Item\+Position} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot, \hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item} $\ast$parent\+Item, const Q\+String name)
  23. \item
  24. \hypertarget{class_q_c_p_item_position_ad64a1a26fbed5b8917e0eb8843099fd6}{}\hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{Position\+Type} {\bfseries type} () const \label{class_q_c_p_item_position_ad64a1a26fbed5b8917e0eb8843099fd6}
  25. \item
  26. \hypertarget{class_q_c_p_item_position_a0db87cc41efabc1cf94acee7ebe14eee}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$ {\bfseries parent\+Anchor} () const \label{class_q_c_p_item_position_a0db87cc41efabc1cf94acee7ebe14eee}
  27. \item
  28. \hypertarget{class_q_c_p_item_position_ac3cb2bddf5f89e5181830be30b93d090}{}double {\bfseries key} () const \label{class_q_c_p_item_position_ac3cb2bddf5f89e5181830be30b93d090}
  29. \item
  30. \hypertarget{class_q_c_p_item_position_a6817f7356d3a2b63e8446c6b6106dae1}{}double {\bfseries value} () const \label{class_q_c_p_item_position_a6817f7356d3a2b63e8446c6b6106dae1}
  31. \item
  32. \hypertarget{class_q_c_p_item_position_a253d7adbb6d46299bd6cbc31aa8819f1}{}Q\+Point\+F {\bfseries coords} () const \label{class_q_c_p_item_position_a253d7adbb6d46299bd6cbc31aa8819f1}
  33. \item
  34. \hypertarget{class_q_c_p_item_position_ab99de7ae5766d246defb2de9f47eaf51}{}\hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $\ast$ {\bfseries key\+Axis} () const \label{class_q_c_p_item_position_ab99de7ae5766d246defb2de9f47eaf51}
  35. \item
  36. \hypertarget{class_q_c_p_item_position_a8d3a039fb2e69df86b4015daa30dfd2d}{}\hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $\ast$ {\bfseries value\+Axis} () const \label{class_q_c_p_item_position_a8d3a039fb2e69df86b4015daa30dfd2d}
  37. \item
  38. \hypertarget{class_q_c_p_item_position_a7f10fa702a324880cc4de958f434cec7}{}\hyperlink{class_q_c_p_axis_rect}{Q\+C\+P\+Axis\+Rect} $\ast$ {\bfseries axis\+Rect} () const \label{class_q_c_p_item_position_a7f10fa702a324880cc4de958f434cec7}
  39. \item
  40. virtual Q\+Point\+F \hyperlink{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}{pixel\+Point} () const
  41. \item
  42. void \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type} (\hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{Position\+Type} type)
  43. \item
  44. bool \hyperlink{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{set\+Parent\+Anchor} (\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$parent\+Anchor, bool keep\+Pixel\+Position=false)
  45. \item
  46. void \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} (double key, double value)
  47. \item
  48. void \hyperlink{class_q_c_p_item_position_acc70b3abc143287f806e5f154e5e07b0}{set\+Coords} (const Q\+Point\+F \&coords)
  49. \item
  50. void \hyperlink{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}{set\+Axes} (\hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $\ast$key\+Axis, \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $\ast$value\+Axis)
  51. \item
  52. void \hyperlink{class_q_c_p_item_position_a0cd9b326fb324710169e92e8ca0041c2}{set\+Axis\+Rect} (\hyperlink{class_q_c_p_axis_rect}{Q\+C\+P\+Axis\+Rect} $\ast$axis\+Rect)
  53. \item
  54. void \hyperlink{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{set\+Pixel\+Point} (const Q\+Point\+F \&\hyperlink{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}{pixel\+Point})
  55. \end{DoxyCompactItemize}
  56. \subsection*{Protected Member Functions}
  57. \begin{DoxyCompactItemize}
  58. \item
  59. virtual \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$ \hyperlink{class_q_c_p_item_position_a577a7efc601df85a20b3e709d1ac320e}{to\+Q\+C\+P\+Item\+Position} ()
  60. \end{DoxyCompactItemize}
  61. \subsection*{Protected Attributes}
  62. \begin{DoxyCompactItemize}
  63. \item
  64. \hypertarget{class_q_c_p_item_position_ac9c7bbca809601323d3ae2542ef2801a}{}\hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{Position\+Type} {\bfseries m\+Position\+Type}\label{class_q_c_p_item_position_ac9c7bbca809601323d3ae2542ef2801a}
  65. \item
  66. \hypertarget{class_q_c_p_item_position_a63967a33933231e92f68c8ce06bfc37e}{}Q\+Pointer$<$ \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $>$ {\bfseries m\+Key\+Axis}\label{class_q_c_p_item_position_a63967a33933231e92f68c8ce06bfc37e}
  67. \item
  68. \hypertarget{class_q_c_p_item_position_a505dc2da24ba274452c1c817fcaba011}{}Q\+Pointer$<$ \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis} $>$ {\bfseries m\+Value\+Axis}\label{class_q_c_p_item_position_a505dc2da24ba274452c1c817fcaba011}
  69. \item
  70. \hypertarget{class_q_c_p_item_position_add40fcb8994c247d85f42a126286b740}{}Q\+Pointer$<$ \hyperlink{class_q_c_p_axis_rect}{Q\+C\+P\+Axis\+Rect} $>$ {\bfseries m\+Axis\+Rect}\label{class_q_c_p_item_position_add40fcb8994c247d85f42a126286b740}
  71. \item
  72. \hypertarget{class_q_c_p_item_position_a4ff3931ad115603dfb4c7000b24bb415}{}double {\bfseries m\+Key}\label{class_q_c_p_item_position_a4ff3931ad115603dfb4c7000b24bb415}
  73. \item
  74. \hypertarget{class_q_c_p_item_position_a67bf5df69f587d53731724a7d61c6c3f}{}double {\bfseries m\+Value}\label{class_q_c_p_item_position_a67bf5df69f587d53731724a7d61c6c3f}
  75. \item
  76. \hypertarget{class_q_c_p_item_position_a21e37c5a8cabe747a2c60773b23eddeb}{}\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} $\ast$ {\bfseries m\+Parent\+Anchor}\label{class_q_c_p_item_position_a21e37c5a8cabe747a2c60773b23eddeb}
  77. \end{DoxyCompactItemize}
  78. \subsection{Detailed Description}
  79. Manages the position of an item.
  80. Every item has at least one public \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} member pointer which provides ways to position the item on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. Some items have multiple positions, for example \hyperlink{class_q_c_p_item_rect}{Q\+C\+P\+Item\+Rect} has two\+: {\itshape top\+Left} and {\itshape bottom\+Right}.
  81. \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} has a type (\hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{Position\+Type}) that can be set with \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type}. This type defines how coordinates passed to \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} are to be interpreted, e.\+g. as absolute pixel coordinates, as plot coordinates of certain axes, etc.
  82. Further, \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} may have a parent \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}, see \hyperlink{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{set\+Parent\+Anchor}. (Note that every \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} inherits from \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} and thus can itself be used as parent anchor for other positions.) This way you can tie multiple items together. If the \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} has a parent, the coordinates set with \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} are considered to be absolute values in the reference frame of the parent anchor, where (0, 0) means directly ontop of the parent anchor. For example, You could attach the {\itshape start} position of a \hyperlink{class_q_c_p_item_line}{Q\+C\+P\+Item\+Line} to the {\itshape bottom} anchor of a \hyperlink{class_q_c_p_item_text}{Q\+C\+P\+Item\+Text} to make the starting point of the line always be centered under the text label, no matter where the text is moved to, or is itself tied to.
  83. To set the apparent pixel position on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface directly, use \hyperlink{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{set\+Pixel\+Point}. This works no matter what type this \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} is or what parent-\/child situation it is in, as \hyperlink{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{set\+Pixel\+Point} transforms the coordinates appropriately, to make the position appear at the specified pixel values.
  84. \subsection{Member Enumeration Documentation}
  85. \hypertarget{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!Position\+Type@{Position\+Type}}
  86. \index{Position\+Type@{Position\+Type}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  87. \subsubsection[{Position\+Type}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Q\+C\+P\+Item\+Position\+::\+Position\+Type}}\label{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8}
  88. Defines the ways an item position can be specified. Thus it defines what the numbers passed to \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} actually mean.
  89. \begin{DoxySeeAlso}{See also}
  90. \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type}
  91. \end{DoxySeeAlso}
  92. \begin{Desc}
  93. \item[Enumerator]\par
  94. \begin{description}
  95. \index{pt\+Absolute@{pt\+Absolute}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!pt\+Absolute@{pt\+Absolute}}\item[{\em
  96. \hypertarget{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{}pt\+Absolute\label{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}
  97. }]Static positioning in pixels, starting from the top left corner of the viewport/widget. \index{pt\+Viewport\+Ratio@{pt\+Viewport\+Ratio}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!pt\+Viewport\+Ratio@{pt\+Viewport\+Ratio}}\item[{\em
  98. \hypertarget{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ac7d6aa89ceacb39658b0d6da061c789a}{}pt\+Viewport\+Ratio\label{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ac7d6aa89ceacb39658b0d6da061c789a}
  99. }]Static positioning given by a fraction of the viewport size. \index{pt\+Axis\+Rect\+Ratio@{pt\+Axis\+Rect\+Ratio}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!pt\+Axis\+Rect\+Ratio@{pt\+Axis\+Rect\+Ratio}}\item[{\em
  100. \hypertarget{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}{}pt\+Axis\+Rect\+Ratio\label{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}
  101. }]Static positioning given by a fraction of the axis rect size (see \hyperlink{class_q_c_p_item_position_a0cd9b326fb324710169e92e8ca0041c2}{set\+Axis\+Rect}). \index{pt\+Plot\+Coords@{pt\+Plot\+Coords}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!pt\+Plot\+Coords@{pt\+Plot\+Coords}}\item[{\em
  102. \hypertarget{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{}pt\+Plot\+Coords\label{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}
  103. }]Dynamic positioning at a plot coordinate defined by two axes (see \hyperlink{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}{set\+Axes}). \end{description}
  104. \end{Desc}
  105. \subsection{Constructor \& Destructor Documentation}
  106. \hypertarget{class_q_c_p_item_position_a3efc524f37fdcd22907545eb77555ce4}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  107. \index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  108. \subsubsection[{Q\+C\+P\+Item\+Position}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Position\+::\+Q\+C\+P\+Item\+Position (
  109. \begin{DoxyParamCaption}
  110. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot, }
  111. \item[{{\bf Q\+C\+P\+Abstract\+Item} $\ast$}]{parent\+Item, }
  112. \item[{const Q\+String}]{name}
  113. \end{DoxyParamCaption}
  114. )}\label{class_q_c_p_item_position_a3efc524f37fdcd22907545eb77555ce4}
  115. Creates a new \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}. You shouldn\textquotesingle{}t create \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} instances directly, even if you want to make a new item subclass. Use Q\+C\+P\+Abstract\+Item\+::create\+Position instead, as explained in the subclassing section of the \hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item} documentation.
  116. \subsection{Member Function Documentation}
  117. \hypertarget{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!pixel\+Point@{pixel\+Point}}
  118. \index{pixel\+Point@{pixel\+Point}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  119. \subsubsection[{pixel\+Point}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Point\+F Q\+C\+P\+Item\+Position\+::pixel\+Point (
  120. \begin{DoxyParamCaption}
  121. {}
  122. \end{DoxyParamCaption}
  123. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}
  124. Returns the final absolute pixel position of the \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. It includes all effects of type (\hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type}) and possible parent anchors (\hyperlink{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{set\+Parent\+Anchor}).
  125. \begin{DoxySeeAlso}{See also}
  126. \hyperlink{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{set\+Pixel\+Point}
  127. \end{DoxySeeAlso}
  128. Reimplemented from \hyperlink{class_q_c_p_item_anchor_ae92def8f9297c5d73f5806c586517bb3}{Q\+C\+P\+Item\+Anchor}.
  129. \hypertarget{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Axes@{set\+Axes}}
  130. \index{set\+Axes@{set\+Axes}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  131. \subsubsection[{set\+Axes}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Axes (
  132. \begin{DoxyParamCaption}
  133. \item[{{\bf Q\+C\+P\+Axis} $\ast$}]{key\+Axis, }
  134. \item[{{\bf Q\+C\+P\+Axis} $\ast$}]{value\+Axis}
  135. \end{DoxyParamCaption}
  136. )}\label{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}
  137. When \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type} is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords}, this function may be used to specify the axes the coordinates set with \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} relate to. By default they are set to the initial x\+Axis and y\+Axis of the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}. \hypertarget{class_q_c_p_item_position_a0cd9b326fb324710169e92e8ca0041c2}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Axis\+Rect@{set\+Axis\+Rect}}
  138. \index{set\+Axis\+Rect@{set\+Axis\+Rect}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  139. \subsubsection[{set\+Axis\+Rect}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Axis\+Rect (
  140. \begin{DoxyParamCaption}
  141. \item[{{\bf Q\+C\+P\+Axis\+Rect} $\ast$}]{axis\+Rect}
  142. \end{DoxyParamCaption}
  143. )}\label{class_q_c_p_item_position_a0cd9b326fb324710169e92e8ca0041c2}
  144. When \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type} is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}{pt\+Axis\+Rect\+Ratio}, this function may be used to specify the axis rect the coordinates set with \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} relate to. By default this is set to the main axis rect of the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}. \hypertarget{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Coords@{set\+Coords}}
  145. \index{set\+Coords@{set\+Coords}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  146. \subsubsection[{set\+Coords}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Coords (
  147. \begin{DoxyParamCaption}
  148. \item[{double}]{key, }
  149. \item[{double}]{value}
  150. \end{DoxyParamCaption}
  151. )}\label{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}
  152. Sets the coordinates of this \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}. What the coordinates mean, is defined by the type (\hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type}).
  153. For example, if the type is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{pt\+Absolute}, {\itshape key} and {\itshape value} mean the x and y pixel position on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. In that case the origin (0, 0) is in the top left corner of the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} viewport. If the type is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords}, {\itshape key} and {\itshape value} mean a point in the plot coordinate system defined by the axes set by \hyperlink{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}{set\+Axes}. By default those are the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}\textquotesingle{}s x\+Axis and y\+Axis. See the documentation of \hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type} for other available coordinate types and their meaning.
  154. \begin{DoxySeeAlso}{See also}
  155. \hyperlink{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{set\+Pixel\+Point}
  156. \end{DoxySeeAlso}
  157. \hypertarget{class_q_c_p_item_position_acc70b3abc143287f806e5f154e5e07b0}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Coords@{set\+Coords}}
  158. \index{set\+Coords@{set\+Coords}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  159. \subsubsection[{set\+Coords}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Coords (
  160. \begin{DoxyParamCaption}
  161. \item[{const Q\+Point\+F \&}]{pos}
  162. \end{DoxyParamCaption}
  163. )}\label{class_q_c_p_item_position_acc70b3abc143287f806e5f154e5e07b0}
  164. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
  165. Sets the coordinates as a Q\+Point\+F {\itshape pos} where pos.\+x has the meaning of {\itshape key} and pos.\+y the meaning of {\itshape value} of the \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords(double key, double value)} method. \hypertarget{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Parent\+Anchor@{set\+Parent\+Anchor}}
  166. \index{set\+Parent\+Anchor@{set\+Parent\+Anchor}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  167. \subsubsection[{set\+Parent\+Anchor}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Item\+Position\+::set\+Parent\+Anchor (
  168. \begin{DoxyParamCaption}
  169. \item[{{\bf Q\+C\+P\+Item\+Anchor} $\ast$}]{parent\+Anchor, }
  170. \item[{bool}]{keep\+Pixel\+Position = {\ttfamily false}}
  171. \end{DoxyParamCaption}
  172. )}\label{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}
  173. Sets the parent of this \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} to {\itshape parent\+Anchor}. This means the position will now follow any position changes of the anchor. The local coordinate system of positions with a parent anchor always is absolute with (0, 0) being exactly on top of the parent anchor. (Hence the type shouldn\textquotesingle{}t be \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords} for positions with parent anchors.)
  174. if {\itshape keep\+Pixel\+Position} is true, the current pixel position of the \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} is preserved during reparenting. If it\textquotesingle{}s set to false, the coordinates are set to (0, 0), i.\+e. the position will be exactly on top of the parent anchor.
  175. To remove this \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} from any parent anchor, set {\itshape parent\+Anchor} to 0.
  176. If the \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} previously had no parent and the type is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords}, the type is set to \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{pt\+Absolute}, to keep the position in a valid state. \hypertarget{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Pixel\+Point@{set\+Pixel\+Point}}
  177. \index{set\+Pixel\+Point@{set\+Pixel\+Point}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  178. \subsubsection[{set\+Pixel\+Point}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Pixel\+Point (
  179. \begin{DoxyParamCaption}
  180. \item[{const Q\+Point\+F \&}]{pixel\+Point}
  181. \end{DoxyParamCaption}
  182. )}\label{class_q_c_p_item_position_ab404e56d9ac2ac2df0382c57933a71ef}
  183. Sets the apparent pixel position. This works no matter what type (\hyperlink{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{set\+Type}) this \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} is or what parent-\/child situation it is in, as coordinates are transformed appropriately, to make the position finally appear at the specified pixel values.
  184. Only if the type is \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{pt\+Absolute} and no parent anchor is set, this function\textquotesingle{}s effect is identical to that of \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords}.
  185. \begin{DoxySeeAlso}{See also}
  186. \hyperlink{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}{pixel\+Point}, \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords}
  187. \end{DoxySeeAlso}
  188. \hypertarget{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!set\+Type@{set\+Type}}
  189. \index{set\+Type@{set\+Type}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  190. \subsubsection[{set\+Type}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Position\+::set\+Type (
  191. \begin{DoxyParamCaption}
  192. \item[{{\bf Q\+C\+P\+Item\+Position\+::\+Position\+Type}}]{type}
  193. \end{DoxyParamCaption}
  194. )}\label{class_q_c_p_item_position_aa476abf71ed8fa4c537457ebb1a754ad}
  195. Sets the type of the position. The type defines how the coordinates passed to \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} should be handled and how the \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} should behave in the plot.
  196. The possible values for {\itshape type} can be separated in two main categories\+:
  197. \begin{DoxyItemize}
  198. \item The position is regarded as a point in plot coordinates. This corresponds to \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords} and requires two axes that define the plot coordinate system. They can be specified with \hyperlink{class_q_c_p_item_position_a2185f45c75ac8cb9be89daeaaad50e37}{set\+Axes}. By default, the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}\textquotesingle{}s x-\/ and y\+Axis are used.\end{DoxyItemize}
  199. \begin{DoxyItemize}
  200. \item The position is fixed on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface, i.\+e. independent of axis ranges. This corresponds to all other types, i.\+e. \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a564f5e53e550ead1ec5fc7fc7d0b73e0}{pt\+Absolute}, \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ac7d6aa89ceacb39658b0d6da061c789a}{pt\+Viewport\+Ratio} and \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}{pt\+Axis\+Rect\+Ratio}. They differ only in the way the absolute position is described, see the documentation of Position\+Type for details. For \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8a01080fd00eaf09fa238ef6b73bbfef75}{pt\+Axis\+Rect\+Ratio}, note that you can specify the axis rect with \hyperlink{class_q_c_p_item_position_a0cd9b326fb324710169e92e8ca0041c2}{set\+Axis\+Rect}. By default this is set to the main axis rect.\end{DoxyItemize}
  201. Note that the position type \hyperlink{class_q_c_p_item_position_aad9936c22bf43e3d358552f6e86dbdc8ad5ffb8dc99ad73263f7010c77342294c}{pt\+Plot\+Coords} is only available (and sensible) when the position has no parent anchor (\hyperlink{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{set\+Parent\+Anchor}).
  202. If the type is changed, the apparent pixel position on the plot is preserved. This means the coordinates as retrieved with coords() and set with \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{set\+Coords} may change in the process. \hypertarget{class_q_c_p_item_position_a577a7efc601df85a20b3e709d1ac320e}{}\index{Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}!to\+Q\+C\+P\+Item\+Position@{to\+Q\+C\+P\+Item\+Position}}
  203. \index{to\+Q\+C\+P\+Item\+Position@{to\+Q\+C\+P\+Item\+Position}!Q\+C\+P\+Item\+Position@{Q\+C\+P\+Item\+Position}}
  204. \subsubsection[{to\+Q\+C\+P\+Item\+Position}]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Q\+C\+P\+Item\+Position}$\ast$ Q\+C\+P\+Item\+Position\+::to\+Q\+C\+P\+Item\+Position (
  205. \begin{DoxyParamCaption}
  206. {}
  207. \end{DoxyParamCaption}
  208. )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}\label{class_q_c_p_item_position_a577a7efc601df85a20b3e709d1ac320e}
  209. Returns 0 if this instance is merely a \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}, and a valid pointer of type Q\+C\+P\+Item\+Position$\ast$ if it actually is a \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} (which is a subclass of \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}).
  210. This safe downcast functionality could also be achieved with a dynamic\+\_\+cast. However, \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} avoids dynamic\+\_\+cast to work with projects that don\textquotesingle{}t have R\+T\+T\+I support enabled (e.\+g. -\/fno-\/rtti flag with gcc compiler).
  211. Reimplemented from \hyperlink{class_q_c_p_item_anchor_ac54b20120669950255a63587193dbb86}{Q\+C\+P\+Item\+Anchor}.
  212. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  213. \item
  214. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  215. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}