#include <CGuiApplicationComp.h>
Definition at line 99 of file CGuiApplicationComp.h.
◆ TrayMessages()
◆ AddMessage()
| virtual void iqtgui::CGuiApplicationComp::TrayMessages::AddMessage |
( |
const MessagePtr & |
messagePtr | ) |
|
|
overridevirtual |
Adds a message to this consumer.
This method transfers ownership of the message to the consumer via shared pointer. The consumer may store, display, forward, or otherwise process the message.
Most implementations deliver messages asynchronously using Qt signals/slots to ensure thread safety when messages are added from worker threads.
- Parameters
-
| messagePtr | Shared pointer to the message. After this call, the message is owned by the shared pointer and will be automatically deleted when no longer referenced. |
- Note
- This method should not throw exceptions. Implementations should handle errors gracefully (e.g., by logging internally or ignoring invalid messages).
- Warning
- The message object should not be modified after being added to a consumer, as multiple consumers may reference the same message object.
- Example
2001,
"File not found: config.xml",
"ConfigLoader"
)
);
consumer->AddMessage(msg);
Basic implementation of the istd::IInformationProvider interface for log messages.
Shared ownership smart pointer for interface types.
- See also
- IsMessageSupported()
Implements ilog::IMessageConsumer.
◆ IsMessageSupported()
| virtual bool iqtgui::CGuiApplicationComp::TrayMessages::IsMessageSupported |
( |
int |
messageCategory = -1, |
|
|
int |
messageId = -1, |
|
|
const istd::IInformationProvider * |
messagePtr = NULL |
|
) |
| const |
|
overridevirtual |
Check if a message is supported by this consumer.
This method allows consumers to filter messages based on category, ID, or the complete message object. It's used to determine whether a message should be sent to this consumer before actually adding it.
- Parameters
-
| messageCategory | Category of message (IC_NONE, IC_INFO, IC_WARNING, IC_ERROR, IC_CRITICAL) or -1 if category check should be skipped. |
- See also
- istd::IInformationProvider::InformationCategory.
- Parameters
-
| messageId | Numeric ID of message or -1 if ID check should be skipped. Message IDs are application-defined for filtering and routing. |
| messagePtr | Optional pointer to complete message object for detailed inspection, or NULL if not needed. The consumer will not store this pointer. |
- Returns
- true if the message is supported and should be sent to this consumer, false if the message should be filtered out.
- Note
- Returning false does not indicate an error; it simply means the message doesn't match the consumer's filter criteria.
- Example
}
if (consumer->IsMessageSupported(-1, 5001)) {
}
if (consumer->IsMessageSupported(-1, -1, &msg)) {
}
Implements ilog::IMessageConsumer.
The documentation for this class was generated from the following file: