13 #include <objc/runtime.h>
38 bool omitArrow = ((arrowPixelsFromTopOrLeft < cornerRadius) ||
39 (arrowPixelsFromTopOrLeft > (((arrowSide == Qt::AnchorTop) ||
40 (arrowSide == Qt::AnchorBottom))?
45 if (arrowSide == Qt::AnchorTop)
50 path.lineTo(arrowPixelsFromTopOrLeft,0);
55 path.lineTo(width(),height()-cornerRadius);
56 path.cubicTo(width(),height(), width(),height(), width()-cornerRadius,height());
57 path.lineTo(cornerRadius,height());
58 path.cubicTo(0,height(), 0,height(), 0,height()-cornerRadius);
63 else if (arrowSide == Qt::AnchorRight)
70 path.lineTo(width(),arrowPixelsFromTopOrLeft);
75 path.lineTo(cornerRadius,height());
76 path.cubicTo(0,height(), 0,height(), 0,height()-cornerRadius);
77 path.lineTo(0,cornerRadius);
78 path.cubicTo(0,0, 0,0, cornerRadius,0);
81 else if (arrowSide == Qt::AnchorBottom)
83 path.moveTo(width()-cornerRadius,0);
84 path.cubicTo(width(),0, width(),0, width(),cornerRadius);
90 path.lineTo(arrowPixelsFromTopOrLeft,height());
95 path.lineTo(0,cornerRadius);
96 path.cubicTo(0,0, 0,0, cornerRadius,0);
99 else if (arrowSide == Qt::AnchorLeft)
101 path.moveTo(width()-cornerRadius,0);
102 path.cubicTo(width(),0, width(),0, width(),cornerRadius);
103 path.lineTo(width(),height()-cornerRadius);
104 path.cubicTo(width(),height(), width(),height(), width()-cornerRadius,height());
110 path.lineTo(0,arrowPixelsFromTopOrLeft);
139 id view = (id)popoverWidget->winId();
142 Class nsView = (Class)objc_getClass(
"NSView");
143 SEL windowSEL = sel_registerName(
"window");
144 Method nsViewWindowMethod = class_getInstanceMethod(nsView, windowSEL);
145 IMP nsViewWindow = method_getImplementation(nsViewWindowMethod);
146 void *window = nsViewWindow(view, method_getName(nsViewWindowMethod));
161 popoverWidget->lower();
176 popoverWidget->lower();
179 popoverWidget->hide();
180 popoverWidget->show();
194 Class nsWindow = (Class)objc_getClass(
"NSWindow");
195 SEL setLevelSEL = sel_registerName(
"setLevel:");
196 Method nsWindowSetLevelMethod = class_getInstanceMethod(nsWindow, setLevelSEL);
197 IMP nsWindowSetLevel = method_getImplementation(nsWindowSetLevelMethod);
203 nsWindowSetLevel((
id)window, method_getName(nsWindowSetLevelMethod), key);