Ejemplo n.º 1
0
void HelpWindowWidget::documentChanged()
{
    // A new help document has been selected, resulting in the previous or next
    // help document becoming either available or not

    QAction *action = qobject_cast<QAction *>(sender());

    if (action == pageAction(QWebPage::Back))
        emit backEnabled(action->isEnabled());
    else if (action == pageAction(QWebPage::Forward))
        emit forwardEnabled(action->isEnabled());
}
Ejemplo n.º 2
0
void HelpWindowWidget::loadSettings(QSettings *pSettings)
{
    // Let the user know of a few default things about ourselves by emitting a
    // few signals

    emit notHomePage(false);

    emit backEnabled(false);
    emit forwardEnabled(false);

    emit copyTextEnabled(false);

    emitZoomRelatedSignals();

    // Retrieve the zoom level

    setZoomLevel(pSettings->value(SettingsZoomLevel, DefaultZoomLevel).toInt());
}
Ejemplo n.º 3
0
void HelpWidget::documentChanged()
{
    // A new help document has been selected, resulting in the previous or next
    // help document becoming either available or not

    QAction *action = qobject_cast<QAction *>(sender());

    if (action) {
        // The QObject casting was successful, so we can carry on

        if (action == pageAction(QWebPage::Back)) {
            // The current action is to tell us whether the previous help
            // document is available, so send a signal to let the user know
            // about it

            emit backEnabled(action->isEnabled());
        } else if (action == pageAction(QWebPage::Forward)) {
            // The current action is to tell us whether the next help document
            // is available, so send a signal to let the user know about it

            emit forwardEnabled(action->isEnabled());
        }
    }
}