示例#1
0
static QwtArray<QwtPicker *> activePickers(QWidget *w)
{
    QwtArray<QwtPicker *> pickers;

#if QT_VERSION >= 0x040000
    QObjectList children = w->children();
    for ( int i = 0; i < children.size(); i++ ) {
        QObject *obj = children[i];
        if ( obj->inherits("QwtPicker") ) {
            QwtPicker *picker = (QwtPicker *)obj;
            if ( picker->isEnabled() )
                pickers += picker;
        }
    }
#else
    QObjectList *children = (QObjectList *)w->children();
    if ( children ) {
        for ( QObjectListIterator it(*children); it.current(); ++it ) {
            QObject *obj = (QObject *)it.current();
            if ( obj->inherits("QwtPicker") ) {
                QwtPicker *picker = (QwtPicker *)obj;
                if ( picker->isEnabled() ) {
                    pickers.resize(pickers.size() + 1);
                    pickers[int(pickers.size()) - 1] = picker;
                }
            }
        }
    }
#endif

    return pickers;
}
示例#2
0
static QVector<QwtPicker *> qwtActivePickers( QWidget *w )
{
    QVector<QwtPicker *> pickers;

    QObjectList children = w->children();
    for ( int i = 0; i < children.size(); i++ )
    {
        QwtPicker *picker = qobject_cast<QwtPicker *>( children[i] );
        if ( picker && picker->isEnabled() )
            pickers += picker;
    }

    return pickers;
}
示例#3
0
static QVector<QwtPicker *> activePickers( QWidget *w )
{
    QVector<QwtPicker *> pickers;

    QObjectList children = w->children();
    for ( int i = 0; i < children.size(); i++ )
    {
        QObject *obj = children[i];
        if ( obj->inherits( "QwtPicker" ) )
        {
            QwtPicker *picker = ( QwtPicker * )obj;
            if ( picker->isEnabled() )
                pickers += picker;
        }
    }

    return pickers;
}
示例#4
0
void QwtPickerTracker::drawOverlay( QPainter *painter ) const
{
    painter->setPen( d_picker->trackerPen() );
    d_picker->drawTracker( painter );
}
示例#5
0
QRegion QwtPickerTracker::maskHint() const
{
    return d_picker->trackerRect( font() );
}
示例#6
0
void QwtPickerRubberband::drawOverlay( QPainter *painter ) const
{
    painter->setPen( d_picker->rubberBandPen() );
    d_picker->drawRubberBand( painter );
}
示例#7
0
QRegion QwtPickerRubberband::maskHint() const
{
    return d_picker->rubberBandMask();
}