mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 16:05:55 +02:00
(Qt): process Clipboard change event
git-svn-id: trunk@11643 -
This commit is contained in:
parent
af0cbd09af
commit
02fbc366d2
@ -335,6 +335,8 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
|
||||||
|
|
||||||
function Clipboard: QClipboardH; inline;
|
function Clipboard: QClipboardH; inline;
|
||||||
|
|
||||||
function getMimeData(AMode: QClipboardMode): QMimeDataH;
|
function getMimeData(AMode: QClipboardMode): QMimeDataH;
|
||||||
@ -1846,14 +1848,31 @@ begin
|
|||||||
FClipBoardFormats := TStringList.Create;
|
FClipBoardFormats := TStringList.Create;
|
||||||
FClipBoardFormats.Add('foo'); // 0 is reserved
|
FClipBoardFormats.Add('foo'); // 0 is reserved
|
||||||
TheObject := QApplication_clipBoard;
|
TheObject := QApplication_clipBoard;
|
||||||
|
AttachEvents;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TQtClipboard.Destroy;
|
destructor TQtClipboard.Destroy;
|
||||||
begin
|
begin
|
||||||
|
DetachEvents;
|
||||||
FClipBoardFormats.Free;
|
FClipBoardFormats.Free;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtClipboard.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
if QEvent_type(Event) = QEventClipboard then
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
|
||||||
|
QEvent_accept(Event);
|
||||||
|
|
||||||
|
// Clipboard is changed, but we have no ability at moment to pass that info
|
||||||
|
// to LCL since LCL has no support for that event
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TQtClipboard.Clipboard: QClipboardH;
|
function TQtClipboard.Clipboard: QClipboardH;
|
||||||
begin
|
begin
|
||||||
Result := QClipboardH(TheObject);
|
Result := QClipboardH(TheObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user