Changeset 8335:94748ac0b4cd in orange


Ignore:
Timestamp:
06/28/11 12:39:15 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
f77a09f3c19ff2f667a5035fcec9ec6d713e6e18
Message:

OWGraphQt is now partially written in C++

It runs mostly the same as before, only autoscale-calculation is faster.

Location:
source/orangegraph
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • source/orangegraph/curve.cpp

    r8334 r8335  
    370370    return m_yBounds.min; 
    371371} 
    372  
    373 #include "curve.moc" 
  • source/orangegraph/graph.cpp

    r8334 r8335  
    2222    item->setParentItem(graph_item); 
    2323    m_items << item; 
     24    qDebug() << "Adding item" << item << "with data rect" << item->dataRect() << "to the graph"; 
    2425} 
    2526 
     
    3435    { 
    3536        qWarning() << "Trying to remove an item that doesn't belong to this graph"; 
     37    } 
     38} 
     39 
     40void Graph::removeAllItems() 
     41{ 
     42    foreach (PlotItem* item, m_items) 
     43    { 
     44        removeItem(item); 
    3645    } 
    3746} 
     
    5362        } 
    5463    } 
     64    qDebug() << "Data rect for axes" << axes << "is" << r; 
    5565    return r; 
    5666} 
     
    6070     
    6171} 
     72 
     73#include "graph.moc" 
  • source/orangegraph/graph.h

    r8334 r8335  
    1515    void addItem(PlotItem* item); 
    1616    void removeItem(PlotItem* item); 
     17    void removeAllItems(); 
    1718     
    1819    QRectF dataRectForAxes(int xAxis, int yAxis); 
  • source/orangegraph/graph.sip

    r8334 r8335  
    3232 
    3333public: 
    34     Graph(QWidget* parent = 0); 
     34    Graph(QWidget* parent /TransferThis/ = 0); 
    3535    virtual ~Graph(); 
    3636     
    3737    void addItem(PlotItem* item); 
    3838    void removeItem(PlotItem* item); 
     39    void removeAllItems(); 
    3940     
    4041    QRectF dataRectForAxes(int xAxis, int yAxis); 
  • source/orangegraph/orangegraph.sip

    r8334 r8335  
    33%Import QtGui/QtGuimod.sip 
    44 
     5%Include graph.sip 
    56%Include plotitem.sip 
    67%Include curve.sip 
    7 %Include graph.sip 
  • source/orangegraph/plotitem.cpp

    r8334 r8335  
    22#include "graph.h" 
    33 
    4 PlotItem::PlotItem(QList< double > xData, QList< double > yData, QGraphicsItem* parent, QGraphicsScene* scene): QGraphicsItem(parent, scene) 
     4PlotItem::PlotItem(QList< double > xData, QList< double > yData, QGraphicsItem* parent, QGraphicsScene* scene): QGraphicsItem(parent, scene), 
     5m_dataRect(boundingRectFromData(xData, yData)) 
    56{ 
    67 
Note: See TracChangeset for help on using the changeset viewer.