暫無描述

class_q_c_p_item_anchor.tex 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. \hypertarget{class_q_c_p_item_anchor}{}\section{Q\+C\+P\+Item\+Anchor Class Reference}
  2. \label{class_q_c_p_item_anchor}\index{Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}}
  3. An anchor of an item to which positions can be attached to.
  4. Inheritance diagram for Q\+C\+P\+Item\+Anchor\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=2.000000cm]{class_q_c_p_item_anchor}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Member Functions}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_anchor_aeb6b681d2bf324db40a915d32ec5624f}{Q\+C\+P\+Item\+Anchor} (\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, int anchor\+Id=-\/1)
  14. \item
  15. \hypertarget{class_q_c_p_item_anchor_ac93984042a58c875e76847dc3e5f75fe}{}Q\+String {\bfseries name} () const \label{class_q_c_p_item_anchor_ac93984042a58c875e76847dc3e5f75fe}
  16. \item
  17. virtual Q\+Point\+F \hyperlink{class_q_c_p_item_anchor_ae92def8f9297c5d73f5806c586517bb3}{pixel\+Point} () const
  18. \end{DoxyCompactItemize}
  19. \subsection*{Protected Member Functions}
  20. \begin{DoxyCompactItemize}
  21. \item
  22. virtual \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$ \hyperlink{class_q_c_p_item_anchor_ac54b20120669950255a63587193dbb86}{to\+Q\+C\+P\+Item\+Position} ()
  23. \item
  24. \hypertarget{class_q_c_p_item_anchor_ad11517e2ce5c2f9a798e78fb45e2e0d0}{}void {\bfseries add\+Child} (\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$pos)\label{class_q_c_p_item_anchor_ad11517e2ce5c2f9a798e78fb45e2e0d0}
  25. \item
  26. \hypertarget{class_q_c_p_item_anchor_ab65ec61984575f737f43c2bb59dd0d76}{}void {\bfseries remove\+Child} (\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$pos)\label{class_q_c_p_item_anchor_ab65ec61984575f737f43c2bb59dd0d76}
  27. \end{DoxyCompactItemize}
  28. \subsection*{Protected Attributes}
  29. \begin{DoxyCompactItemize}
  30. \item
  31. \hypertarget{class_q_c_p_item_anchor_a23ad4d0ab0d2cbb41a7baf05bcf996ec}{}Q\+String {\bfseries m\+Name}\label{class_q_c_p_item_anchor_a23ad4d0ab0d2cbb41a7baf05bcf996ec}
  32. \item
  33. \hypertarget{class_q_c_p_item_anchor_a59b968410831ba91a25cc75a77dde6f5}{}\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$ {\bfseries m\+Parent\+Plot}\label{class_q_c_p_item_anchor_a59b968410831ba91a25cc75a77dde6f5}
  34. \item
  35. \hypertarget{class_q_c_p_item_anchor_a80fad480ad3bb980446ed6ebc00818ae}{}\hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item} $\ast$ {\bfseries m\+Parent\+Item}\label{class_q_c_p_item_anchor_a80fad480ad3bb980446ed6ebc00818ae}
  36. \item
  37. \hypertarget{class_q_c_p_item_anchor_a00c62070333e8345976b579676ad3997}{}int {\bfseries m\+Anchor\+Id}\label{class_q_c_p_item_anchor_a00c62070333e8345976b579676ad3997}
  38. \item
  39. \hypertarget{class_q_c_p_item_anchor_a5f0e67f395a63e2dd0e29ff1dcaf37b7}{}Q\+Set$<$ \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$ $>$ {\bfseries m\+Children}\label{class_q_c_p_item_anchor_a5f0e67f395a63e2dd0e29ff1dcaf37b7}
  40. \end{DoxyCompactItemize}
  41. \subsection*{Friends}
  42. \begin{DoxyCompactItemize}
  43. \item
  44. \hypertarget{class_q_c_p_item_anchor_aa9b8ddc062778e202a0be06a57d18d17}{}class {\bfseries Q\+C\+P\+Item\+Position}\label{class_q_c_p_item_anchor_aa9b8ddc062778e202a0be06a57d18d17}
  45. \end{DoxyCompactItemize}
  46. \subsection{Detailed Description}
  47. An anchor of an item to which positions can be attached to.
  48. An item (\hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item}) may have one or more anchors. Unlike \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}, an anchor doesn\textquotesingle{}t control anything on its item, but provides a way to tie other items via their positions to the anchor.
  49. For example, a \hyperlink{class_q_c_p_item_rect}{Q\+C\+P\+Item\+Rect} is defined by its positions {\itshape top\+Left} and {\itshape bottom\+Right}. Additionally it has various anchors like {\itshape top}, {\itshape top\+Right} or {\itshape bottom\+Left} etc. So you can attach the {\itshape start} (which is a \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}) of a \hyperlink{class_q_c_p_item_line}{Q\+C\+P\+Item\+Line} to one of the anchors by calling \hyperlink{class_q_c_p_item_position_ac094d67a95d2dceafa0d50b9db3a7e51}{Q\+C\+P\+Item\+Position\+::set\+Parent\+Anchor} on {\itshape start}, passing the wanted anchor of the \hyperlink{class_q_c_p_item_rect}{Q\+C\+P\+Item\+Rect}. This way the start of the line will now always follow the respective anchor location on the rect item.
  50. Note that \hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} derives from \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}, so every position can also serve as an anchor to other positions.
  51. To learn how to provide anchors in your own item subclasses, see the subclassing section of the \hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item} documentation.
  52. \subsection{Constructor \& Destructor Documentation}
  53. \hypertarget{class_q_c_p_item_anchor_aeb6b681d2bf324db40a915d32ec5624f}{}\index{Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}!Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}}
  54. \index{Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}!Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}}
  55. \subsubsection[{Q\+C\+P\+Item\+Anchor}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Anchor\+::\+Q\+C\+P\+Item\+Anchor (
  56. \begin{DoxyParamCaption}
  57. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot, }
  58. \item[{{\bf Q\+C\+P\+Abstract\+Item} $\ast$}]{parent\+Item, }
  59. \item[{const Q\+String}]{name, }
  60. \item[{int}]{anchor\+Id = {\ttfamily -\/1}}
  61. \end{DoxyParamCaption}
  62. )}\label{class_q_c_p_item_anchor_aeb6b681d2bf324db40a915d32ec5624f}
  63. Creates a new \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}. You shouldn\textquotesingle{}t create \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} instances directly, even if you want to make a new item subclass. Use Q\+C\+P\+Abstract\+Item\+::create\+Anchor instead, as explained in the subclassing section of the \hyperlink{class_q_c_p_abstract_item}{Q\+C\+P\+Abstract\+Item} documentation.
  64. \subsection{Member Function Documentation}
  65. \hypertarget{class_q_c_p_item_anchor_ae92def8f9297c5d73f5806c586517bb3}{}\index{Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}!pixel\+Point@{pixel\+Point}}
  66. \index{pixel\+Point@{pixel\+Point}!Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}}
  67. \subsubsection[{pixel\+Point}]{\setlength{\rightskip}{0pt plus 5cm}Q\+Point\+F Q\+C\+P\+Item\+Anchor\+::pixel\+Point (
  68. \begin{DoxyParamCaption}
  69. {}
  70. \end{DoxyParamCaption}
  71. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_anchor_ae92def8f9297c5d73f5806c586517bb3}
  72. Returns the final absolute pixel position of the \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface.
  73. The pixel information is internally retrieved via Q\+C\+P\+Abstract\+Item\+::anchor\+Pixel\+Position of the parent item, \hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor} is just an intermediary.
  74. Reimplemented in \hyperlink{class_q_c_p_item_position_ae490f9c76ee2ba33752c495d3b6e8fb5}{Q\+C\+P\+Item\+Position}.
  75. \hypertarget{class_q_c_p_item_anchor_ac54b20120669950255a63587193dbb86}{}\index{Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}!to\+Q\+C\+P\+Item\+Position@{to\+Q\+C\+P\+Item\+Position}}
  76. \index{to\+Q\+C\+P\+Item\+Position@{to\+Q\+C\+P\+Item\+Position}!Q\+C\+P\+Item\+Anchor@{Q\+C\+P\+Item\+Anchor}}
  77. \subsubsection[{to\+Q\+C\+P\+Item\+Position}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Q\+C\+P\+Item\+Position} $\ast$ Q\+C\+P\+Item\+Anchor\+::to\+Q\+C\+P\+Item\+Position (
  78. \begin{DoxyParamCaption}
  79. {}
  80. \end{DoxyParamCaption}
  81. )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}\label{class_q_c_p_item_anchor_ac54b20120669950255a63587193dbb86}
  82. 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}).
  83. 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).
  84. Reimplemented in \hyperlink{class_q_c_p_item_position_a577a7efc601df85a20b3e709d1ac320e}{Q\+C\+P\+Item\+Position}.
  85. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  86. \item
  87. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  88. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}