#import <qnsview.h>
Definition at line 49 of file qnsview.h.
◆ drawRect:()
- (void) drawRect: |
|
(NSRect) |
dirtyRect |
|
Definition at line 104 of file qnsview.mm.
109 CGRect dirtyCGRect = NSRectToCGRect(dirtyRect);
111 NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext currentContext];
114 CGContextSaveGState( cgContext );
115 int dy = dirtyCGRect.origin.y + CGRectGetMaxY(dirtyCGRect);
116 CGContextTranslateCTM(cgContext, 0, dy);
117 CGContextScaleCTM(cgContext, 1, -1);
120 CGContextDrawImage(cgContext,dirtyCGRect,subImage);
122 CGContextRestoreGState(cgContext);
124 CGImageRelease(subImage);
struct CGImage * CGImageRef
struct CGContext * CGContextRef
◆ handleMouseEvent:()
- (void) handleMouseEvent: |
|
(NSEvent *) |
theEvent |
|
Definition at line 133 of file qnsview.mm.
133 :(NSEvent *)theEvent;
135 NSPoint point = [
self convertPoint: [theEvent locationInWindow] fromView: nil];
136 QPoint qt_localPoint(point.x,point.y);
138 NSTimeInterval timestamp = [theEvent timestamp];
139 ulong qt_timestamp = timestamp * 1000;
static void handleMouseEvent(QWidget *w, const QPoint &local, const QPoint &global, Qt::MouseButtons b)
tlw == 0 means that ev is in global coords only
Qt::MouseButtons m_buttons
The QPoint class defines a point in the plane using integer precision.
◆ init()
◆ initWithWidget:()
- (id) initWithWidget: |
|
(QWidget *) |
widget |
|
Definition at line 61 of file qnsview.mm.
QPointer< QWidget > widget
◆ isFlipped()
◆ mouseDown:()
- (void) mouseDown: |
|
(NSEvent *) |
theEvent |
|
Definition at line 144 of file qnsview.mm.
147 [
self handleMouseEvent:theEvent];
Qt::MouseButtons m_buttons
◆ mouseDragged:()
- (void) mouseDragged: |
|
(NSEvent *) |
theEvent |
|
Definition at line 149 of file qnsview.mm.
152 qWarning(
"Internal Mousebutton tracking invalid(missing Qt::LeftButton");
153 [
self handleMouseEvent:theEvent];
Q_CORE_EXPORT void qWarning(const char *,...)
Qt::MouseButtons m_buttons
◆ mouseEntered:()
- (void) mouseEntered: |
|
(NSEvent *) |
theEvent |
|
Definition at line 166 of file qnsview.mm.
static void handleEnterEvent(QWidget *w)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
◆ mouseExited:()
- (void) mouseExited: |
|
(NSEvent *) |
theEvent |
|
Definition at line 171 of file qnsview.mm.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static void handleLeaveEvent(QWidget *w)
◆ mouseMoved:()
- (void) mouseMoved: |
|
(NSEvent *) |
theEvent |
|
Definition at line 161 of file qnsview.mm.
164 [
self handleMouseEvent:theEvent];
Q_CORE_EXPORT void qDebug(const char *,...)
◆ mouseUp:()
- (void) mouseUp: |
|
(NSEvent *) |
theEvent |
|
Definition at line 155 of file qnsview.mm.
158 [
self handleMouseEvent:theEvent];
The QFlag class is a helper data type for QFlags.
Qt::MouseButtons m_buttons
◆ otherMouseDown:()
- (void) otherMouseDown: |
|
(NSEvent *) |
theEvent |
|
Definition at line 192 of file qnsview.mm.
195 [
self handleMouseEvent:theEvent];
Qt::MouseButtons m_buttons
◆ otherMouseDragged:()
- (void) otherMouseDragged: |
|
(NSEvent *) |
theEvent |
|
Definition at line 197 of file qnsview.mm.
200 qWarning(
"Internal Mousebutton tracking invalid(missing Qt::LeftButton");
201 [
self handleMouseEvent:theEvent];
Q_CORE_EXPORT void qWarning(const char *,...)
Qt::MouseButtons m_buttons
◆ otherMouseUp:()
- (void) otherMouseUp: |
|
(NSEvent *) |
theEvent |
|
Definition at line 203 of file qnsview.mm.
206 [
self handleMouseEvent:theEvent];
The QFlag class is a helper data type for QFlags.
Qt::MouseButtons m_buttons
◆ rightMouseDown:()
- (void) rightMouseDown: |
|
(NSEvent *) |
theEvent |
|
Definition at line 176 of file qnsview.mm.
179 [
self handleMouseEvent:theEvent];
Qt::MouseButtons m_buttons
◆ rightMouseDragged:()
- (void) rightMouseDragged: |
|
(NSEvent *) |
theEvent |
|
Definition at line 181 of file qnsview.mm.
184 qWarning(
"Internal Mousebutton tracking invalid(missing Qt::LeftButton");
185 [
self handleMouseEvent:theEvent];
Q_CORE_EXPORT void qWarning(const char *,...)
Qt::MouseButtons m_buttons
◆ rightMouseUp:()
- (void) rightMouseUp: |
|
(NSEvent *) |
theEvent |
|
Definition at line 187 of file qnsview.mm.
190 [
self handleMouseEvent:theEvent];
The QFlag class is a helper data type for QFlags.
Qt::MouseButtons m_buttons
◆ setImage:()
- (void) setImage: |
|
(QImage *) |
image |
|
Definition at line 69 of file qnsview.mm.
74 int bitDepth = image->
depth();
75 int colorBufferSize = 8;
77 int width = image->
width();
78 int height = image->
height();
82 CGDataProviderRef cgDataProviderRef = CGDataProviderCreateWithData(
98 kCGRenderingIntentDefault);
100 CGColorSpaceRelease(cgColourSpaceRef);
int byteCount() const
Returns the number of bytes occupied by the image data.
int bytesPerLine() const
Returns the number of bytes per image scanline.
The QImage class provides a hardware-independent image representation that allows direct access to th...
int depth() const
Returns the depth of the image.
uchar * bits()
Returns a pointer to the first pixel data.
int width() const
Returns the width of the image.
struct CGColorSpace * CGColorSpaceRef
int height() const
Returns the height of the image.
◆ m_buttons
- (MouseButtons) QNSView: |
|
protected |
◆ m_cgImage
◆ m_widget
The documentation for this class was generated from the following files: