\hypertarget{class_q_c_p_legend}{}\section{Q\+C\+P\+Legend Class Reference} \label{class_q_c_p_legend}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} Manages a legend inside a \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}. Inheritance diagram for Q\+C\+P\+Legend\+:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=6.000000cm]{class_q_c_p_legend} \end{center} \end{figure} \subsection*{Public Types} \begin{DoxyCompactItemize} \item enum \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part} \{ \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7}{sp\+None} = 0x000, \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4}{sp\+Legend\+Box} = 0x001, \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items} = 0x002 \} \end{DoxyCompactItemize} \subsection*{Signals} \begin{DoxyCompactItemize} \item void \hyperlink{class_q_c_p_legend_a286149b644d5f5c884a0140219d979f6}{selection\+Changed} (Q\+C\+P\+Legend\+::\+Selectable\+Parts selection) \end{DoxyCompactItemize} \subsection*{Public Member Functions} \begin{DoxyCompactItemize} \item \hyperlink{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72}{Q\+C\+P\+Legend} () \item \hypertarget{class_q_c_p_legend_a8ffd92df86ddf43696d95f04a20e3226}{}Q\+Pen {\bfseries border\+Pen} () const \label{class_q_c_p_legend_a8ffd92df86ddf43696d95f04a20e3226} \item \hypertarget{class_q_c_p_legend_a7e5d2766e7d724f399022be8a4e8a2cb}{}Q\+Brush {\bfseries brush} () const \label{class_q_c_p_legend_a7e5d2766e7d724f399022be8a4e8a2cb} \item \hypertarget{class_q_c_p_legend_a5cf8b840bc02f7bf4edb8dde400d0f41}{}Q\+Font {\bfseries font} () const \label{class_q_c_p_legend_a5cf8b840bc02f7bf4edb8dde400d0f41} \item \hypertarget{class_q_c_p_legend_ad60a058af7491f6b140c104c6a0f9458}{}Q\+Color {\bfseries text\+Color} () const \label{class_q_c_p_legend_ad60a058af7491f6b140c104c6a0f9458} \item \hypertarget{class_q_c_p_legend_a27dfb770b14adc0e8811bef8129780a5}{}Q\+Size {\bfseries icon\+Size} () const \label{class_q_c_p_legend_a27dfb770b14adc0e8811bef8129780a5} \item \hypertarget{class_q_c_p_legend_a9d6d07042a284c4ba5f9e3cb5c9281ef}{}int {\bfseries icon\+Text\+Padding} () const \label{class_q_c_p_legend_a9d6d07042a284c4ba5f9e3cb5c9281ef} \item \hypertarget{class_q_c_p_legend_a2c4719d79630b0d0c75ef2333c59a912}{}Q\+Pen {\bfseries icon\+Border\+Pen} () const \label{class_q_c_p_legend_a2c4719d79630b0d0c75ef2333c59a912} \item \hypertarget{class_q_c_p_legend_aa90c7fdbad7a0e93527bafb1f1f49a43}{}Selectable\+Parts {\bfseries selectable\+Parts} () const \label{class_q_c_p_legend_aa90c7fdbad7a0e93527bafb1f1f49a43} \item \hypertarget{class_q_c_p_legend_abbbf1b2d6a149013527ed87b0780894a}{}Selectable\+Parts {\bfseries selected\+Parts} () const \label{class_q_c_p_legend_abbbf1b2d6a149013527ed87b0780894a} \item \hypertarget{class_q_c_p_legend_a63156bc4ce64431bada7415cfa2b4dd1}{}Q\+Pen {\bfseries selected\+Border\+Pen} () const \label{class_q_c_p_legend_a63156bc4ce64431bada7415cfa2b4dd1} \item \hypertarget{class_q_c_p_legend_a165630cad7e41f89b54f65cdef3310e8}{}Q\+Pen {\bfseries selected\+Icon\+Border\+Pen} () const \label{class_q_c_p_legend_a165630cad7e41f89b54f65cdef3310e8} \item \hypertarget{class_q_c_p_legend_a600dde0d207ddc6f5a603767360cceac}{}Q\+Brush {\bfseries selected\+Brush} () const \label{class_q_c_p_legend_a600dde0d207ddc6f5a603767360cceac} \item \hypertarget{class_q_c_p_legend_a4c1b08fc0afacb4ffd54f6a49737fa77}{}Q\+Font {\bfseries selected\+Font} () const \label{class_q_c_p_legend_a4c1b08fc0afacb4ffd54f6a49737fa77} \item \hypertarget{class_q_c_p_legend_a08005f3c17728c2c4e23b8ffc0842ffb}{}Q\+Color {\bfseries selected\+Text\+Color} () const \label{class_q_c_p_legend_a08005f3c17728c2c4e23b8ffc0842ffb} \item void \hyperlink{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}{set\+Border\+Pen} (const Q\+Pen \&pen) \item void \hyperlink{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}{set\+Brush} (const Q\+Brush \&brush) \item void \hyperlink{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}{set\+Font} (const Q\+Font \&font) \item void \hyperlink{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}{set\+Text\+Color} (const Q\+Color \&color) \item void \hyperlink{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984}{set\+Icon\+Size} (const Q\+Size \&size) \item void \hyperlink{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2}{set\+Icon\+Size} (int width, int height) \item void \hyperlink{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6}{set\+Icon\+Text\+Padding} (int padding) \item void \hyperlink{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8}{set\+Icon\+Border\+Pen} (const Q\+Pen \&pen) \item void \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts} (const Selectable\+Parts \&selectable\+Parts) \item void \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts} (const Selectable\+Parts \&selected\+Parts) \item void \hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen} (const Q\+Pen \&pen) \item void \hyperlink{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}{set\+Selected\+Icon\+Border\+Pen} (const Q\+Pen \&pen) \item void \hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush} (const Q\+Brush \&brush) \item void \hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font} (const Q\+Font \&font) \item void \hyperlink{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc}{set\+Selected\+Text\+Color} (const Q\+Color \&color) \item virtual double \hyperlink{class_q_c_p_legend_aa3892801051bc7b985e003576df844db}{select\+Test} (const Q\+Point\+F \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const \item \hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item} $\ast$ \hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item} (int index) const \item \hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item} $\ast$ \hyperlink{class_q_c_p_legend_a5ee80cf83f65e3b6dd386942ee3cc1ee}{item\+With\+Plottable} (const \hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable} $\ast$plottable) const \item int \hyperlink{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{item\+Count} () const \item bool \hyperlink{class_q_c_p_legend_a380dd19eb631592e1ebb9b24cc5b398a}{has\+Item} (\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item} $\ast$\hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item}) const \item bool \hyperlink{class_q_c_p_legend_a2eb1d24bdf5658e64962a656303fd61a}{has\+Item\+With\+Plottable} (const \hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable} $\ast$plottable) const \item bool \hyperlink{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}{add\+Item} (\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item} $\ast$\hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item}) \item bool \hyperlink{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}{remove\+Item} (int index) \item bool \hyperlink{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082}{remove\+Item} (\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item} $\ast$\hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item}) \item void \hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items} () \item Q\+List$<$ \hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item} $\ast$ $>$ \hyperlink{class_q_c_p_legend_ac93eaf236e911d67aa8b88942ef45c5e}{selected\+Items} () const \end{DoxyCompactItemize} \subsection*{Protected Member Functions} \begin{DoxyCompactItemize} \item \hypertarget{class_q_c_p_legend_a4d552c63d82742d77fb7f177bae7b1ba}{}virtual void {\bfseries parent\+Plot\+Initialized} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)\label{class_q_c_p_legend_a4d552c63d82742d77fb7f177bae7b1ba} \item \hypertarget{class_q_c_p_legend_a7a9795a28c9c2514b4ae50f0a63d407c}{}virtual \hyperlink{namespace_q_c_p_a2ad6bb6281c7c2d593d4277b44c2b037}{Q\+C\+P\+::\+Interaction} {\bfseries selection\+Category} () const \label{class_q_c_p_legend_a7a9795a28c9c2514b4ae50f0a63d407c} \item \hypertarget{class_q_c_p_legend_a26307f532c3458b379663b7d517a5f47}{}virtual void {\bfseries apply\+Default\+Antialiasing\+Hint} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter) const \label{class_q_c_p_legend_a26307f532c3458b379663b7d517a5f47} \item \hypertarget{class_q_c_p_legend_a4462151bf875ca85fa3815457c683fdc}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_legend_a4462151bf875ca85fa3815457c683fdc} \item \hypertarget{class_q_c_p_legend_af93bf87dc5c383a9d2ada80b35f3a1a5}{}virtual void {\bfseries select\+Event} (Q\+Mouse\+Event $\ast$event, bool additive, const Q\+Variant \&details, bool $\ast$selection\+State\+Changed)\label{class_q_c_p_legend_af93bf87dc5c383a9d2ada80b35f3a1a5} \item \hypertarget{class_q_c_p_legend_a5208ead4331c9b0440f768f059777c58}{}virtual void {\bfseries deselect\+Event} (bool $\ast$selection\+State\+Changed)\label{class_q_c_p_legend_a5208ead4331c9b0440f768f059777c58} \item \hypertarget{class_q_c_p_legend_a60172c9d2212584f38f5d0c1e50970c7}{}Q\+Pen {\bfseries get\+Border\+Pen} () const \label{class_q_c_p_legend_a60172c9d2212584f38f5d0c1e50970c7} \item \hypertarget{class_q_c_p_legend_a236fe4cd617c9f88620fd9de74417f20}{}Q\+Brush {\bfseries get\+Brush} () const \label{class_q_c_p_legend_a236fe4cd617c9f88620fd9de74417f20} \end{DoxyCompactItemize} \subsection*{Protected Attributes} \begin{DoxyCompactItemize} \item \hypertarget{class_q_c_p_legend_a52ab8342a382456131d567f962d7f9d0}{}Q\+Pen {\bfseries m\+Border\+Pen}\label{class_q_c_p_legend_a52ab8342a382456131d567f962d7f9d0} \item \hypertarget{class_q_c_p_legend_a773ae518c3149fcabff4a2906fdacbc4}{}Q\+Pen {\bfseries m\+Icon\+Border\+Pen}\label{class_q_c_p_legend_a773ae518c3149fcabff4a2906fdacbc4} \item \hypertarget{class_q_c_p_legend_a9bd7cd05a9a485e06eda513a348baf80}{}Q\+Brush {\bfseries m\+Brush}\label{class_q_c_p_legend_a9bd7cd05a9a485e06eda513a348baf80} \item \hypertarget{class_q_c_p_legend_a56ffacb184a99eefe09a0c7181d0713d}{}Q\+Font {\bfseries m\+Font}\label{class_q_c_p_legend_a56ffacb184a99eefe09a0c7181d0713d} \item \hypertarget{class_q_c_p_legend_a478b2d809a7390e9ff8f8bb70d6bd9fe}{}Q\+Color {\bfseries m\+Text\+Color}\label{class_q_c_p_legend_a478b2d809a7390e9ff8f8bb70d6bd9fe} \item \hypertarget{class_q_c_p_legend_a39b972aae6c6a3fa5aa73313ab7a5765}{}Q\+Size {\bfseries m\+Icon\+Size}\label{class_q_c_p_legend_a39b972aae6c6a3fa5aa73313ab7a5765} \item \hypertarget{class_q_c_p_legend_a8abf8843864ee9afc3f54f906c062240}{}int {\bfseries m\+Icon\+Text\+Padding}\label{class_q_c_p_legend_a8abf8843864ee9afc3f54f906c062240} \item \hypertarget{class_q_c_p_legend_a917a34dd2856baafd8d56852d94d00e2}{}Selectable\+Parts {\bfseries m\+Selected\+Parts}\label{class_q_c_p_legend_a917a34dd2856baafd8d56852d94d00e2} \item \hypertarget{class_q_c_p_legend_a179b4d5c1bea723b76e402ff48f0d7fb}{}Selectable\+Parts {\bfseries m\+Selectable\+Parts}\label{class_q_c_p_legend_a179b4d5c1bea723b76e402ff48f0d7fb} \item \hypertarget{class_q_c_p_legend_a62906c996906ae23e9f724b6ac1f7334}{}Q\+Pen {\bfseries m\+Selected\+Border\+Pen}\label{class_q_c_p_legend_a62906c996906ae23e9f724b6ac1f7334} \item \hypertarget{class_q_c_p_legend_a7429ac0e64c7b90b649b4d8f4cc5fa55}{}Q\+Pen {\bfseries m\+Selected\+Icon\+Border\+Pen}\label{class_q_c_p_legend_a7429ac0e64c7b90b649b4d8f4cc5fa55} \item \hypertarget{class_q_c_p_legend_ab3c7567c86d4784b1e48f76a84b3a1e2}{}Q\+Brush {\bfseries m\+Selected\+Brush}\label{class_q_c_p_legend_ab3c7567c86d4784b1e48f76a84b3a1e2} \item \hypertarget{class_q_c_p_legend_a86ce8f6c20a2f51a48eaf3c24ce16805}{}Q\+Font {\bfseries m\+Selected\+Font}\label{class_q_c_p_legend_a86ce8f6c20a2f51a48eaf3c24ce16805} \item \hypertarget{class_q_c_p_legend_a6c25c8796c6e73e983aae6024965f2be}{}Q\+Color {\bfseries m\+Selected\+Text\+Color}\label{class_q_c_p_legend_a6c25c8796c6e73e983aae6024965f2be} \end{DoxyCompactItemize} \subsection*{Friends} \begin{DoxyCompactItemize} \item \hypertarget{class_q_c_p_legend_a1cdf9df76adcfae45261690aa0ca2198}{}class {\bfseries Q\+Custom\+Plot}\label{class_q_c_p_legend_a1cdf9df76adcfae45261690aa0ca2198} \item \hypertarget{class_q_c_p_legend_a8a375e31e42c68de049fcf0fd35db5b0}{}class {\bfseries Q\+C\+P\+Abstract\+Legend\+Item}\label{class_q_c_p_legend_a8a375e31e42c68de049fcf0fd35db5b0} \end{DoxyCompactItemize} \subsection{Detailed Description} Manages a legend inside a \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}. A legend is a small box somewhere in the plot which lists plottables with their name and icon. Normally, the legend is populated by calling \hyperlink{class_q_c_p_abstract_plottable_a70f8cabfd808f7d5204b9f18c45c13f5}{Q\+C\+P\+Abstract\+Plottable\+::add\+To\+Legend}. The respective legend item can be removed with \hyperlink{class_q_c_p_abstract_plottable_aa1f350e510326d012b9a9c9249736c83}{Q\+C\+P\+Abstract\+Plottable\+::remove\+From\+Legend}. However, \hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend} also offers an interface to add and manipulate legend items directly\+: \hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item}, \hyperlink{class_q_c_p_legend_a5ee80cf83f65e3b6dd386942ee3cc1ee}{item\+With\+Plottable}, \hyperlink{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{item\+Count}, \hyperlink{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}{add\+Item}, \hyperlink{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}{remove\+Item}, etc. The \hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend} derives from \hyperlink{class_q_c_p_layout_grid}{Q\+C\+P\+Layout\+Grid} and as such can be placed in any position a \hyperlink{class_q_c_p_layout_element}{Q\+C\+P\+Layout\+Element} may be positioned. The legend items are themselves Q\+C\+P\+Layout\+Elements which are placed in the grid layout of the legend. \hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend} only adds an interface specialized for handling child elements of type \hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}, as mentioned above. In principle, any other layout elements may also be added to a legend via the normal \hyperlink{class_q_c_p_layout_grid}{Q\+C\+P\+Layout\+Grid} interface. However, the Q\+C\+P\+Abstract\+Legend\+Item-\/\+Interface will ignore those elements (e.\+g. \hyperlink{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{item\+Count} will only return the number of items with Q\+C\+P\+Abstract\+Legend\+Items type). By default, every \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} has one legend (Q\+Custom\+Plot\+::legend) which is placed in the inset layout of the main axis rect (\hyperlink{class_q_c_p_axis_rect_a4114887c7141b59650b7488f930993e5}{Q\+C\+P\+Axis\+Rect\+::inset\+Layout}). To move the legend to another position inside the axis rect, use the methods of the \hyperlink{class_q_c_p_layout_inset}{Q\+C\+P\+Layout\+Inset}. To move the legend outside of the axis rect, place it anywhere else with the Q\+C\+P\+Layout/\+Q\+C\+P\+Layout\+Element interface. \subsection{Member Enumeration Documentation} \hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Selectable\+Part@{Selectable\+Part}} \index{Selectable\+Part@{Selectable\+Part}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{Selectable\+Part}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Q\+C\+P\+Legend\+::\+Selectable\+Part}}\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1} Defines the selectable parts of a legend \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts} \end{DoxySeeAlso} \begin{Desc} \item[Enumerator]\par \begin{description} \index{sp\+None@{sp\+None}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+None@{sp\+None}}\item[{\em \hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7}{}sp\+None\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7} }]{\ttfamily 0x000} None \index{sp\+Legend\+Box@{sp\+Legend\+Box}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+Legend\+Box@{sp\+Legend\+Box}}\item[{\em \hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4}{}sp\+Legend\+Box\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4} }]{\ttfamily 0x001} The legend box (frame) \index{sp\+Items@{sp\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+Items@{sp\+Items}}\item[{\em \hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{}sp\+Items\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7} }]{\ttfamily 0x002} Legend items individually (see \hyperlink{class_q_c_p_legend_ac93eaf236e911d67aa8b88942ef45c5e}{selected\+Items}) \end{description} \end{Desc} \subsection{Constructor \& Destructor Documentation} \hypertarget{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{Q\+C\+P\+Legend}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Legend\+::\+Q\+C\+P\+Legend ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [explicit]}}\label{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72} Constructs a new \hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend} instance with {\itshape parent\+Plot} as the containing plot and default values. Note that by default, \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} already contains a legend ready to be used as Q\+Custom\+Plot\+::legend \subsection{Member Function Documentation} \hypertarget{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!add\+Item@{add\+Item}} \index{add\+Item@{add\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{add\+Item}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Legend\+::add\+Item ( \begin{DoxyParamCaption} \item[{{\bf Q\+C\+P\+Abstract\+Legend\+Item} $\ast$}]{item} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f} Adds {\itshape item} to the legend, if it\textquotesingle{}s not present already. Returns true on sucess, i.\+e. if the item wasn\textquotesingle{}t in the list already and has been successfuly added. The legend takes ownership of the item. \hypertarget{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!clear\+Items@{clear\+Items}} \index{clear\+Items@{clear\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{clear\+Items}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::clear\+Items ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb} Removes all items from the legend. \hypertarget{class_q_c_p_legend_a380dd19eb631592e1ebb9b24cc5b398a}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!has\+Item@{has\+Item}} \index{has\+Item@{has\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{has\+Item}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Legend\+::has\+Item ( \begin{DoxyParamCaption} \item[{{\bf Q\+C\+P\+Abstract\+Legend\+Item} $\ast$}]{item} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_a380dd19eb631592e1ebb9b24cc5b398a} Returns whether the legend contains {\itshape itm}. \hypertarget{class_q_c_p_legend_a2eb1d24bdf5658e64962a656303fd61a}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!has\+Item\+With\+Plottable@{has\+Item\+With\+Plottable}} \index{has\+Item\+With\+Plottable@{has\+Item\+With\+Plottable}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{has\+Item\+With\+Plottable}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Legend\+::has\+Item\+With\+Plottable ( \begin{DoxyParamCaption} \item[{const {\bf Q\+C\+P\+Abstract\+Plottable} $\ast$}]{plottable} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_a2eb1d24bdf5658e64962a656303fd61a} Returns whether the legend contains a \hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item} which is associated with {\itshape plottable} (e.\+g. a \hyperlink{class_q_c_p_graph}{Q\+C\+P\+Graph}$\ast$). If such an item isn\textquotesingle{}t in the legend, returns false. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a5ee80cf83f65e3b6dd386942ee3cc1ee}{item\+With\+Plottable} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item@{item}} \index{item@{item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{item}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Q\+C\+P\+Abstract\+Legend\+Item} $\ast$ Q\+C\+P\+Legend\+::item ( \begin{DoxyParamCaption} \item[{int}]{index} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_a454272d7094437beb3278a2294006da5} Returns the item with index {\itshape i}. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{item\+Count} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item\+Count@{item\+Count}} \index{item\+Count@{item\+Count}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{item\+Count}]{\setlength{\rightskip}{0pt plus 5cm}int Q\+C\+P\+Legend\+::item\+Count ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404} Returns the number of items currently in the legend. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a454272d7094437beb3278a2294006da5}{item} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a5ee80cf83f65e3b6dd386942ee3cc1ee}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item\+With\+Plottable@{item\+With\+Plottable}} \index{item\+With\+Plottable@{item\+With\+Plottable}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{item\+With\+Plottable}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Q\+C\+P\+Plottable\+Legend\+Item} $\ast$ Q\+C\+P\+Legend\+::item\+With\+Plottable ( \begin{DoxyParamCaption} \item[{const {\bf Q\+C\+P\+Abstract\+Plottable} $\ast$}]{plottable} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_a5ee80cf83f65e3b6dd386942ee3cc1ee} Returns the \hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item} which is associated with {\itshape plottable} (e.\+g. a \hyperlink{class_q_c_p_graph}{Q\+C\+P\+Graph}$\ast$). If such an item isn\textquotesingle{}t in the legend, returns 0. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2eb1d24bdf5658e64962a656303fd61a}{has\+Item\+With\+Plottable} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!remove\+Item@{remove\+Item}} \index{remove\+Item@{remove\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{remove\+Item}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Legend\+::remove\+Item ( \begin{DoxyParamCaption} \item[{int}]{index} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb} Removes the item with index {\itshape index} from the legend. Returns true, if successful. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a198228e9cdc78d3a3c306fa6763d0404}{item\+Count}, \hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!remove\+Item@{remove\+Item}} \index{remove\+Item@{remove\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{remove\+Item}]{\setlength{\rightskip}{0pt plus 5cm}bool Q\+C\+P\+Legend\+::remove\+Item ( \begin{DoxyParamCaption} \item[{{\bf Q\+C\+P\+Abstract\+Legend\+Item} $\ast$}]{item} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082} This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Removes {\itshape item} from the legend. Returns true, if successful. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_ac93eaf236e911d67aa8b88942ef45c5e}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!selected\+Items@{selected\+Items}} \index{selected\+Items@{selected\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{selected\+Items}]{\setlength{\rightskip}{0pt plus 5cm}Q\+List$<$ {\bf Q\+C\+P\+Abstract\+Legend\+Item} $\ast$ $>$ Q\+C\+P\+Legend\+::selected\+Items ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} ) const}\label{class_q_c_p_legend_ac93eaf236e911d67aa8b88942ef45c5e} Returns the legend items that are currently selected. If no items are selected, the list is empty. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_abstract_legend_item_a6eed93b0ab99cb3eabb043fb08179c2b}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected}, set\+Selectable \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a286149b644d5f5c884a0140219d979f6}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!selection\+Changed@{selection\+Changed}} \index{selection\+Changed@{selection\+Changed}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{selection\+Changed}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::selection\+Changed ( \begin{DoxyParamCaption} \item[{Q\+C\+P\+Legend\+::\+Selectable\+Parts}]{selection} \end{DoxyParamCaption} )\hspace{0.3cm}{\ttfamily [signal]}}\label{class_q_c_p_legend_a286149b644d5f5c884a0140219d979f6} This signal is emitted when the selection state of this legend has changed. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_aa3892801051bc7b985e003576df844db}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!select\+Test@{select\+Test}} \index{select\+Test@{select\+Test}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Legend\+::select\+Test ( \begin{DoxyParamCaption} \item[{const Q\+Point\+F \&}]{pos, } \item[{bool}]{only\+Selectable, } \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}} \end{DoxyParamCaption} ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_legend_aa3892801051bc7b985e003576df844db} Layout elements are sensitive to events inside their outer rect. If {\itshape pos} is within the outer rect, this method returns a value corresponding to 0.\+99 times the parent plot\textquotesingle{}s selection tolerance. However, layout elements are not selectable by default. So if {\itshape only\+Selectable} is true, -\/1.\+0 is returned. See \hyperlink{class_q_c_p_layerable_a4001c4d0dfec55598efa4d531f2179a9}{Q\+C\+P\+Layerable\+::select\+Test} for a general explanation of this virtual method. \hyperlink{class_q_c_p_layout_element}{Q\+C\+P\+Layout\+Element} subclasses may reimplement this method to provide more specific selection test behaviour. Reimplemented from \hyperlink{class_q_c_p_layout_element_a9fcf5d0ea19f2c23b2b528bce2c6f095}{Q\+C\+P\+Layout\+Element}. \hypertarget{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Border\+Pen@{set\+Border\+Pen}} \index{set\+Border\+Pen@{set\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Border\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Border\+Pen ( \begin{DoxyParamCaption} \item[{const Q\+Pen \&}]{pen} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f} Sets the pen, the border of the entire legend is drawn with. \hypertarget{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Brush@{set\+Brush}} \index{set\+Brush@{set\+Brush}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Brush}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Brush ( \begin{DoxyParamCaption} \item[{const Q\+Brush \&}]{brush} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23} Sets the brush of the legend background. \hypertarget{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Font@{set\+Font}} \index{set\+Font@{set\+Font}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Font}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Font ( \begin{DoxyParamCaption} \item[{const Q\+Font \&}]{font} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73} Sets the default font of legend text. Legend items that draw text (e.\+g. the name of a graph) will use this font by default. However, a different font can be specified on a per-\/item-\/basis by accessing the specific legend item. This function will also set {\itshape font} on all already existing legend items. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_abstract_legend_item_a409c53455d8112f71d70c0c43eb10265}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Font} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Border\+Pen@{set\+Icon\+Border\+Pen}} \index{set\+Icon\+Border\+Pen@{set\+Icon\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Icon\+Border\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Icon\+Border\+Pen ( \begin{DoxyParamCaption} \item[{const Q\+Pen \&}]{pen} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8} Sets the pen used to draw a border around each legend icon. Legend items that draw an icon (e.\+g. a visual representation of the graph) will use this pen by default. If no border is wanted, set this to {\itshape Qt\+::\+No\+Pen}. \hypertarget{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Size@{set\+Icon\+Size}} \index{set\+Icon\+Size@{set\+Icon\+Size}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Icon\+Size}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Icon\+Size ( \begin{DoxyParamCaption} \item[{const Q\+Size \&}]{size} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984} Sets the size of legend icons. Legend items that draw an icon (e.\+g. a visual representation of the graph) will use this size by default. \hypertarget{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Size@{set\+Icon\+Size}} \index{set\+Icon\+Size@{set\+Icon\+Size}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Icon\+Size}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Icon\+Size ( \begin{DoxyParamCaption} \item[{int}]{width, } \item[{int}]{height} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2} This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. \hypertarget{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Text\+Padding@{set\+Icon\+Text\+Padding}} \index{set\+Icon\+Text\+Padding@{set\+Icon\+Text\+Padding}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Icon\+Text\+Padding}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Icon\+Text\+Padding ( \begin{DoxyParamCaption} \item[{int}]{padding} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6} Sets the horizontal space in pixels between the legend icon and the text next to it. Legend items that draw an icon (e.\+g. a visual representation of the graph) and text (e.\+g. the name of the graph) will use this space by default. \hypertarget{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selectable\+Parts@{set\+Selectable\+Parts}} \index{set\+Selectable\+Parts@{set\+Selectable\+Parts}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selectable\+Parts}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selectable\+Parts ( \begin{DoxyParamCaption} \item[{const Selectable\+Parts \&}]{selectable} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110} Sets whether the user can (de-\/)select the parts in {\itshape selectable} by clicking on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. (When \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions} contains i\+Select\+Legend.) However, even when {\itshape selectable} is set to a value not allowing the selection of a specific part, it is still possible to set the selection of this part manually, by calling \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts} directly. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}, \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Border\+Pen@{set\+Selected\+Border\+Pen}} \index{set\+Selected\+Border\+Pen@{set\+Selected\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Border\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Border\+Pen ( \begin{DoxyParamCaption} \item[{const Q\+Pen \&}]{pen} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88} When the legend box is selected, this pen is used to draw the border instead of the normal pen set via \hyperlink{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}{set\+Border\+Pen}. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}, \hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Brush@{set\+Selected\+Brush}} \index{set\+Selected\+Brush@{set\+Selected\+Brush}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Brush}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Brush ( \begin{DoxyParamCaption} \item[{const Q\+Brush \&}]{brush} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd} When the legend box is selected, this brush is used to draw the legend background instead of the normal brush set via \hyperlink{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}{set\+Brush}. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}, \hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Font@{set\+Selected\+Font}} \index{set\+Selected\+Font@{set\+Selected\+Font}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Font}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Font ( \begin{DoxyParamCaption} \item[{const Q\+Font \&}]{font} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2} Sets the default font that is used by legend items when they are selected. This function will also set {\itshape font} on all already existing legend items. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}{set\+Font}, \hyperlink{class_q_c_p_abstract_legend_item_a91db5aee48617a9d3206e61376807365}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected\+Font} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Icon\+Border\+Pen@{set\+Selected\+Icon\+Border\+Pen}} \index{set\+Selected\+Icon\+Border\+Pen@{set\+Selected\+Icon\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Icon\+Border\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Icon\+Border\+Pen ( \begin{DoxyParamCaption} \item[{const Q\+Pen \&}]{pen} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027} Sets the pen legend items will use to draw their icon borders, when they are selected. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}, \hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Parts@{set\+Selected\+Parts}} \index{set\+Selected\+Parts@{set\+Selected\+Parts}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Parts}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Parts ( \begin{DoxyParamCaption} \item[{const Selectable\+Parts \&}]{selected} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8} Sets the selected state of the respective legend parts described by \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}. When a part is selected, it uses a different pen/font and brush. If some legend items are selected and {\itshape selected} doesn\textquotesingle{}t contain \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items}, those items become deselected. The entire selection mechanism is handled automatically when \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions} contains i\+Select\+Legend. You only need to call this function when you wish to change the selection state manually. This function can change the selection state of a part even when \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts} was set to a value that actually excludes the part. emits the \hyperlink{class_q_c_p_legend_a286149b644d5f5c884a0140219d979f6}{selection\+Changed} signal when {\itshape selected} is different from the previous selection state. Note that it doesn\textquotesingle{}t make sense to set the selected state \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items} here when it wasn\textquotesingle{}t set before, because there\textquotesingle{}s no way to specify which exact items to newly select. Do this by calling \hyperlink{class_q_c_p_abstract_legend_item_a6eed93b0ab99cb3eabb043fb08179c2b}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected} directly on the legend item you wish to select. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}, \hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}, \hyperlink{class_q_c_p_legend_aa3892801051bc7b985e003576df844db}{select\+Test}, \hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen}, \hyperlink{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}{set\+Selected\+Icon\+Border\+Pen}, \hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush}, \hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Text\+Color@{set\+Selected\+Text\+Color}} \index{set\+Selected\+Text\+Color@{set\+Selected\+Text\+Color}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Selected\+Text\+Color}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Selected\+Text\+Color ( \begin{DoxyParamCaption} \item[{const Q\+Color \&}]{color} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc} Sets the default text color that is used by legend items when they are selected. This function will also set {\itshape color} on all already existing legend items. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}{set\+Text\+Color}, \hyperlink{class_q_c_p_abstract_legend_item_a4d01d008ee1a5bfe9905b0397a421936}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected\+Text\+Color} \end{DoxySeeAlso} \hypertarget{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}{}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Text\+Color@{set\+Text\+Color}} \index{set\+Text\+Color@{set\+Text\+Color}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}} \subsubsection[{set\+Text\+Color}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Legend\+::set\+Text\+Color ( \begin{DoxyParamCaption} \item[{const Q\+Color \&}]{color} \end{DoxyParamCaption} )}\label{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6} Sets the default color of legend text. Legend items that draw text (e.\+g. the name of a graph) will use this color by default. However, a different colors can be specified on a per-\/item-\/basis by accessing the specific legend item. This function will also set {\itshape color} on all already existing legend items. \begin{DoxySeeAlso}{See also} \hyperlink{class_q_c_p_abstract_legend_item_a6ebace6aaffaedcdab2d74e88acc2d1e}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Text\+Color} \end{DoxySeeAlso} The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize} \item \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}