qplatformclipboard.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33#include "qplatformclipboard.h"-
34-
35#ifndef QT_NO_CLIPBOARD-
36-
37#include <QtGui/private/qguiapplication_p.h>-
38#include <QtCore/qmimedata.h>-
39-
40QT_BEGIN_NAMESPACE-
41-
42class QClipboardData-
43{-
44public:-
45 QClipboardData();-
46 ~QClipboardData();-
47-
48 void setSource(QMimeData* s)-
49 {-
50 if (s == src)
s == srcDescription
TRUEnever evaluated
FALSEnever evaluated
0
51 return;
never executed: return;
0
52 delete src;-
53 src = s;-
54 }
never executed: end of block
0
55 QMimeData* source()-
56 { return src; }
never executed: return src;
0
57-
58private:-
59 QMimeData* src;-
60};-
61-
62QClipboardData::QClipboardData()-
63{-
64 src = 0;-
65}
never executed: end of block
0
66-
67QClipboardData::~QClipboardData()-
68{-
69 delete src;-
70}
never executed: end of block
0
71-
72Q_GLOBAL_STATIC(QClipboardData,q_clipboardData);
never executed: end of block
never executed: guard.store(QtGlobalStatic::Destroyed);
never executed: return &holder.value;
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
0
73-
74/*!-
75 \class QPlatformClipboard-
76 \since 5.0-
77 \internal-
78 \preliminary-
79 \ingroup qpa-
80-
81 \brief The QPlatformClipboard class provides an abstraction for the system clipboard.-
82 */-
83-
84QPlatformClipboard::~QPlatformClipboard()-
85{-
86-
87}-
88-
89QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode)-
90{-
91 //we know its clipboard-
92 Q_UNUSED(mode);-
93 return q_clipboardData()->source();
never executed: return q_clipboardData()->source();
0
94}-
95-
96void QPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)-
97{-
98 //we know its clipboard-
99 Q_UNUSED(mode);-
100 q_clipboardData()->setSource(data);-
101-
102 emitChanged(mode);-
103}
never executed: end of block
0
104-
105bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const-
106{-
107 return mode == QClipboard::Clipboard;
never executed: return mode == QClipboard::Clipboard;
0
108}-
109-
110bool QPlatformClipboard::ownsMode(QClipboard::Mode mode) const-
111{-
112 Q_UNUSED(mode);-
113 return false;
never executed: return false;
0
114}-
115-
116void QPlatformClipboard::emitChanged(QClipboard::Mode mode)-
117{-
118 if (!QGuiApplicationPrivate::is_app_closing) // QTBUG-39317, prevent emission when closing down.
!QGuiApplicati...is_app_closingDescription
TRUEnever evaluated
FALSEnever evaluated
0
119 QGuiApplication::clipboard()->emitChanged(mode);
never executed: QGuiApplication::clipboard()->emitChanged(mode);
0
120}
never executed: end of block
0
121-
122QT_END_NAMESPACE-
123-
124#endif //QT_NO_CLIPBOARD-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9