- PyQt - QPixmap Class
- PyQt - QClipboard
- PyQt - BrushStyle Constants
- PyQt - Drawing API
- PyQt - Database Handling
- PyQt - Drag and Drop
- PyQt - Multiple Document Interface
- PyQt - QMessageBox
- PyQt - QDialog Class
- PyQt - Basic Widgets
- PyQt - Layout Management
- PyQt - Signals and Slots
- PyQt - Using Qt Designer
- PyQt - Major Classes
- PyQt - Hello World
- PyQt - Introduction
- PyQt - Home
PyQt Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
PyQt - QCppboard
The QCppboard class provides access to system-wide cppboard that offers a simple mechanism to copy and paste data between apppcations. Its action is similar to QDrag class and uses similar data types.
QApppcation class has a static method cppboard() which returns reference to cppboard object. Any type of MimeData can be copied to or pasted from the cppboard.
Following are the cppboard class methods that are commonly used −
Sr.No. | Methods & Description |
---|---|
1 |
clear() Clears cppboard contents |
2 |
setImage() Copies QImage into cppboard |
3 |
setMimeData() Sets MIME data into cppboard |
4 |
setPixmap() Copies Pixmap object in cppboard |
5 |
setText() Copies QString in cppboard |
6 |
text() Retrieves text from cppboard |
Signal associated with cppboard object is −
Sr.No. | Method & Description |
---|---|
1 |
dataChanged() Whenever cppboard data changes |
Example
In the following example, two TextEdit objects and two Pushbuttons are added to a top level window.
To begin with the cppboard object is instantiated. Copy() method of textedit object copies the data onto the system cppboard. When the Paste button is cpcked, it fetches the cppboard data and pastes it in other textedit object.
Advertisements