diff --git a/configure.in b/configure.in
index 72bdbf6..95ee80e 100755
a
|
b
|
AC_GNU_SOURCE |
26 | 26 | AC_PROG_CC |
27 | 27 | AM_C_PROTOTYPES |
28 | 28 | AC_PROG_CPP |
| 29 | AC_PROG_OBJC |
29 | 30 | AC_C_CONST |
30 | 31 | AC_C_INLINE |
31 | 32 | AC_C_STRINGIZE |
… |
… |
if test "${enable_qt_ok}" = yes ; then |
1146 | 1147 | |
1147 | 1148 | dnl Compile Objective C Cocoa headers on Mac to hide the gnuplot icon from the dock |
1148 | 1149 | if test "$is_apple" = yes; then |
1149 | | CXXFLAGS="$CXXFLAGS -ObjC" |
| 1150 | LDFLAGS="$LDFLAGS -framework Cocoa" |
1150 | 1151 | fi |
1151 | 1152 | |
1152 | 1153 | QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore` |
… |
… |
if test "${enable_qt_ok}" = yes ; then |
1183 | 1184 | fi |
1184 | 1185 | AM_CONDITIONAL(BUILD_QT, test "${enable_qt_ok}" = yes) |
1185 | 1186 | |
| 1187 | AM_CONDITIONAL(BUILD_ON_APPLE, test "${is_apple}" = yes) |
| 1188 | |
1186 | 1189 | dnl translation tools |
1187 | 1190 | AM_CONDITIONAL(HAVE_LRELEASE, test "${LRELEASE}" != no) |
1188 | 1191 | |
diff --git a/src/Makefile.am b/src/Makefile.am
index 2dade0b..9eb8ed2 100644
a
|
b
|
clean-local: clean-qt-extra clean-demo |
143 | 143 | |
144 | 144 | gnuplot_SOURCES += qtterminal/qt_term.cpp |
145 | 145 | |
| 146 | if BUILD_ON_APPLE |
| 147 | gnuplot_SOURCES += qtterminal/qt_term_mac.m |
| 148 | endif |
| 149 | |
146 | 150 | pkglibexec_PROGRAMS += gnuplot_qt |
147 | 151 | |
148 | 152 | $(gnuplot_qt_OBJECTS) : ui_QtGnuplotSettings.h |
diff --git a/src/qtterminal/QtGnuplotWidget.cpp b/src/qtterminal/QtGnuplotWidget.cpp
index d184e77..3fcd622 100644
a
|
b
|
void QtGnuplotWidget::exportToPdf() |
210 | 210 | |
211 | 211 | QPrinter printer; |
212 | 212 | printer.setOutputFormat(QPrinter::PdfFormat); |
| 213 | printer.setPaperSize(QSizeF(m_scene->width(), m_scene->height()), QPrinter::Point); |
| 214 | printer.setPageMargins(0,0,0,0,QPrinter::Point); |
213 | 215 | printer.setOutputFileName(fileName); |
214 | 216 | QPainter painter(&printer); |
215 | 217 | painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing); |
… |
… |
void QtGnuplotWidget::loadSettings() |
266 | 268 | |
267 | 269 | void QtGnuplotWidget::applySettings() |
268 | 270 | { |
269 | | m_view->setRenderHints(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing); |
| 271 | m_view->setRenderHints(m_antialias ? (QPainter::Antialiasing | QPainter::TextAntialiasing) : QPainter::TextAntialiasing); |
270 | 272 | m_view->setBackgroundBrush(m_backgroundColor); |
271 | 273 | } |
272 | 274 | |
diff --git a/src/qtterminal/qt_term.cpp b/src/qtterminal/qt_term.cpp
index d8ef726..677a93d 100644
a
|
b
|
|
45 | 45 | #include <QtGui> |
46 | 46 | #include <QtNetwork> |
47 | 47 | |
48 | | #ifdef Q_WS_MAC |
49 | | #include <Cocoa/Cocoa.h> |
50 | | #endif |
51 | | |
52 | 48 | extern "C" { |
53 | 49 | #include "plot.h" // for interactive |
54 | 50 | #include "term_api.h" // for stdfn.h, JUSTIFY, encoding, *term definition, color.h term_interlock |
… |
… |
extern "C" { |
60 | 56 | #include "parse.h" // for real_expression |
61 | 57 | #include "axis.h" |
62 | 58 | #include <signal.h> |
| 59 | double removeDockIcon(); |
63 | 60 | } |
64 | 61 | |
65 | 62 | #include "qt_term.h" |
… |
… |
void qt_init() |
309 | 306 | |
310 | 307 | #ifdef Q_WS_MAC |
311 | 308 | // Don't display this application in the MAC OS X dock |
312 | | ProcessSerialNumber psn; |
313 | | if (GetCurrentProcess(&psn) == noErr) |
314 | | TransformProcessType(&psn, kProcessTransformToBackgroundApplication); |
| 309 | removeDockIcon(); |
315 | 310 | #endif |
316 | 311 | |
317 | 312 | // The creation of a QApplication mangled our locale settings |
diff --git a/src/qtterminal/qt_term_mac.m b/src/qtterminal/qt_term_mac.m
new file mode 100644
index 0000000..114c6bc
-
|
+
|
|
| 1 | #include <Cocoa/Cocoa.h> |
| 2 | |
| 3 | void removeDockIcon() |
| 4 | { |
| 5 | ProcessSerialNumber psn; |
| 6 | if (GetCurrentProcess(&psn) == noErr) |
| 7 | TransformProcessType(&psn, kProcessTransformToBackgroundApplication); |
| 8 | } |