Salome HOME
Process multi-selection in pop-up menu
[modules/shaper.git] / src / PyConsole / PyConsole_Event.h
1
2
3 #ifndef PYCONSOLE_EVENT_H
4 #define PYCONSOLE_EVENT_H
5
6 #include "PyConsole.h"
7
8 #include <QEvent>
9 #include <QString>
10
11 /*!
12   \class PrintEvent
13   \brief Python command output backend event.
14   \internal
15 */
16 class PrintEvent : public QEvent
17 {
18 public:
19   static const int EVENT_ID = 65432;
20
21   /*!
22     \brief Constructor
23     \param c message text (python trace)
24     \param isError default to false - if true indicates that an error is being printed.
25   */
26   PrintEvent( const char* c, bool isError = false) :
27     QEvent( (QEvent::Type)EVENT_ID ), myText( c ), errorFlag(isError)
28   {}
29
30   /*!
31     \brief Get message
32     \return message text (python trace)
33   */
34   QString text() const { return myText; }
35
36   /**
37    * @return true if this is an error message
38    */
39   bool isError() const { return errorFlag; }
40
41 protected:
42   QString myText; //!< Event message (python trace)
43
44   /** Set to true if an error msg is to be displayed */
45   bool errorFlag;
46 };
47
48 #endif // PYCONSOLE_EVENT_H