Ticket #33596: gnuplot-qt-configuration.patch

File gnuplot-qt-configuration.patch, 3.5 KB (added by mojca (Mojca Miklavec), 12 years ago)

patch for Qt against 4.6.0 (need a run of ./prepare first)

  • configure.in

    diff --git a/configure.in b/configure.in
    index 72bdbf6..95ee80e 100755
    a b AC_GNU_SOURCE 
    2626AC_PROG_CC
    2727AM_C_PROTOTYPES
    2828AC_PROG_CPP
     29AC_PROG_OBJC
    2930AC_C_CONST
    3031AC_C_INLINE
    3132AC_C_STRINGIZE
    if test "${enable_qt_ok}" = yes ; then 
    11461147
    11471148  dnl Compile Objective C Cocoa headers on Mac to hide the gnuplot icon from the dock
    11481149  if test "$is_apple" = yes; then
    1149     CXXFLAGS="$CXXFLAGS -ObjC"
     1150    LDFLAGS="$LDFLAGS -framework Cocoa"
    11501151  fi
    11511152
    11521153  QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
    if test "${enable_qt_ok}" = yes ; then 
    11831184fi
    11841185AM_CONDITIONAL(BUILD_QT, test "${enable_qt_ok}" = yes)
    11851186
     1187AM_CONDITIONAL(BUILD_ON_APPLE, test "${is_apple}" = yes)
     1188
    11861189dnl translation tools
    11871190AM_CONDITIONAL(HAVE_LRELEASE, test "${LRELEASE}" != no)
    11881191
  • src/Makefile.am

    diff --git a/src/Makefile.am b/src/Makefile.am
    index 2dade0b..9eb8ed2 100644
    a b clean-local: clean-qt-extra clean-demo 
    143143
    144144gnuplot_SOURCES += qtterminal/qt_term.cpp
    145145
     146if BUILD_ON_APPLE
     147gnuplot_SOURCES += qtterminal/qt_term_mac.m
     148endif
     149
    146150pkglibexec_PROGRAMS += gnuplot_qt
    147151
    148152$(gnuplot_qt_OBJECTS) : ui_QtGnuplotSettings.h
  • src/qtterminal/QtGnuplotWidget.cpp

    diff --git a/src/qtterminal/QtGnuplotWidget.cpp b/src/qtterminal/QtGnuplotWidget.cpp
    index d184e77..3fcd622 100644
    a b void QtGnuplotWidget::exportToPdf() 
    210210
    211211        QPrinter printer;
    212212        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);
    213215        printer.setOutputFileName(fileName);
    214216        QPainter painter(&printer);
    215217        painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
    void QtGnuplotWidget::loadSettings() 
    266268
    267269void QtGnuplotWidget::applySettings()
    268270{
    269         m_view->setRenderHints(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
     271        m_view->setRenderHints(m_antialias ? (QPainter::Antialiasing | QPainter::TextAntialiasing) : QPainter::TextAntialiasing);
    270272        m_view->setBackgroundBrush(m_backgroundColor);
    271273}
    272274
  • src/qtterminal/qt_term.cpp

    diff --git a/src/qtterminal/qt_term.cpp b/src/qtterminal/qt_term.cpp
    index d8ef726..677a93d 100644
    a b  
    4545#include <QtGui>
    4646#include <QtNetwork>
    4747
    48 #ifdef Q_WS_MAC
    49         #include <Cocoa/Cocoa.h>
    50 #endif
    51 
    5248extern "C" {
    5349        #include "plot.h"      // for interactive
    5450        #include "term_api.h"  // for stdfn.h, JUSTIFY, encoding, *term definition, color.h term_interlock
    extern "C" { 
    6056        #include "parse.h"     // for real_expression
    6157        #include "axis.h"
    6258        #include <signal.h>
     59        double removeDockIcon();
    6360}
    6461
    6562#include "qt_term.h"
    void qt_init() 
    309306
    310307#ifdef Q_WS_MAC
    311308        // 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();
    315310#endif
    316311
    317312        // The creation of a QApplication mangled our locale settings
  • new file src/qtterminal/qt_term_mac.m

    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
     3void removeDockIcon()
     4{
     5        ProcessSerialNumber psn;
     6        if (GetCurrentProcess(&psn) == noErr)
     7                TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
     8}