Widget, displaying log messages. More...
#include <LogWindow.h>

Public Types | |
| enum | { CopyId = 0x01, ClearId = 0x02, SelectAllId = 0x04, SaveToFileId = 0x08, All = CopyId | ClearId | SelectAllId | SaveToFileId } |
Context popup menu actions flags. More... | |
| enum | { DisplayNormal = 0x00, DisplayDate = 0x01, DisplayTime = 0x02, DisplaySeparator = 0x04, DisplayNoColor = 0x08, DisplayDateTime = DisplayDate | DisplayTime } |
Display messages flags. More... | |
Public Member Functions | |
| LogWindow (QWidget *theParent) | |
| Constructor. | |
| virtual | ~LogWindow () |
| Destructor. | |
| virtual QString | popupClientType () const |
| Get popup client symbolic name, used in popup menu management system. | |
| virtual void | contextMenuPopup (QMenu *) |
| Create the context popup menu. | |
| virtual bool | eventFilter (QObject *, QEvent *) |
| Custom event handler. | |
| QString | banner () const |
| Get current banner (message log window header text). | |
| QString | separator () const |
| Get current separator (text which is printed between messages). | |
| void | setBanner (const QString &) |
| Set current banner (message log window header text). | |
| void | setSeparator (const QString &) |
| void | putMessage (const QString &, const int=DisplayNormal) |
| Put new message to the log window. | |
| virtual void | putMessage (const QString &, const QColor &, const int=DisplayNormal) |
| Put new message to the log window. | |
| void | clear (const bool=false) |
| Clear message log. | |
| bool | saveLog (const QString &) |
| Save messages log to the file. | |
| void | setMenuActions (const int) |
| Set actions to be visible in the context popup menu. | |
| int | menuActions () const |
| Get menu actions which are currently visible in the context popup menu. | |
| bool | connectPopupRequest (QObject *reciever, const char *slot) |
| bool | disconnectPopupRequest (QObject *reciever, const char *slot) |
Protected Slots | |
| void | onSaveToFile () |
| Called when user selects "Save To File" command in the popup menu. | |
| void | onSelectAll () |
| Called when user selects "Select all" command in the popup menu. | |
| void | onClear () |
| Called when user click "Clear" command in the popup menu. | |
| void | onCopy () |
| Called when user click "Copy" command in the popup menu. | |
Protected Member Functions | |
| void | contextMenuRequest (QContextMenuEvent *e) |
Private Member Functions | |
| void | createActions () |
| Create context popup menu actions. | |
| void | updateActions () |
| Update menu actions. | |
Private Attributes | |
| QTextEdit * | myView |
| internal view window | |
| QString | myBanner |
| current banner | |
| QStringList | myHistory |
| messages history | |
| QString | mySeparator |
| current separator | |
| int | myBannerSize |
| current banner's size | |
| QMap< int, QAction * > | myActions |
| popup menu actions | |
The log messages window provides operations like:
| anonymous enum |
| anonymous enum |
| LogWindow::LogWindow | ( | QWidget * | parent | ) |
Creates new messages log window widget.
| parent | parent widget |
References clear(), createActions(), DEFAULT_SEPARATOR, main(), myBanner, myBannerSize, mySeparator, myView, SUIT_Session.resourceMgr(), SUIT_Session.session(), SUIT_Tools.stringToFont(), and QtxResourceMgr.stringValue().
| LogWindow::~LogWindow | ( | ) | [virtual] |
Does nothing for the moment.
| QString LogWindow::popupClientType | ( | ) | const [virtual] |
Implements SUIT_PopupClient.
| void LogWindow::contextMenuPopup | ( | QMenu * | popup | ) | [virtual] |
Fill in the popup menu with the commands.
| menu | context popup menu |
Reimplemented from SUIT_PopupClient.
References ClearId, CopyId, myActions, SaveToFileId, SelectAllId, Qtx.simplifySeparators(), and updateActions().
Process context popup menu request event.
| o | object |
| e | event |
References SUIT_PopupClient.contextMenuRequest(), and myView.
| QString LogWindow::banner | ( | ) | const |
References myBanner.
| QString LogWindow::separator | ( | ) | const |
References mySeparator.
| void LogWindow::setBanner | ( | const QString & | banner | ) |
| void LogWindow::setSeparator | ( | const QString & | separator | ) |
Set current separator (text which is printed between messages).
| separator | new separator |
References clear(), mySeparator, and separator().
| void LogWindow::putMessage | ( | const QString & | message, |
| const int | flags = DisplayNormal |
||
| ) |
| message | text of the message |
| flags | ORed flags which define how the message should be printed |
| void LogWindow::putMessage | ( | const QString & | message, |
| const QColor & | color, | ||
| const int | flags = DisplayNormal |
||
| ) | [virtual] |
| message | text of the message |
| color | text color of the message |
| flags | ORed flags which define how the message should be printed |
References DisplayDate, DisplayNoColor, DisplaySeparator, DisplayTime, myHistory, mySeparator, myView, and plainText().
| void LogWindow::clear | ( | const bool | clearHistory = false | ) |
| clearHistory | if True, clear also the messages history |
References myBanner, myBannerSize, myHistory, and myView.
| bool LogWindow::saveLog | ( | const QString & | fileName | ) |
| fileName | name of the file |
true on success and false on error References myHistory.
| void LogWindow::setMenuActions | ( | const int | flags | ) |
Actions, which IDs are set in flags parameter, will be shown in the context popup menu. Other actions will not be shown.
| flags | ORed together actions flags |
References ClearId, CopyId, myActions, SaveToFileId, and SelectAllId.
| int LogWindow::menuActions | ( | ) | const |
References ClearId, CopyId, myActions, TestSalomeApp.ret, SaveToFileId, and SelectAllId.
| void LogWindow::onSaveToFile | ( | ) | [protected, slot] |
| void LogWindow::onSelectAll | ( | ) | [protected, slot] |
References myView.
| void LogWindow::onClear | ( | ) | [protected, slot] |
References clear().
| void LogWindow::onCopy | ( | ) | [protected, slot] |
References myView.
| void LogWindow::createActions | ( | ) | [private] |
References test_table.a, ClearId, CopyId, myActions, onClear(), onCopy(), onSaveToFile(), onSelectAll(), SaveToFileId, and SelectAllId.
| void LogWindow::updateActions | ( | ) | [private] |
Update context popup menu action state.
References ClearId, CopyId, myActions, myBannerSize, myHistory, myView, SaveToFileId, and SelectAllId.
| bool SUIT_PopupClient::connectPopupRequest | ( | QObject * | reciever, |
| const char * | slot | ||
| ) | [inherited] |
Connect popup request.
References SUIT_PopupClient.contextMenuRequest(), and SUIT_PopupClient.mySignal.
| bool SUIT_PopupClient::disconnectPopupRequest | ( | QObject * | reciever, |
| const char * | slot | ||
| ) | [inherited] |
Disconnect popup request.
References SUIT_PopupClient.contextMenuRequest(), and SUIT_PopupClient.mySignal.
| void SUIT_PopupClient::contextMenuRequest | ( | QContextMenuEvent * | e | ) | [protected, inherited] |
Send signal on context menu request.
References SUIT_PopupClient.mySignal, and SUIT_PopupClient.Signal.sendSignal().
QTextEdit* LogWindow.myView [private] |
QString LogWindow.myBanner [private] |
QStringList LogWindow.myHistory [private] |
QString LogWindow.mySeparator [private] |
int LogWindow.myBannerSize [private] |
QMap<int, QAction*> LogWindow.myActions [private] |