SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
extension
qt
qtEmittingStringBuffer.h
1
//=========================================================================
2
// Copyright (c) Kitware, Inc.
3
// All rights reserved.
4
// See LICENSE.txt for details.
5
//
6
// This software is distributed WITHOUT ANY WARRANTY; without even
7
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8
// PURPOSE. See the above copyright notice for more information.
9
//=========================================================================
10
// .NAME qtEmittingLogger - a std::stream that emits its output upon flush
11
// .SECTION Description
12
// .SECTION See Also
13
// qtItem
14
15
#ifndef smtk_extension_qtEmittingStringBuffer_h
16
#define smtk_extension_qtEmittingStringBuffer_h
17
18
#include "smtk/extension/qt/Exports.h"
19
#include "
smtk/io/Logger.h
"
20
21
#include <QObject>
22
23
#include <sstream>
24
25
namespace
smtk
26
{
27
namespace
extension
28
{
29
39
class
SMTKQTEXT_EXPORT
qtEmittingStringBuffer
40
:
public
QObject
41
,
public
std::stringbuf
42
{
43
Q_OBJECT
44
45
public
:
46
qtEmittingStringBuffer
() =
default
;
47
48
~
qtEmittingStringBuffer
()
override
{ sync(); }
49
50
protected
:
51
int
sync()
override
52
{
53
Q_EMIT flush();
54
str(
""
);
55
return
0;
56
}
57
58
Q_SIGNALS:
59
void
flush();
60
};
61
}
// namespace extension
62
}
// namespace smtk
63
64
#endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
Logger.h
smtk::extension::qtEmittingStringBuffer
An std::stringbuf that emits when it is updated.
Definition:
qtEmittingStringBuffer.h:39
Generated by
1.8.17