Exemplo n.º 1
0
void QLineEditPrivate::init(const QString& txt)
{
    Q_Q(QLineEdit);
    control = new QWidgetLineControl(txt);
    control->setParent(q);
    control->setFont(q->font());
    QObject::connect(control, SIGNAL(textChanged(QString)),
            q, SIGNAL(textChanged(QString)));
    QObject::connect(control, SIGNAL(textEdited(QString)),
            q, SLOT(_q_textEdited(QString)));
    QObject::connect(control, SIGNAL(cursorPositionChanged(int,int)),
            q, SLOT(_q_cursorPositionChanged(int,int)));
    QObject::connect(control, SIGNAL(selectionChanged()),
            q, SLOT(_q_selectionChanged()));
    QObject::connect(control, SIGNAL(accepted()),
            q, SIGNAL(returnPressed()));
    QObject::connect(control, SIGNAL(editingFinished()),
            q, SIGNAL(editingFinished()));
#ifdef QT_KEYPAD_NAVIGATION
    QObject::connect(control, SIGNAL(editFocusChange(bool)),
            q, SLOT(_q_editFocusChange(bool)));
#endif
    QObject::connect(control, SIGNAL(cursorPositionChanged(int,int)),
            q, SLOT(updateMicroFocus()));

    QObject::connect(control, SIGNAL(textChanged(QString)),
            q, SLOT(updateMicroFocus()));

    // for now, going completely overboard with updates.
    QObject::connect(control, SIGNAL(selectionChanged()),
            q, SLOT(update()));

    QObject::connect(control, SIGNAL(selectionChanged()),
            q, SLOT(updateMicroFocus()));

    QObject::connect(control, SIGNAL(displayTextChanged(QString)),
            q, SLOT(update()));

    QObject::connect(control, SIGNAL(updateNeeded(QRect)),
            q, SLOT(_q_updateNeeded(QRect)));

    QStyleOptionFrame opt;
    q->initStyleOption(&opt);
    control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, q));
    control->setPasswordMaskDelay(q->style()->styleHint(QStyle::SH_LineEdit_PasswordMaskDelay, &opt, q));
#ifndef QT_NO_CURSOR
    q->setCursor(Qt::IBeamCursor);
#endif
    q->setFocusPolicy(Qt::StrongFocus);
    q->setAttribute(Qt::WA_InputMethodEnabled);
    //   Specifies that this widget can use more, but is able to survive on
    //   less, horizontal space; and is fixed vertically.
    q->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, QSizePolicy::LineEdit));
    q->setBackgroundRole(QPalette::Base);
    q->setAttribute(Qt::WA_KeyCompression);
    q->setMouseTracking(true);
    q->setAcceptDrops(true);

    q->setAttribute(Qt::WA_MacShowFocusRect);
}
Exemplo n.º 2
0
void OutputWindow::wheelEvent(QWheelEvent *e)
{
    if (d->m_zoomEnabled) {
        if (e->modifiers() & Qt::ControlModifier) {
            float delta = e->angleDelta().y() / 120.f;
            zoomInF(delta);
            emit wheelZoom();
            return;
        }
    }
    QAbstractScrollArea::wheelEvent(e);
    updateMicroFocus();
}
Exemplo n.º 3
0
QWebPage* PHIWebPage::createWindow( QWebPage::WebWindowType type )
{
    QWebView *view=new QWebView();
    PHIWebPage *page=new PHIWebPage();
    view->setPage( page );
    page->setView( view );
    if ( type==QWebPage::WebModalDialog ) view->setWindowModality( Qt::ApplicationModal);
    view->setPage( page );
    view->setAttribute( Qt::WA_DeleteOnClose );
    connect( page, SIGNAL( geometryChangeRequested( const QRect& ) ),
        page, SLOT( slotUpdateGeometry( const QRect& ) ) );
    connect( page, SIGNAL( windowCloseRequested() ), view, SLOT( close() ) );
    connect( page, SIGNAL( microFocusChanged() ), view, SLOT( updateMicroFocus() ) );
    connect( page, SIGNAL( linkClicked( const QUrl& ) ), page, SLOT( slotLinkClicked( const QUrl& ) ) );
    connect( view, &QWebView::titleChanged, view, &QWebView::setWindowTitle );
    connect( view, &QWebView::iconChanged, page, &PHIWebPage::slotIconChanged );
    view->show();
    return page;
}
Exemplo n.º 4
0
/*!
    Makes \a page the new web page of the web view.

    The parent QObject of the provided page remains the owner
    of the object. If the current document is a child of the web
    view, it will be deleted.

    \sa page()
*/
void QWebView::setPage(QWebPage* page)
{
    if (d->page == page)
        return;
    if (d->page) {
        d->page->d->client = 0; // unset the page client
        if (d->page->parent() == this)
            delete d->page;
        else
            d->page->disconnect(this);
    }
    d->page = page;
    if (d->page) {
        d->page->setView(this);
        d->page->d->client = d; // set the page client
        d->page->setPalette(palette());
        // #### connect signals
        QWebFrame *mainFrame = d->page->mainFrame();
        connect(mainFrame, SIGNAL(titleChanged(const QString&)),
                this, SIGNAL(titleChanged(const QString&)));
        connect(mainFrame, SIGNAL(iconChanged()),
                this, SIGNAL(iconChanged()));
        connect(mainFrame, SIGNAL(urlChanged(const QUrl &)),
                this, SIGNAL(urlChanged(const QUrl &)));

        connect(d->page, SIGNAL(loadStarted()),
                this, SIGNAL(loadStarted()));
        connect(d->page, SIGNAL(loadProgress(int)),
                this, SIGNAL(loadProgress(int)));
        connect(d->page, SIGNAL(loadFinished(bool)),
                this, SIGNAL(loadFinished(bool)));
        connect(d->page, SIGNAL(statusBarMessage(const QString &)),
                this, SIGNAL(statusBarMessage(const QString &)));
        connect(d->page, SIGNAL(linkClicked(const QUrl &)),
                this, SIGNAL(linkClicked(const QUrl &)));

        connect(d->page, SIGNAL(microFocusChanged()),
                this, SLOT(updateMicroFocus()));
        connect(d->page, SIGNAL(destroyed()),
                this, SLOT(_q_pageDestroyed()));
    }
Exemplo n.º 5
0
/*!
    Makes \a page the new web page of the web view.

    The parent QObject of the provided page remains the owner
    of the object. If the current document is a child of the web
    view, it will be deleted.

    \sa page()
*/
void QWebView::setPage(QWebPage* page)
{
    if (d->page == page)
        return;

    d->unsetPageIfExists();
    d->page = page;

    if (d->page) {
        d->page->setView(this);
        d->page->setPalette(palette());
        // #### connect signals
        QWebFrame *mainFrame = d->page->mainFrame();
        connect(mainFrame, SIGNAL(titleChanged(QString)),
                this, SIGNAL(titleChanged(QString)));
        connect(mainFrame, SIGNAL(iconChanged()),
                this, SIGNAL(iconChanged()));
        connect(mainFrame, SIGNAL(urlChanged(QUrl)),
                this, SIGNAL(urlChanged(QUrl)));

        connect(d->page, SIGNAL(loadStarted()),
                this, SIGNAL(loadStarted()));
        connect(d->page, SIGNAL(loadProgress(int)),
                this, SIGNAL(loadProgress(int)));
        connect(d->page, SIGNAL(loadFinished(bool)),
                this, SIGNAL(loadFinished(bool)));
        connect(d->page, SIGNAL(statusBarMessage(QString)),
                this, SIGNAL(statusBarMessage(QString)));
        connect(d->page, SIGNAL(linkClicked(QUrl)),
                this, SIGNAL(linkClicked(QUrl)));

        connect(d->page, SIGNAL(microFocusChanged()),
                this, SLOT(updateMicroFocus()));
        connect(d->page, SIGNAL(destroyed()),
                this, SLOT(_q_pageDestroyed()));
#if USE(ACCELERATED_COMPOSITING)
        d->page->d->page->settings()->setAcceleratedCompositingEnabled(false);
#endif
    }
Exemplo n.º 6
0
/*!
    Makes \a page the new web page of the web view.

    The parent QObject of the provided page remains the owner
    of the object. If the current document is a child of the web
    view, it will be deleted.

    \sa page()
*/
void QWebView::setPage(QWebPage* page)
{
    if (d->page == page)
        return;

    d->detachCurrentPage();
    d->page = page;

    if (d->page) {
        d->page->setView(this);
        d->page->setPalette(palette());
        // #### connect signals
        QWebFrame *mainFrame = d->page->mainFrame();
        connect(mainFrame, SIGNAL(titleChanged(QString)),
                this, SIGNAL(titleChanged(QString)));
        connect(mainFrame, SIGNAL(iconChanged()),
                this, SIGNAL(iconChanged()));
        connect(mainFrame, SIGNAL(urlChanged(QUrl)),
                this, SIGNAL(urlChanged(QUrl)));

        connect(d->page, SIGNAL(loadStarted()),
                this, SIGNAL(loadStarted()));
        connect(d->page, SIGNAL(loadProgress(int)),
                this, SIGNAL(loadProgress(int)));
        connect(d->page, SIGNAL(loadFinished(bool)),
                this, SIGNAL(loadFinished(bool)));
        connect(d->page, SIGNAL(statusBarMessage(QString)),
                this, SIGNAL(statusBarMessage(QString)));
        connect(d->page, SIGNAL(linkClicked(QUrl)),
                this, SIGNAL(linkClicked(QUrl)));
        connect(d->page, SIGNAL(selectionChanged()),
                this, SIGNAL(selectionChanged()));

        connect(d->page, SIGNAL(microFocusChanged()),
                this, SLOT(updateMicroFocus()));
        connect(d->page, SIGNAL(destroyed()),
                this, SLOT(_q_pageDestroyed()));
    }
Exemplo n.º 7
0
void DhQPushButton::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 8
0
void DhQAbstractSpinBox::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 9
0
void KWCanvasItem::updateInputMethodInfo()
{
#if QT_VERSION  >= 0x040700
    updateMicroFocus();
#endif
}
Exemplo n.º 10
0
void DhQGroupBox::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 11
0
void KoPACanvas::updateInputMethodInfo()
{
    updateMicroFocus();
}
Exemplo n.º 12
0
void DhQSlider::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 13
0
void DhQScrollArea::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 14
0
void KWCanvasItem::updateInputMethodInfo()
{
    updateMicroFocus();
}
Exemplo n.º 15
0
void DhQStackedWidget::DvhupdateMicroFocus() {
    return updateMicroFocus();
}
Exemplo n.º 16
0
void DhQGLWidget::DvhupdateMicroFocus() {
  return updateMicroFocus();
}
Exemplo n.º 17
0
void KFormulaCanvas::updateInputMethodInfo()
{
    updateMicroFocus();
}