Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qmenubar.cpp

    r651 r769  
    7272#endif
    7373
     74#ifdef QT_SOFTKEYS_ENABLED
     75#include <private/qsoftkeymanager_p.h>
     76#endif
     77
    7478QT_BEGIN_NAMESPACE
    7579
     
    741745    }
    742746#endif
    743 #ifdef Q_WS_S60
    744     symbianCreateMenuBar(q->parentWidget());
    745     if(symbian_menubar)
    746         q->hide();
    747 #endif
    748 
    749747    q->setBackgroundRole(QPalette::Button);
    750748    oldWindow = oldParent = 0;
    751749#ifdef QT3_SUPPORT
    752750    doAutoResize = false;
     751#endif
     752#ifdef QT_SOFTKEYS_ENABLED
     753    menuBarAction = 0;
    753754#endif
    754755    handleReparent();
     
    13851386#endif
    13861387#ifdef Q_WS_S60
    1387     if (symbian_menubar)
     1388
     1389    // Construct symbian_menubar when this code path is entered first time
     1390    // and when newParent != NULL
     1391    if (!symbian_menubar)
     1392        symbianCreateMenuBar(newParent);
     1393
     1394    // Reparent and rebuild menubar when parent is changed
     1395    if (symbian_menubar) {
     1396        if (oldParent != newParent)
     1397            reparentMenuBar(oldParent, newParent);
     1398        q->hide();
    13881399        symbian_menubar->rebuild();
    1389 #endif
    1390 
     1400    }
     1401
     1402#ifdef QT_SOFTKEYS_ENABLED
     1403    // Constuct menuBarAction when this code path is entered first time
     1404    if (!menuBarAction) {
     1405        if (newParent) {
     1406            menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent);
     1407            newParent->addAction(menuBarAction);
     1408        }
     1409    } else {
     1410        // If reparenting i.e. we already have menuBarAction, remove it from old parent
     1411        // and add for a new parent
     1412        if (oldParent)
     1413            oldParent->removeAction(menuBarAction);
     1414        if (newParent)
     1415            newParent->addAction(menuBarAction);
     1416    }
     1417#endif // QT_SOFTKEYS_ENABLED
     1418#endif // Q_WS_S60
    13911419}
    13921420
     
    14411469        d->itemsDirty = true;
    14421470        d->updateGeometries();
    1443     }
     1471#ifdef QT_SOFTKEYS_ENABLED
     1472    } else if (e->type() == QEvent::LanguageChange) {
     1473        if (d->menuBarAction)
     1474            d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey));
     1475#endif
     1476    }
     1477
    14441478    QWidget::changeEvent(e);
    14451479}
     
    19241958
    19251959  Currently there is only support for the default action on Windows
    1926   Mobile. All other platforms ignore the default action.
     1960  Mobile. On all other platforms this method is not available.
    19271961
    19281962  \sa defaultAction()
Note: See TracChangeset for help on using the changeset viewer.