GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitPrintWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitPrintWidget.cpp 2765 2020-04-16 14:23:18Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "QFitPrintWidget.h"
15 
16 #include <iostream>
17 #include <sstream>
18 
19 #include "TObject.h"
20 
21 QFitPrintWidget::QFitPrintWidget(QWidget *parent, const char* name)
22  : QFitWidget(parent, name)
23 {
24  setupUi(this);
25 }
26 
27 
28 void QFitPrintWidget::SetDrawOption( const QString & option )
29 {
30  fxDrawOption = option;
31 }
32 
34 {
35  if (GetObject()) {
36 
37  std::cout.flush();
38 
39  std::ostringstream strout;
40 
41  std::streambuf* ccc_buffer = std::cout.rdbuf();
42 
43  std::cout.rdbuf(strout.rdbuf());
44 
45  GetObject()->Print(fxDrawOption.toLatin1().constData());
46 
47  std::cout << std::endl;
48 
49  std::cout.flush();
50 
51  std::cout.rdbuf(ccc_buffer);
52 
53  PrintText->setText(strout.str().c_str());
54  }
55 }
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
virtual void SetDrawOption(const QString &option)
virtual void FillSpecificData()
QFitPrintWidget(QWidget *parent=0, const char *name=0)