File: qclipboard.html

package info (click to toggle)
qt1g 1%3A1.45-1.1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 17,436 kB
  • ctags: 20,174
  • sloc: cpp: 89,153; yacc: 1,273; ansic: 692; makefile: 479; lex: 326; sh: 150; perl: 94
file content (123 lines) | stat: -rw-r--r-- 6,593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta name="robots" content="noindex,noarchive">
<title>Qt Toolkit - QClipboard Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 15%; text-indent: -15%; }
a:link { text-decoration: none; }
--></style>
</head><body bgcolor="#ffffff">

<a href=index.html><img width=122 height=65 src=qtlogo.jpg alt="Qt logo" align=left border=0></a>
<center><img src=dochead.gif width=472 height=27></center>
<br clear=all>

<h1 align=center>QClipboard Class Reference</h1><br clear="all">
<p>
The QClipboard class provides access to the window system clipboard.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qclipboard-h.html">qclipboard.h</a>&gt;</code>
<p>
Inherits <a href="qobject.html">QObject</a>.
<p><a href="qclipboard-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><span class="fn">void<a href="qclipboard.html#a2"><strong>clear</strong></a>()</span>
<li><span class="fn">void*<a href="qclipboard.html#a3"><strong>data</strong></a>(constchar*format)const</span>
<li><span class="fn">void<a href="qclipboard.html#a4"><strong>setData</strong></a>(constchar*format, void*)</span>
<li><span class="fn">constchar*<a href="qclipboard.html#a5"><strong>text</strong></a>()const</span>
<li><span class="fn">void<a href="qclipboard.html#a6"><strong>setText</strong></a>(constchar*)</span>
<li><span class="fn">QPixmap*<a href="qclipboard.html#a7"><strong>pixmap</strong></a>()const</span>
<li><span class="fn">void<a href="qclipboard.html#a8"><strong>setPixmap</strong></a>(constQPixmap&amp;)</span>
</ul>
<h2>Signals</h2>
<ul>
<li><span class="fn">void<a href="qclipboard.html#a9"><strong>dataChanged</strong></a>()</span>
</ul>
<h2>Protected Members</h2>
<ul>
<li><span class="fn">virtualvoid<a href="qclipboard.html#b1"><strong>connectNotify</strong></a>(constchar*)</span>
<li><span class="fn">virtualbool<a href="qclipboard.html#b2"><strong>event</strong></a>(QEvent*)</span>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QClipboard class provides access to the window system clipboard.
<p>
The clipboard offers a simple mechanism to copy and paste data between
applications.
<p>QClipboard supports these formats (a format is identified by a string):
<ul>
<li>"TEXT", zero-terminated char *.
<li>"PIXMAP" as provided by <a href="qpixmap.html">QPixmap</a>.
</ul>
<p>The "PIXMAP" format is not implemented in this version of Qt.
<p>Only a single QClipboard object may exist in an application. This is
because QClipboard is a shared window system resource. It is not
possible to create a QClipboard object the standard C++ way (the
constructor and destructor are private member functions, but accessible
to <a href="qapplication.html">QApplication</a> since it is a friend class).  Call
<a href="qapplication.html#j1">QApplication::clipboard</a>() to access the clipboard.
<p>Example:
<pre>    <a href="qclipboard.html">QClipboard</a> *cb = QApplication::clipboard();
    const char *text;

    // Copy text from the clipboard (paste)
    text = cb-&gt;<a href="qclipboard.html#a5">text</a>();
    if ( text )
        <a href="qapplication.html#j4">debug</a>( "The clipboard contains: %s", text );

    // Copy text into the clipboard
    cb-&gt;<a href="qclipboard.html#a6">setText</a>( "This text can be pasted by other programs" );
</pre>

<hr><h2>Member Function Documentation</h2>
<h3 class="fn">void<a name="a2"></a>QClipboard::clear()</h3>
<p>Clears the clipboard contents.
<h3 class="fn">void<a name="b1"></a>QClipboard::connectNotify(constchar*) <code>[virtualprotected]</code></h3>
<p>For internal use only.
<p>Reimplemented from <a href="qobject.html#e4">QObject.</a>
<h3 class="fn">void*<a name="a3"></a>QClipboard::data(constchar*format)const</h3>
<p>Returns a pointer to the clipboard data, where <em>format</em> is the clipboard
format.
<p>We recommend that you use <a href="qclipboard.html#a5">text</a>() or <a href="qclipboard.html#a7">pixmap</a>() instead.
<h3 class="fn">void<a name="a9"></a>QClipboard::dataChanged() <code>[signal]</code></h3>
<p>This signal is emitted when the clipboard data is changed.
<h3 class="fn">bool<a name="b2"></a>QClipboard::event(<a href="qevent.html">QEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Handles clipboard events (very platform-specific).
<p>Reimplemented from <a href="qobject.html#a2">QObject.</a>
<h3 class="fn"><a href="qpixmap.html">QPixmap</a>*<a name="a7"></a>QClipboard::pixmap()const</h3>
<p>Returns the clipboard pixmap, or null if the clipboard does not contains
any pixmap.
<p>See also:  <a href="qclipboard.html#a6">setText</a>().
<h3 class="fn">void<a name="a4"></a>QClipboard::setData(constchar*format, void*data)</h3>
<p>Copies text into the clipboard, where <em>format</em> is the clipboard format
string and <em>data</em> is the data to be copied.
<p>We recommend that you use <a href="qclipboard.html#a6">setText</a>() or <a href="qclipboard.html#a8">setPixmap</a>() instead.
<h3 class="fn">void<a name="a8"></a>QClipboard::setPixmap(const<a href="qpixmap.html">QPixmap</a>&amp;pixmap)</h3>
<p>Copies <em>pixmap</em> into the clipboard.
<p>See also:  <a href="qclipboard.html#a7">pixmap</a>().
<h3 class="fn">void<a name="a6"></a>QClipboard::setText(constchar*text)</h3>
<p>Copies <em>text</em> into the clipboard.
<p>See also:  <a href="qclipboard.html#a5">text</a>().
<h3 class="fn">constchar*<a name="a5"></a>QClipboard::text()const</h3>
<p>Returns the clipboard text, or null if the clipboard does not contains
any text.
<p>See also:  <a href="qclipboard.html#a6">setText</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses 
<a href="http://www.troll.no">www.troll.no</a>):<br>
<form method=post action="http://www.troll.no/search.cgi">
<input type=hidden name="version" value="1.44"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-99
<a href="troll.html">Troll Tech</a>, all rights reserved.
<p>
It was generated from the following files:
<ul>
<li>qclipboard.h: 1998/08/21
<li>qclipboard.cpp: 1998/07/03
</ul>
<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  1999 Troll Tech<td><a href="trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 1.45</div>
</table></div></address></body></html>