VirtualBox

Ignore:
Timestamp:
Sep 26, 2014 5:03:08 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Mini-toolbar rework 03 (some code protection).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r52873 r52874  
    8686void UIRuntimeMiniToolBar::setAlignment(Qt::Alignment alignment)
    8787{
     88    /* Make sure toolbar created: */
     89    AssertPtrReturnVoid(m_pToolbar);
     90
    8891    /* Make sure alignment really changed: */
    8992    if (m_alignment == alignment)
     
    102105void UIRuntimeMiniToolBar::setAutoHide(bool fAutoHide, bool fPropagateToChild /* = true */)
    103106{
     107    /* Make sure toolbar created: */
     108    AssertPtrReturnVoid(m_pToolbar);
     109
    104110    /* Make sure auto-hide really changed: */
    105111    if (m_fAutoHide == fAutoHide)
     
    119125void UIRuntimeMiniToolBar::setText(const QString &strText)
    120126{
     127    /* Make sure toolbar created: */
     128    AssertPtrReturnVoid(m_pToolbar);
     129
    121130    /* Propagate to child: */
    122131    m_pToolbar->setText(strText);
     
    125134void UIRuntimeMiniToolBar::addMenus(const QList<QMenu*> &menus)
    126135{
     136    /* Make sure toolbar created: */
     137    AssertPtrReturnVoid(m_pToolbar);
     138
    127139    /* Propagate to child: */
    128140    m_pToolbar->addMenus(menus);
     
    330342{
    331343    /* Stop hover-enter/leave timers: */
    332     if (m_pHoverEnterTimer->isActive())
     344    if (m_pHoverEnterTimer && m_pHoverEnterTimer->isActive())
    333345        m_pHoverEnterTimer->stop();
    334     if (m_pHoverLeaveTimer->isActive())
     346    if (m_pHoverLeaveTimer && m_pHoverLeaveTimer->isActive())
    335347        m_pHoverLeaveTimer->stop();
    336348
     
    347359{
    348360    /* Stop the hover-leave timer if necessary: */
    349     if (m_pHoverLeaveTimer->isActive())
     361    if (m_pHoverLeaveTimer && m_pHoverLeaveTimer->isActive())
    350362        m_pHoverLeaveTimer->stop();
    351363
    352364    /* Start the hover-enter timer: */
    353     if (m_fAutoHide)
     365    if (m_fAutoHide && m_pHoverEnterTimer)
    354366        m_pHoverEnterTimer->start();
    355367}
     
    358370{
    359371    /* Stop the hover-enter timer if necessary: */
    360     if (m_pHoverEnterTimer->isActive())
     372    if (m_pHoverEnterTimer && m_pHoverEnterTimer->isActive())
    361373        m_pHoverEnterTimer->stop();
    362374
    363375    /* Start the hover-leave timer: */
    364     if (m_fAutoHide)
     376    if (m_fAutoHide && m_pHoverLeaveTimer)
    365377        m_pHoverLeaveTimer->start();
    366378}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette