Mac OSX qt5 Become a Native PrintDialog on QWebView



  • I have the trackpad QTouchEvent screen zooming on my mac and no printer support.. :-(
    I try from old qt4 sample code and other stuff or demo.
    Is this a mac problem?

    @

    void BigFox::printPwd() {
    #ifndef QT_NO_PRINTER
    QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFileName("");
    QPrintDialog pp(&printer,this );
    int resultofexec = pp.exec();
    #endif
    //// FOXBEEP() << resultofexec << ":" << FUNCTION << " your eye doctor like zoomss..";
    }

    bool BigFox::event(QEvent * ev) {
    const int nr = ev->type();
    switch (ev->type()) {
    case QEvent::TouchBegin:
    case QEvent::TouchUpdate:
    case QEvent::TouchEnd:
    {
    QTouchEvent *touchEvent = static_cast<QTouchEvent *> (ev);
    QListQTouchEvent::TouchPoint touchPoints = touchEvent->touchPoints();
    if (touchPoints.count() == 2) {
    const QTouchEvent::TouchPoint &TpointA = touchPoints.first();
    const QTouchEvent::TouchPoint &TpointB = touchPoints.last();
    const qreal linedistance = QLineF(TpointA.pos(), TpointB.pos()).length(); //// 1111
    const qreal linestartpos = QLineF(TpointA.startPos(), TpointB.startPos()).length(); //// 222
    bool zoomIn = false;
    const qreal oldFaktorNow = zoomFactor();
    /// ZOOMMAX = 500%
    qreal xmax = qMax(linedistance, linestartpos);
    const qreal ticks = ((ZOOMMAX / 5) / 100) * PERCENTZOOMSTEEPS; /// up down by 8%
    //// is zoom in or out ?
    const qreal goZoomFaktor = (linedistance == xmax) ? oldFaktorNow + ticks : oldFaktorNow - ticks;
    //// if fingers go out save new state
    if (touchEvent->touchPointStates() & Qt::TouchPointReleased) {
    ZoomNewValue(goZoomFaktor);
    }
    }
    }
    default:
    break;
    }
    return QWebView::event(ev);
    }

    #include "main.moc"
    /* qmake pro qt5 file xx
    TEMPLATE = app
    DESTDIR = ./
    TARGET = xx
    QT += network webkitwidgets core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

    bundle at end..

    CONFIG -= app_bundle debug
    CONFIG += qt warn_off silent debug console
    cache()
    */

    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.