As for 2), you can have a list of your own structures, for example:
typedef enum{
CLICK_LEFT = 0,
CLICK_RIGHT = 1
} MyClickType;
typedef struct{
ClickType type;
} MyMouseClick;
typedef QList<MyMouseClick> MyMouseClickList;
typedef enum{
CLICK_LEFT = 0,
CLICK_RIGHT = 1
} MyClickType;
typedef struct{
ClickType type;
QPoint pos;
} MyMouseClick;
typedef QList<MyMouseClick> MyMouseClickList;
To copy to clipboard, switch view to plain text mode
On each grabbed click, push back new structure filled with correct data to the list:
// somehow you've grabbed the click
MyClickType type = CLICK_RIGHT;
//... store it in list
MyMouseClickList clickList;
//...
MyMouseClick c;
c.type = type;
c.pos = clickPos;
clickList.push_back( c );
// somehow you've grabbed the click
QPoint pos = clickPos;
MyClickType type = CLICK_RIGHT;
//... store it in list
MyMouseClickList clickList;
//...
MyMouseClick c;
c.type = type;
c.pos = clickPos;
clickList.push_back( c );
To copy to clipboard, switch view to plain text mode
Clicks will be in the correct order this way (first grabbed click will be first in list).
Later you can use for example foreach() macro to loop through the list:
foreach( const MyMouseClick& c, clickList ){
doSomething(c);
}
foreach( const MyMouseClick& c, clickList ){
doSomething(c);
}
To copy to clipboard, switch view to plain text mode
You can introduce a class instead of POD-like struct, but it's up to your preferences.
Bookmarks