Ignore:
Timestamp:
Nov 10, 2009, 3:22:35 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented setting window icons for top-level windows with QWidget::setWindowIcon() (closes #55).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r289 r309  
    10221022    if (desktop && !q->testAttribute(Qt::WA_DontShowOnScreen)) { // desktop widget
    10231023        popup = false; // force this flags off
    1024         // @todo use WinGetMaxPositionto take into account such things as XCenter?
     1024        // @todo use WinGetMaxPosition?
    10251025        data.crect.setRect(0, 0, sw, sh);
    10261026    }
     
    15711571void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
    15721572{
    1573     // @todo implement, depends on #38
     1573    Q_Q(QWidget);
     1574    if (!q->testAttribute(Qt::WA_WState_Created) || !q->isWindow())
     1575        return;
     1576    QTLWExtra *x = this->topData();
     1577    if (x->iconPointer != NULLHANDLE && !forceReset)
     1578        // already been set
     1579        return;
     1580
     1581    if (x->iconPointer != NULLHANDLE)
     1582        WinDestroyPointer(x->iconPointer);
     1583
     1584    x->iconPointer = QPixmap::toPmHPOINTER(q->windowIcon());
     1585    WinSendMsg(frameWinId(), WM_SETICON, (MPARAM)x->iconPointer, NULL);
    15741586}
    15751587
     
    23142326    extra->topextra->fId = NULLHANDLE;
    23152327    extra->topextra->swEntry = NULLHANDLE;
     2328
    23162329}
    23172330
    23182331void QWidgetPrivate::deleteTLSysExtra()
    23192332{
     2333
     2334
    23202335    if (extra->topextra->swEntry != NULLHANDLE)
    23212336        WinRemoveSwitchEntry(extra->topextra->swEntry);
Note: See TracChangeset for help on using the changeset viewer.