summaryrefslogtreecommitdiffstats
path: root/src/qt3support/widgets
diff options
context:
space:
mode:
authorMorten Sorvig <msorvig@trolltech.com>2009-09-10 09:53:31 (GMT)
committerMorten Sorvig <msorvig@trolltech.com>2009-09-10 09:53:31 (GMT)
commit106d7a210be1e6d52946b575a262e2c76c5e51e6 (patch)
tree7fee1ec1c5616fcc19bba71a3cfe08222b62cd88 /src/qt3support/widgets
parent199ef040b29953a1f0ca694b1430564571e744fe (diff)
downloadQt-106d7a210be1e6d52946b575a262e2c76c5e51e6.zip
Qt-106d7a210be1e6d52946b575a262e2c76c5e51e6.tar.gz
Qt-106d7a210be1e6d52946b575a262e2c76c5e51e6.tar.bz2
Enable Qt3Support for Qt/Cocoa on Mac OS X.
Qt on Mac OS X should not be the only desktop platform without Qt3Support once the Carpon port is dropped. This will also make the switch from Carbon to Cocoa-based Qt as smooth as possible. This is a minimal port, with some code removed: Q3FileDialog is gone. Q3MainWindow won't get the "hide toolbar" button. Q3ScrollView might to more updates than structly neccesary. The rest is there, including the QT3_SUPPORT functions in QtCore and QtGui.
Diffstat (limited to 'src/qt3support/widgets')
-rw-r--r--src/qt3support/widgets/q3mainwindow.cpp4
-rw-r--r--src/qt3support/widgets/q3scrollview.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/qt3support/widgets/q3mainwindow.cpp b/src/qt3support/widgets/q3mainwindow.cpp
index b7fc486..e02d890 100644
--- a/src/qt3support/widgets/q3mainwindow.cpp
+++ b/src/qt3support/widgets/q3mainwindow.cpp
@@ -1042,7 +1042,7 @@ void Q3MainWindow::addDockWindow(Q3DockWindow *dockWindow,
Qt::Dock edge, bool newLine)
{
Q_D(Q3MainWindow);
-#ifdef Q_WS_MAC
+#if defined (Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
extern WindowPtr qt_mac_window_for(const QWidget*); //qwidget_mac.cpp
if(isWindow() && edge == Qt::DockTop) {
d->createWinId();
@@ -1217,7 +1217,7 @@ void Q3MainWindow::removeDockWindow(Q3DockWindow * dockWindow)
{
Q_D(Q3MainWindow);
-#ifdef Q_WS_MAC
+#if defined (Q_WS_MAC) && !defined (QT_MAC_USE_COCOA)
extern WindowPtr qt_mac_window_for(const QWidget*); //qwidget_mac.cpp
if(isWindow() && dockWindow->area() == topDock() && !dockWindows(Qt::DockTop).count())
ChangeWindowAttributes(qt_mac_window_for(this), 0, kWindowToolbarButtonAttribute);
diff --git a/src/qt3support/widgets/q3scrollview.cpp b/src/qt3support/widgets/q3scrollview.cpp
index 1178047..3be0145 100644
--- a/src/qt3support/widgets/q3scrollview.cpp
+++ b/src/qt3support/widgets/q3scrollview.cpp
@@ -870,15 +870,19 @@ void Q3ScrollView::updateScrollBars()
mac_need_scroll = true;
} else {
QWidget *tlw = window();
+#ifndef QT_MAC_USE_COCOA
QPoint tlw_br = QPoint(tlw->width(), tlw->height()),
my_br = qt_mac_posInWindow(this) + QPoint(w, h);
if(my_br.x() >= tlw_br.x() - 3 && my_br.y() >= tlw_br.y() - 3)
+#endif
mac_need_scroll = true;
}
if(mac_need_scroll) {
+#ifndef QT_MAC_USE_COCOA
WindowAttributes attr;
GetWindowAttributes((WindowPtr)handle(), &attr);
mac_need_scroll = (attr & kWindowResizableAttribute);
+#endif
}
if(mac_need_scroll) {
showc = true;