Class QfClipboardManager
ClassList > QfClipboardManager
#include <qfclipboardmanager.h>
Inherits the following classes: QObject
Public Properties
| Type | Name |
|---|---|
| property bool | holdsFeature |
Public Signals
| Type | Name |
|---|---|
| signal void | holdsFeatureChanged |
Public Functions
| Type | Name |
|---|---|
| QfClipboardManager (QObject * parent=nullptr) |
|
| Q_INVOKABLE void | copyFeatureToClipboard (const QgsFeature & feature, bool includeGeometry=false) |
| Q_INVOKABLE void | copyFeatureToClipboard (QgsVectorLayer * layer, QgsFeatureId fid, bool includeGeometry=false, bool isCutOperation=false) |
| bool | holdsFeature () const |
| Q_INVOKABLE QgsFeature | pasteFeatureFromClipboard () |
| Q_INVOKABLE bool | pasteFeatureFromClipboardIntoLayer (QgsVectorLayer * layer) |
| ~QfClipboardManager () = default |
Detailed Description
This class handles clipboard operations.
Public Properties Documentation
property holdsFeature [1/2]
bool QfClipboardManager::holdsFeature;
Public Signals Documentation
signal holdsFeatureChanged
void QfClipboardManager::holdsFeatureChanged;
Public Functions Documentation
function QfClipboardManager
explicit QfClipboardManager::QfClipboardManager (
QObject * parent=nullptr
)
function copyFeatureToClipboard [1/2]
Q_INVOKABLE void QfClipboardManager::copyFeatureToClipboard (
const QgsFeature & feature,
bool includeGeometry=false
)
Copies a feature into the system's clipboard in both plain text as well as HTML.
Parameters:
featurethe feature from which the attributes will be copied into memoryincludeGeometryset to TRUE when a WKT string representation of the geometry should be included
function copyFeatureToClipboard [2/2]
Q_INVOKABLE void QfClipboardManager::copyFeatureToClipboard (
QgsVectorLayer * layer,
QgsFeatureId fid,
bool includeGeometry=false,
bool isCutOperation=false
)
Copies a feature into the system's clipboard in both plain text as well as HTML.
Parameters:
layerthe vector layer associated to the featurefidthe id of the featureincludeGeometryset to TRUE when a WKT string representation of the geometry should be includedisCutOperationset to TRUE if this is a cut operation. In that case, when pasting into a different layer, the feature will be deleted from the original layer.
function holdsFeature [2/2]
inline bool QfClipboardManager::holdsFeature () const
function pasteFeatureFromClipboard
Q_INVOKABLE QgsFeature QfClipboardManager::pasteFeatureFromClipboard ()
Returns a feature with attributes and geometry matching clipboard values when a feature has been copied into the clipboard.
function pasteFeatureFromClipboardIntoLayer
Q_INVOKABLE bool QfClipboardManager::pasteFeatureFromClipboardIntoLayer (
QgsVectorLayer * layer
)
Pastes the copied feature from the clipboard into the given editable layer. The feature is made compatible with the layer before being inserted. If the feature was previously cut and the destination layer differs from the source, the feature will be deleted from the original layer after paste.
Parameters:
layerdestination vector layer
Returns:
TRUE if insertion was successful
function ~QfClipboardManager
QfClipboardManager::~QfClipboardManager () = default
The documentation for this class was generated from the following file src/app/qfclipboardmanager.h