Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkCopyToClipBoardDialog.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include <qlayout.h>
16 #include <qtextedit.h>
17 
18 QmitkCopyToClipBoardDialog::QmitkCopyToClipBoardDialog(const QString &text, QWidget *parent, const char * /*name*/)
19  : QDialog(parent)
20 {
21  QBoxLayout *layout = new QVBoxLayout(this);
23  // QTextEdit* textedit = new QTextEdit(text, "", this);
24  //#changed to:
25  auto textedit = new QTextEdit(this);
26  // with setPlainText() line breaks are displayed correctly
27  textedit->setPlainText(text);
29  textedit->setReadOnly(true);
30  layout->addWidget(textedit);
31 
32  QDialog::resize(500, 400);
33 }
34 
36 {
37 }
QmitkCopyToClipBoardDialog(const QString &text, QWidget *parent=nullptr, const char *name=nullptr)