42 #import <private/qcocoaview_mac_p.h> 43 #ifdef QT_MAC_USE_COCOA 45 #include <private/qwidget_p.h> 46 #include <private/qt_mac_p.h> 47 #include <private/qapplication_p.h> 48 #include <private/qabstractscrollarea_p.h> 49 #include <private/qt_cocoa_helpers_mac_p.h> 50 #include <private/qdnd_p.h> 51 #include <private/qmacinputcontext_p.h> 52 #include <private/qevent_p.h> 53 #include <private/qbackingstore_p.h> 54 #include <private/qwindowsurface_raster_p.h> 55 #include <private/qunifiedtoolbarsurface_mac_p.h> 62 #include <QAccessible> 68 @interface NSEvent (Qt_Compile_Leopard_DeviceDelta)
79 @interface NSEvent (Qt_Compile_Leopard_Gestures)
94 extern bool qt_mac_clearDirtyOnWidgetInsideDrawWidget;
96 static QColor colorFrom(NSColor *color)
99 NSString *colorSpace = [color colorSpaceName];
100 if (colorSpace == NSDeviceCMYKColorSpace) {
102 [color getCyan:&cyan magenta:&magenta yellow:&yellow black:&black alpha:&alpha];
103 qtColor.
setCmykF(cyan, magenta, yellow, black, alpha);
106 tmpColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];
108 [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha];
109 qtColor.
setRgbF(red, green, blue, alpha);
137 extern NSString *NSTextInputReplacementRangeAttributeName;
142 static int qCocoaViewCount = 0;
145 @implementation QT_MANGLE_NAMESPACE(QCocoaView)
151 [
self finishInitWithQWidget:widget widgetPrivate:widgetprivate];
153 [
self setFocusRingType:NSFocusRingTypeNone];
158 qDebug() <<
"Alien: create native view for" << widget <<
". qCocoaViewCount is:" << qCocoaViewCount;
162 sendKeyEvents =
true;
163 fromKeyDownEvent =
false;
166 [
self setHidden:YES];
173 qwidgetprivate = widgetprivate;
174 [[NSNotificationCenter defaultCenter] addObserver:self
175 selector:@selector(frameDidChange:)
176 name:@"NSViewFrameDidChangeNotification"
183 delete composingText;
184 [[NSNotificationCenter defaultCenter] removeObserver:self];
188 qDebug() <<
"Alien: widget deallocated. qCocoaViewCount is:" << qCocoaViewCount;
197 return [
super isOpaque];
198 return qwidgetprivate->isOpaque;
210 - (BOOL) preservesContentDuringLiveResize
215 - (void) setFrameSize:(NSSize)newSize
217 [
super setFrameSize:newSize];
220 if ([
self inLiveResize]) {
223 [
self getRectsExposedDuringLiveResize:rects count:&count];
226 [
self setNeedsDisplayInRect:rects[count]];
229 [
self setNeedsDisplay:YES];
233 if (qwidgetprivate && qwidgetprivate->isGLWidget && [
self window]) {
234 qwidgetprivate->needWindowChange =
true;
246 - (void)setNeedsDisplay:(BOOL)flag {
248 [
super setNeedsDisplay:flag];
252 - (void)drawRect:(NSRect)aRect
270 if (!qwidgetprivate->isInUnifiedToolbar) {
280 if (!qwidget->isWindow()) {
286 if (!winSurface || !winSurface->needsFlush) {
293 for (
int i = 0; i < rects.
size(); ++i) {
294 const QRect &rect = rects.
at(i);
295 CGContextAddRect(context, CGRectMake(rect.
x(), rect.
y(), rect.
width(), rect.
height()));
297 CGContextClip(context);
299 QRect r = winSurface->regionToFlush.boundingRect();
304 winSurface->needsFlush =
false;
305 winSurface->regionToFlush =
QRegion();
309 QUnifiedToolbarSurface *unifiedSurface = qwidgetprivate->unifiedSurface;
310 if (!unifiedSurface) {
315 int areaX = qwidgetprivate->toolbar_offset.x();
316 int areaY = qwidgetprivate->toolbar_offset.y();
317 int areaWidth = qwidget->geometry().width();
318 int areaHeight = qwidget->geometry().height();
319 const CGRect area = CGRectMake(areaX, areaY, areaWidth, areaHeight);
320 const CGRect drawingArea = CGRectMake(0, 0, areaWidth, areaHeight);
324 qwidgetprivate->flushRequested =
false;
328 CGContextSynchronize(context);
341 if (qwidget->isWindow()) {
342 qwidget->update(qwidget->rect());
343 qwidgetprivate->syncBackingStore(qwidget->rect());
348 qwidgetprivate->hd = context;
350 if (qwidget->isVisible() && qwidget->updatesEnabled()) {
352 qWarning(
"QWidget::repaint: Recursive repaint detected");
354 const QRect qrect =
QRect(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
359 [
self getRectsBeingDrawn:&rects count:&count];
360 for (
int i = 0; i < count; ++i) {
361 QRect tmpRect =
QRect(rects[i].origin.x, rects[i].origin.y, rects[i].size.width, rects[i].size.height);
366 const QRegion &parentMask = qwidget->window()->mask();
368 const QPoint mappedPoint = qwidget->mapTo(qwidget->window(), qrect.
topLeft());
371 qrgn.
translate(-mappedPoint.
x(), -mappedPoint.y());
375 QPoint redirectionOffset(0, 0);
381 if (qwidgetprivate->extra && qwidgetprivate->extra->hasMask) {
382 CGRect widgetRect = CGRectMake(0, 0, qwidget->width(), qwidget->height());
383 CGContextTranslateCTM (context, 0, widgetRect.size.height);
384 CGContextScaleCTM(context, 1, -1);
385 if (qwidget->isWindow())
386 CGContextClearRect(context, widgetRect);
387 CGContextClipToMask(context, widgetRect, qwidgetprivate->extra->imageMask);
388 CGContextScaleCTM(context, 1, -1);
389 CGContextTranslateCTM (context, 0, -widgetRect.size.height);
392 if (qwidget->isWindow() && !qwidgetprivate->isOpaque
394 CGContextClearRect(context, NSRectToCGRect(aRect));
407 if (qwidget->isWindow())
411 qt_mac_clearDirtyOnWidgetInsideDrawWidget =
true;
413 qt_mac_clearDirtyOnWidgetInsideDrawWidget =
false;
415 if (!redirectionOffset.isNull())
421 qWarning(
"QWidget: It is dangerous to leave painters active on a" 422 " widget outside of the PaintEvent");
424 qwidgetprivate->hd = 0;
428 - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
433 if (!widgetToGetMouse)
439 - (NSView *)hitTest:(
NSPoint)aPoint
442 return [
super hitTest:aPoint];
446 return [
super hitTest:aPoint];
449 - (void)updateTrackingAreas
455 if (NSIsEmptyRect([
self visibleRect]))
459 if (NSArray *trackingArray = [
self trackingAreas]) {
460 NSUInteger size = [trackingArray count];
461 for (NSUInteger i = 0; i < size; ++i) {
462 NSTrackingArea *t = [trackingArray objectAtIndex:i];
463 [
self removeTrackingArea:t];
473 NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp
474 | NSTrackingInVisibleRect | NSTrackingMouseMoved;
475 NSTrackingArea *ta = [[NSTrackingArea alloc] initWithRect:NSMakeRect(0, 0,
478 options:trackingOptions
481 [
self addTrackingArea:ta];
485 - (void)mouseEntered:(NSEvent *)event
490 NSEvent *nsmoveEvent = [NSEvent
491 mouseEventWithType:NSMouseMoved
492 location:[[
self window] mouseLocationOutsideOfEventStream]
493 modifierFlags: [event modifierFlags]
494 timestamp: [event timestamp]
495 windowNumber: [event windowNumber]
496 context: [event context]
497 eventNumber: [event eventNumber]
508 - (void)mouseExited:(NSEvent *)event
525 if (widgetUnderMouse == 0) {
527 qt_last_mouse_receiver = 0;
528 qt_last_native_mouse_receiver = 0;
533 - (void)flagsChanged:(NSEvent *)theEvent
535 QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
540 [
super flagsChanged:theEvent];
543 - (void)mouseMoved:(NSEvent *)theEvent
553 - (void)mouseDown:(NSEvent *)theEvent
561 - (void)mouseUp:(NSEvent *)theEvent
566 - (void)rightMouseDown:(NSEvent *)theEvent
571 - (void)rightMouseUp:(NSEvent *)theEvent
576 - (void)otherMouseDown:(NSEvent *)theEvent
582 - (void)otherMouseUp:(NSEvent *)theEvent
588 - (void)mouseDragged:(NSEvent *)theEvent
593 - (void)rightMouseDragged:(NSEvent *)theEvent
598 - (void)otherMouseDragged:(NSEvent *)theEvent
603 - (void)scrollWheel:(NSEvent *)theEvent
606 NSInputManager *currentIManager = [NSInputManager currentInputManager];
607 if (currentIManager && [currentIManager wantsToHandleMouseEvents]) {
608 [currentIManager handleMouseEvent:theEvent];
617 if (!widgetToGetMouse)
624 const UInt32 carbonEventKind = carbonEvent ? ::GetEventKind(carbonEvent) : 0;
633 const int pixelsToDegrees = 2;
636 deltaX = [theEvent deviceDeltaX] * pixelsToDegrees;
637 deltaY = [theEvent deviceDeltaY] * pixelsToDegrees;
640 deltaX = [theEvent scrollingDeltaX] * pixelsToDegrees;
641 deltaY = [theEvent scrollingDeltaY] * pixelsToDegrees;
646 deltaX =
qBound(-120,
int([theEvent deltaX] * 10000), 120);
647 deltaY =
qBound(-120,
int([theEvent deltaY] * 10000), 120);
650 #ifndef QT_NO_WHEELEVENT 653 if (deltaX != 0 && deltaY != 0)
666 if (deltaX != 0 && deltaY != 0)
668 #endif //QT_NO_WHEELEVENT 671 - (void)tabletProximity:(NSEvent *)tabletEvent
676 - (void)tabletPoint:(NSEvent *)tabletEvent
679 [
super tabletPoint:tabletEvent];
682 - (void)magnifyWithEvent:(NSEvent *)event
685 QWidget *widgetToGetGesture = 0;
687 if (!widgetToGetGesture)
692 #ifndef QT_NO_GESTURES 695 NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
699 #endif // QT_NO_GESTURES 702 - (void)rotateWithEvent:(NSEvent *)event
705 QWidget *widgetToGetGesture = 0;
707 if (!widgetToGetGesture)
712 #ifndef QT_NO_GESTURES 715 NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
719 #endif // QT_NO_GESTURES 722 - (void)swipeWithEvent:(NSEvent *)event
725 QWidget *widgetToGetGesture = 0;
727 if (!widgetToGetGesture)
732 #ifndef QT_NO_GESTURES 735 NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
737 if ([event deltaX] == 1)
738 qNGEvent.
angle = 180.0f;
739 else if ([event deltaX] == -1)
740 qNGEvent.
angle = 0.0f;
741 else if ([event deltaY] == 1)
742 qNGEvent.
angle = 90.0f;
743 else if ([event deltaY] == -1)
744 qNGEvent.
angle = 270.0f;
746 #endif // QT_NO_GESTURES 749 - (void)beginGestureWithEvent:(NSEvent *)event
752 QWidget *widgetToGetGesture = 0;
754 if (!widgetToGetGesture)
759 #ifndef QT_NO_GESTURES 762 NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
765 #endif // QT_NO_GESTURES 768 - (void)endGestureWithEvent:(NSEvent *)event
771 QWidget *widgetToGetGesture = 0;
773 if (!widgetToGetGesture)
778 #ifndef QT_NO_GESTURES 781 NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
785 #endif // QT_NO_GESTURES 787 - (void)frameDidChange:(NSNotification *)note
792 if (qwidget->isWindow())
794 NSRect newFrame = [
self frame];
795 QRect newGeo(newFrame.origin.x, newFrame.origin.y, newFrame.size.width, newFrame.size.height);
798 qwidget->setGeometry(newGeo);
801 qwidgetprivate->syncCocoaMask();
807 return [
super isEnabled];
808 return [
super isEnabled] && qwidget->isEnabled();
811 - (void)setEnabled:(BOOL)flag
814 [
super setEnabled:flag];
815 if (qwidget && qwidget->isEnabled() != flag)
816 qwidget->setEnabled(flag);
821 return [NSActionCell class];
824 - (BOOL)acceptsFirstResponder
831 if (!qwidget->isEnabled())
847 if (focusWidget->
window() != qwidget) {
857 - (BOOL)resignFirstResponder
871 - (BOOL)becomeFirstResponder
881 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
884 return supportedActions;
887 - (void)setSupportedActions:(NSDragOperation)actions
889 supportedActions = actions;
892 - (void)draggedImage:(NSImage *)anImage endedAt:(
NSPoint)aPoint operation:(NSDragOperation)operation
896 macCurrentDnDParameters()->performedAction = operation;
899 macCurrentDnDParameters()->performedAction =
909 - (void) qt_clearQWidget
915 - (void)keyDown:(NSEvent *)theEvent
919 QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
923 sendKeyEvents =
true;
929 fromKeyDownEvent =
true;
930 [qt_mac_nativeview_for(qwidget) interpretKeyEvents:[NSArray arrayWithObject: theEvent]];
931 fromKeyDownEvent =
false;
934 if (sendKeyEvents && !composing) {
936 if (!keyEventEaten && qwidget) {
941 if (toplevel == widgetToGetKey->
window()) {
944 [w keyDown:theEvent];
952 - (void)keyUp:(NSEvent *)theEvent
955 QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
960 if (!keyEventEaten && qwidget) {
965 if (toplevel == widgetToGetKey->
window()) {
975 - (void)viewWillMoveToWindow:(NSWindow *)window
981 && (window != [
self window])) {
983 qApp->sendEvent(qwidget, &event);
987 - (void)viewDidMoveToWindow
994 qwidgetprivate->needWindowChange =
true;
996 qApp->sendEvent(qwidget, &event);
1003 - (void) insertText:(
id)aString
1006 if ([aString length]) {
1007 if ([aString isKindOfClass:[NSAttributedString
class]]) {
1023 if (([aString length] && (composing || commitText.
at(0).
unicode() > 0xff)) || !fromKeyDownEvent) {
1028 if (!composing ||
qApp->focusWidget())
1029 widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
1032 widgetToGetKey = mic->lastFocusWidget();
1037 sendKeyEvents =
false;
1043 sendKeyEvents =
true;
1046 composingText->clear();
1049 - (void) setMarkedText:(
id)aString selectedRange:(NSRange)selRange
1054 sendKeyEvents =
false;
1060 if ([aString isKindOfClass:[NSAttributedString
class]]) {
1062 composingLength = qtText.
length();
1065 while (index < composingLength) {
1066 NSRange effectiveRange;
1067 NSRange range = NSMakeRange(index, composingLength-index);
1068 NSDictionary *attributes = [aString attributesAtIndex:index
1069 longestEffectiveRange:&effectiveRange
1071 NSNumber *underlineStyle = [attributes objectForKey:NSUnderlineStyleAttributeName];
1072 if (underlineStyle) {
1074 NSColor *color = [attributes objectForKey:NSUnderlineColorAttributeName];
1076 clr = colorFrom(color);
1082 effectiveRange.location,
1083 effectiveRange.length,
1086 index = effectiveRange.location + effectiveRange.length;
1091 composingLength = qtText.
length();
1094 if (attrs.
size() <= 1) {
1098 0, composingLength, format);
1100 *composingText = qtText;
1103 if (
QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget))
1106 if (!composingLength)
1115 if (
QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget))
1118 composingText->clear();
1122 - (BOOL) hasMarkedText
1124 return (composing ? YES: NO);
1127 - (void) doCommandBySelector:(
SEL)aSelector
1137 - (NSInteger) conversationIdentifier
1140 return (NSInteger)
self;
1143 - (NSAttributedString *) attributedSubstringFromRange:(NSRange)theRange
1146 if (!selectedText.isEmpty()) {
1147 QCFString string(selectedText.mid(theRange.location, theRange.length));
1148 const NSString *tmpString =
reinterpret_cast<const NSString *
>((
CFStringRef)
string);
1149 return [[[NSAttributedString alloc] initWithString:const_cast<NSString *>(tmpString)] autorelease];
1155 - (NSRange) markedRange
1160 range.length = composingLength;
1162 range.location = NSNotFound;
1168 - (NSRange) selectedRange
1172 if (!selectedText.isEmpty()) {
1174 selRange.location = 0;
1175 selRange.
length = selectedText.length();
1178 selRange.location = NSNotFound;
1179 selRange.length = 0;
1185 - (NSRect) firstRectForCharacterRange:(NSRange)theRange
1189 QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
1190 if (!widgetToGetKey)
1196 rect.origin.
x = mp.x();
1198 rect.size.width = mr.width();
1199 rect.size.height = mr.height();
1203 - (NSUInteger)characterIndexForPoint:(
NSPoint)thePoint
1210 - (NSArray*) validAttributesForMarkedText
1212 QWidget *widgetToGetKey = qt_mac_getTargetForKeyEvent(qwidget);
1213 if (!widgetToGetKey)
1220 return [NSArray arrayWithObjects:NSUnderlineColorAttributeName,
1221 NSUnderlineStyleAttributeName, nil];
1235 NSInputManager *currentIManager = [NSInputManager currentInputManager];
1236 if (currentIManager) {
1237 [currentIManager markedTextAbandoned:view];
1250 return [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) isComposing];
1279 if(qt_mac_in_drag) {
1280 qWarning(
"Qt: Internal error: WH0A, unexpected condition reached");
1287 if (!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) {
1294 dragPrivate()->source->removeEventFilter(
this);
1296 beingCancelled =
false;
1300 dragPrivate()->
target = 0;
1302 #ifndef QT_NO_ACCESSIBILITY 1309 dragBoard.setMimeData(dragPrivate()->
data);
1313 QPixmap pix = dragPrivate()->pixmap;
1315 if(dragPrivate()->data->hasText() || dragPrivate()->data->hasUrls()) {
1317 QString s = dragPrivate()->
data->hasText() ? dragPrivate()->data->text()
1318 : dragPrivate()->data->urls().first().toString();
1326 QPixmap tmp(fm.width(s), fm.height());
1329 p.fillRect(0, 0, tmp.width(), tmp.height(),
Qt::color0);
1332 p.drawText(0, fm.ascent(), s);
1335 hotspot =
QPoint(tmp.width() / 2, tmp.height() / 2);
1340 hotspot =
QPoint(default_pm_hotx, default_pm_hoty);
1343 hotspot = dragPrivate()->hotspot;
1349 DnDParams *dndParams = macCurrentDnDParameters();
1353 [theView setSupportedActions: qt_mac_mapDropActions(dragPrivate()->possible_actions)];
1354 QPoint pointInView = [theView qt_qwidget]->mapFromGlobal(dndParams->globalPoint);
1355 NSPoint imageLoc = {pointInView.
x() - hotspot.x(), pointInView.y() + pix.height() - hotspot.y()};
1356 NSSize mouseOffset = {0.0, 0.0};
1357 NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
1362 [theView dragImage:image
1365 event:dndParams->theEvent
1378 Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams->performedAction));
1385 PasteboardCopyPasteLocation(dragBoard.pasteBoard(), &pasteLocation);
1386 if (pasteLocation) {
1388 for (
int i = 0; i < urls.
size(); ++i) {
1389 QUrl fromUrl = urls.
at(i);
1403 return performedAction;
1408 #endif // QT_MAC_USE_COCOA The QVariant class acts like a union for the most common Qt data types.
T qobject_cast(QObject *object)
The QPainter class performs low-level painting on widgets and other paint devices.
virtual bool isComposing() const
This function indicates whether InputMethodStart event had been sent to the current focus widget...
The QColor class provides colors based on RGB, HSV or CMYK values.
void setPointSize(int)
Sets the point size to pointSize.
const struct __CFString * CFStringRef
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
The QApplication class manages the GUI application's control flow and main settings.
bool rename(const QString &newName)
Renames the file currently specified by fileName() to newName.
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
The QCursor class provides a mouse cursor with an arbitrary shape.
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
The QDrag class provides support for MIME-based drag and drop data transfer.
void qt_mac_release_graphics_context(CGContextRef context)
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
QPointer< QWidget > widget
const QChar at(int i) const
Returns the character at the given index position in the string.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int flipYCoordinate(int y)
void qt_dispatchTabletProximityEvent(const ::TabletProximityRec &proxRec)
The QWheelEvent class contains parameters that describe a wheel event.
The QByteArray class provides an array of bytes.
The QHoverEvent class contains parameters that describe a mouse event.
int length() const
Returns the number of characters in this string.
void setRgbF(qreal r, qreal g, qreal b, qreal a=1.0)
Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency).
static const int default_pm_hotx
static Qt::MouseButtons buttons
static QString toQString(CFStringRef cfstr)
int width() const
Returns the width of the rectangle.
OSViewRef qt_mac_effectiveview_for(const QWidget *w)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void * qt_mac_create_nsimage(const QPixmap &pm)
void qt_mac_update_cursor()
static const char *const default_pm[]
QPointF flipPoint(const NSPoint &p)
int height() const
Returns the height of the rectangle.
QWidget * focusWidget() const
Returns the widget that has an input focus for this input context.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
static const int default_pm_hoty
The QObject class is the base class of all Qt objects.
QPointer< QWidget > qt_last_mouse_receiver
The QChar class provides a 16-bit Unicode character.
QChar * data()
Returns a pointer to the data stored in the QString.
Qt::KeyboardModifiers qt_cocoaModifiers2QtModifiers(ulong modifierFlags)
QString path() const
Returns the path of the URL.
Qt::DropAction drag(QDrag *)
virtual void reset()
This function can be reimplemented in a subclass to reset the state of the input method.
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_FORWARD_DECLARE_CLASS(name)
void qt_dispatchModifiersChanged(void *flagsChangedEvent, QWidget *widgetToGetEvent)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static void restoreRedirected(const QPaintDevice *device)
Using QWidget::render() obsoletes the use of this function.
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
QWidget * mac_mouse_grabber
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a=1.0)
Sets the color to CMYK values, c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel...
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
void setUnderlineColor(const QColor &color)
Sets the underline color used for the characters with this format to the color specified.
bool qt_mac_handleTabletEvent(void *view, void *tabletEvent)
The QRegion class specifies a clip region for a painter.
QList< QUrl > urls() const
Returns a list of URLs contained within the MIME data object.
bool qt_dispatchKeyEvent(void *keyEvent, QWidget *widgetToGetEvent)
The QMimeData class provides a container for data that records information about its MIME type...
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
void setSystemClip(const QRegion &baseClip)
Sets the system clip for this engine.
static QString graphics_system_name
struct OpaqueEventRef * EventRef
const T & at(int i) const
Returns the item at index position i in the vector.
static QDragManager * self()
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
void qt_mac_draw_image(CGContextRef context, CGContextRef imageContext, CGRect area, CGRect drawingArea)
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
QMimeData * mimeData() const
Returns the MIME data that is encapsulated by the drag object.
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
#define QT_MANGLE_NAMESPACE(name)
void setFontUnderline(bool underline)
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-und...
int x() const
Returns the x-coordinate of the rectangle's left edge.
bool qt_sendSpontaneousEvent(QObject *, QEvent *)
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
int size() const
Returns the number of items in the list.
The QRect class defines a rectangle in the plane using integer precision.
OSViewRef qt_mac_nativeview_for(const QWidget *)
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
bool copy(const QString &newName)
Copies the file currently specified by fileName() to a file called newName.
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.
The QPixmap class is an off-screen image representation that can be used as a paint device...
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
int x() const
Returns the x coordinate of this point.
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
struct CGContext * CGContextRef
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
static QGraphicsSystem * graphicsSystem()
The QFileInfo class provides system-independent file information.
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *context, bool *ok=0)
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
#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 QString fileName(const QString &fileUrl)
int size() const
Returns the number of items in the vector.
void deleteLater()
Schedules this object for deletion.
void qt_mac_retain_graphics_context(CGContextRef context)
qt_mac_getTargetForMouseEvent(event, QEvent::Gesture, qlocal, qglobal, 0, &widgetToGetTouch)
static int area(const QSize &s)
QWidget * target() const
Returns the target of the drag and drop operation.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.