⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qclipboard.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QClipboard 3qt "21 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQClipboard \- Access to the window system clipboard.SH SYNOPSIS\fC#include <qclipboard.h>\fR.PPInherits QObject..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBMode\fR { Clipboard, Selection }".br.ti -1c.BI "void \fBclear\fR ( Mode mode )".br.ti -1c.BI "void \fBclear\fR ()".br.ti -1c.BI "bool \fBsupportsSelection\fR () const".br.ti -1c.BI "bool \fBownsSelection\fR () const".br.ti -1c.BI "bool \fBownsClipboard\fR () const".br.ti -1c.BI "void setSelectionMode ( bool enable )  \fI(obsolete)\fR".br.ti -1c.BI "bool selectionModeEnabled () const  \fI(obsolete)\fR".br.ti -1c.BI "QString \fBtext\fR ( Mode mode ) const".br.ti -1c.BI "QString \fBtext\fR ( QCString & subtype, Mode mode ) const".br.ti -1c.BI "void \fBsetText\fR ( const QString & text, Mode mode )".br.ti -1c.BI "QMimeSource * \fBdata\fR ( Mode mode ) const".br.ti -1c.BI "void \fBsetData\fR ( QMimeSource * src, Mode mode )".br.ti -1c.BI "QImage \fBimage\fR ( Mode mode ) const".br.ti -1c.BI "QPixmap \fBpixmap\fR ( Mode mode ) const".br.ti -1c.BI "void \fBsetImage\fR ( const QImage & image, Mode mode )".br.ti -1c.BI "void \fBsetPixmap\fR ( const QPixmap & pixmap, Mode mode )".br.ti -1c.BI "QString \fBtext\fR () const".br.ti -1c.BI "QString \fBtext\fR ( QCString & subtype ) const".br.ti -1c.BI "void \fBsetText\fR ( const QString & text )".br.ti -1c.BI "QMimeSource * \fBdata\fR () const".br.ti -1c.BI "void \fBsetData\fR ( QMimeSource * src )".br.ti -1c.BI "QImage \fBimage\fR () const".br.ti -1c.BI "QPixmap \fBpixmap\fR () const".br.ti -1c.BI "void \fBsetImage\fR ( const QImage & image )".br.ti -1c.BI "void \fBsetPixmap\fR ( const QPixmap & pixmap )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBselectionChanged\fR ()".br.ti -1c.BI "void \fBdataChanged\fR ()".br.in -1c.SH DESCRIPTIONThe QClipboard class provides access to the window system clipboard..PPThe clipboard offers a simple mechanism to copy and paste data between applications..PPQClipboard supports the same data types that QDragObject does, and uses similar mechanisms. For advanced clipboard usage read the drag-and-drop documentation..PPThere is a single QClipboard object in an application, and you can access it using QApplication::clipboard()..PPExample:.PP.nf.br    QClipboard *cb = QApplication::clipboard();.br.br    // Copy text from the clipboard (paste).br    QString text = cb->text(QClipboard::Clipboard);.br    if ( !text.isNull() ).br        qDebug( "The clipboard contains: " + text );.br.br    // Copy text into the clipboard.br    cb->setText( "This text can be pasted by other programs",.br                 QClipboard::Clipboard );.br.fi.PPQClipboard features some convenience functions to access common data types: setText() allows the exchange of Unicode text and setPixmap() and setImage() allows the exchange of QPixmaps and QImages between applications. The setData() function is the ultimate in flexibility: it allows you to add any QMimeSource into the clipboard. There are corresponding getters for each of these, e.g. text(), image() and pixmap()..PPYou can clear the clipboard by calling clear()..SH "Platform Specific Information"<h4> X11 </h4>.IP.TPThe X11 Window System has the concept of a separate selection and clipboard. When text is selected, it is immediately available as the global mouse selection. The global mouse selection may later be copied to the clipboard. By convention, the middle mouse button is used to paste the global mouse selection..IP.TPX11 also has the concept of ownership; if you change the selection within a window, X11 will only notify the owner and the previous owner of the change, i.e. it will not notify all applications that the selection or clipboard data changed..IP.TPLastly, the X11 clipboard is event driven, i.e. the clipboard will not function properly if the event loop is not running. Similarly, it is recommended that the contents of the clipboard are stored or retrieved in direct response to user-input events, e.g. mouse button or key presses and releases. You should not store or retrieve the clipboard contents in response to timer or non-user-input events..IP.PP<h4> Windows </h4>.IP.TPMicrosoft Windows does not support the global mouse selection; it only supports the global clipboard, e.g. Windows only adds text to the clipboard when an explicit copy or cut is made..IP.TPWindows does not have the concept of ownership; the clipboard is a fully global resource so all applications are notified of changes..IP.PPSee the multiclip example in the \fIQt Designer\fR examples directory for an example of a multiplatform clipboard application that also demonstrates selection handling..PPSee also Environment Classes and Input/Output and Networking..SS "Member Type Documentation".SH "QClipboard::Mode".PPThis enum type is used to control which part of the system clipboard is used by QClipboard::data(), QClipboard::setData() and related functions..TP\fCQClipboard::Clipboard\fR - indicates that data should be stored and retrieved from the global clipboard..TP\fCQClipboard::Selection\fR - indicates that data should be stored and retrieved from the global mouse selection..PP\fINote\fR: Support for Selection is provided only on systems with a global mouse selection (e.g. X11)..PPSee also QClipboard::supportsSelection().

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -