QtDcm: A Qt based C++ library for Dicom communication
Main Page
Classes
Files
File List
File Members
src
qtdcm
example
main.cpp
Go to the documentation of this file.
1
8
#include <QApplication>
9
#include <QtGui>
10
#include "
dicom.h
"
11
#include <
QtDcmManager.h
>
12
13
#define NO_COLOR "\x1b[0m"
14
#define DEBUG_COLOR "\033[33m"
15
#define INFO_COLOR "\033[36m"
16
#define WARNING_COLOR "\033[33m"
17
#define CRITICAL_COLOR "\033[31;1m"
18
#define MESSAGE_COLOR "\033[0m"
19
20
int
main
(
int
argc ,
char
*argv[] )
21
{
22
QString messagePattern = QString(
"%1[%{time yyyyMMdd h:mm:ss.zzz}] "
23
"%{if-debug}%2DEB %{endif}%{if-info}%3%{endif}%{if-warning}%4WAR %{endif}%{if-critical}%5CRIT%{endif} %1"
24
"%3 %{file}:%{line} %6 %{message} %1"
)
25
.arg(
NO_COLOR
)
26
.arg(
DEBUG_COLOR
)
27
.arg(
INFO_COLOR
)
28
.arg(
WARNING_COLOR
)
29
.arg(
CRITICAL_COLOR
)
30
.arg(
MESSAGE_COLOR
);
31
32
qSetMessagePattern(messagePattern);
33
QApplication app(argc, argv);
34
35
Dicom
dcm;
36
dcm.setWindowIcon(QIcon(
":Images/dicom.xpm"
));
37
dcm.show();
38
39
int
ret = app.exec();
40
QtDcmManager::destroy
();
41
42
return
ret;
43
}
DEBUG_COLOR
#define DEBUG_COLOR
Definition:
main.cpp:14
CRITICAL_COLOR
#define CRITICAL_COLOR
Definition:
main.cpp:17
Dicom
Definition:
dicom.h:15
QtDcmManager.h
NO_COLOR
#define NO_COLOR
Definition:
main.cpp:13
dicom.h
Main class for the example application.
INFO_COLOR
#define INFO_COLOR
Definition:
main.cpp:15
MESSAGE_COLOR
#define MESSAGE_COLOR
Definition:
main.cpp:18
QtDcmManager::destroy
static void destroy()
Definition:
QtDcmManager.cpp:125
main
int main(int argc, char *argv[])
Definition:
main.cpp:20
WARNING_COLOR
#define WARNING_COLOR
Definition:
main.cpp:16