NSImage *qt_mac_cgimage_to_nsimage(CGImageRef iamge);
NSImage *qt_mac_create_nsimage(const QPixmap &pm);
+NSSize qt_mac_toNSSize(const QSize &qtSize);
+
QChar qt_mac_qtKey2CocoaKey(Qt::Key key);
Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode);
return qt_mac_cgimage_to_nsimage(qt_mac_image_to_cgimage(image));
}
+NSSize qt_mac_toNSSize(const QSize &qtSize)
+{
+ return NSMakeSize(qtSize.width(), qtSize.height());
+}
// Use this method to keep all the information in the TextSegment. As long as it is ordered
// we are in OK shape, and we can influence that ourselves.
[m_nsWindow orderFront: m_nsWindow];
}
+void QCocoaWindow::propagateSizeHints()
+{
+ [m_nsWindow setMinSize : qt_mac_toNSSize(window()->minimumSize())];
+ [m_nsWindow setMaxSize : qt_mac_toNSSize(window()->maximumSize())];
+
+ if (!window()->sizeIncrement().isNull())
+ [m_nsWindow setResizeIncrements : qt_mac_toNSSize(window()->sizeIncrement())];
+
+ // We must set the window frame after setting the minimum size to prevent the window
+ // from being resized to the minimum size. Use QWindow::baseSize if set, otherwise
+ // use the current size.
+ QSize baseSize = window()->baseSize();
+ QRect rect = geometry();
+ if (!baseSize.isNull()) {
+ [m_nsWindow setFrame : NSMakeRect(rect.x(), rect.y(), baseSize.width(), baseSize.height()) display : YES];
+ } else {
+ [m_nsWindow setFrame : NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()) display : YES];
+ }
+}
+
WId QCocoaWindow::winId() const
{
return WId(m_nsWindow);