Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include <qlayout.h>
20 #include <qtextedit.h>
21 
22 QmitkCopyToClipBoardDialog::QmitkCopyToClipBoardDialog(const QString &text, QWidget *parent, const char * /*name*/)
23  : QDialog(parent)
24 {
25  QBoxLayout *layout = new QVBoxLayout(this);
27  // QTextEdit* textedit = new QTextEdit(text, "", this);
28  //#changed to:
29  auto textedit = new QTextEdit(this);
30  // with setPlainText() line breaks are displayed correctly
31  textedit->setPlainText(text);
33  textedit->setReadOnly(true);
34  layout->addWidget(textedit);
35 
36  QDialog::resize(500, 400);
37 }
38 
40 {
41 }
QmitkCopyToClipBoardDialog(const QString &text, QWidget *parent=nullptr, const char *name=nullptr)