Changeset 8571:ac20ad20187c in orange


Ignore:
Timestamp:
08/02/11 12:39:19 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
0aafcb37d98f84165789522daca9f81ddd724107
Message:

Add a Plot::selection_changed() signal and a function to get all selected points

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot.py

    r8569 r8571  
    907907            if point_item: 
    908908                point_item.set_selected(b == self.AddSelection or (b == self.ToggleSelection and not point_item.is_selected())) 
     909                self.selection_changed.emit() 
    909910        else: 
    910911            return False 
  • source/orangeplot/plot.cpp

    r8569 r8571  
    188188    } 
    189189    set_points_state(rect, scene(), Point::Selected, behavior); 
     190    emit selection_changed(); 
    190191} 
    191192 
     
    198199    } 
    199200    set_points_state(area, scene(), Point::Selected, behavior); 
     201    emit selection_changed(); 
    200202} 
    201203 
     
    216218} 
    217219 
     220QList< Point* > Plot::selected_points() 
     221{ 
     222    QList<Point*> list; 
     223    foreach (const PointHash& hash, m_point_hash) 
     224    { 
     225        foreach (Point* point, hash) 
     226        { 
     227            if (point->is_selected()) 
     228            { 
     229                list.append(point); 
     230            } 
     231        } 
     232    } 
     233    return list; 
     234} 
     235 
    218236Point* Plot::selected_point_at(const DataPoint& pos) 
    219237{ 
  • source/orangeplot/plot.h

    r8569 r8571  
    5757     **/ 
    5858    QList< int > selected_points(const QList< double > x_data, const QList< double > y_data, const QTransform& transform); 
     59    QList< Point*> selected_points(); 
    5960     
    6061    Point* nearest_point(const QPointF& pos); 
     
    7273    void unselect_all_points(); 
    7374    void unmark_all_points(); 
    74         
     75     
     76Q_SIGNALS: 
     77    void selection_changed(); 
     78     
    7579protected: 
    7680    void set_clean(); 
  • source/orangeplot/plot.sip

    r8569 r8571  
    6767     
    6868    QList< int > selected_points(const QList< double > x_data, const QList< double > y_data, const QTransform& transform); 
     69    QList< Point* > selected_points(); 
    6970    Point* nearest_point(const QPointF& pos); 
    7071    Point* point_at(const DataPoint& pos); 
     72     
     73Q_SIGNALS: 
     74    void selection_changed(); 
    7175     
    7276protected: 
  • source/orangeplot/point.cpp

    r8540 r8571  
    288288    update(); 
    289289} 
     290 
    290291bool Point::state_flag(Point::StateFlag flag) const { 
    291292    return m_state & flag; 
    292293} 
    293294 
    294  
    295295void Point::set_selected(bool selected) 
    296296{ 
Note: See TracChangeset for help on using the changeset viewer.