##// END OF EJS Templates
Adds loosenumber algorithm...
Adds loosenumber algorithm * adds loose numbers , natvie numbers * rewrites zoom handling * remove zoom stack since loose numbers takes control * adds number of fractional digits to show

File last commit:

r653:f4e416c6727f
r678:e39e59ad9161
Show More
bar.cpp
99 lines | 1.9 KiB | text/x-c | CppLexer
sauimone
renamed bar.h to bar_p.h
r118 #include "bar_p.h"
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 #include <QDebug>
Michal Klocek
minor.
r59 #include <QPainter>
sauimone
tooltip for barcharts
r283 #include <QGraphicsSceneEvent>
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 Bar::Bar(QString category, QGraphicsItem *parent)
Tero Ahola
Fixed initial bounding rect issue with bar series
r518 : QGraphicsObject(parent),
mXpos(0),
mYpos(0),
mWidth(0),
Jani Honkonen
We have so many stupid warnings that "treat warnings as errors" flag is needed...
r609 mHeight(0),
Tero Ahola
Use light outline color instead of dark for bar, area and scatter
r653 mBrush(QBrush()),
mPen(QPen()),
Jani Honkonen
We have so many stupid warnings that "treat warnings as errors" flag is needed...
r609 mCategory(category)
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 {
sauimone
right click feature for bar series. Enables drilldown
r412 setAcceptedMouseButtons(Qt::LeftButton|Qt::RightButton);
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 setAcceptHoverEvents(true);
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 }
sauimone
making bar as qobject causes crash for some reason. rewinding back a bit...
r247 void Bar::setSize(const QSizeF& size)
{
mWidth = size.width();
mHeight = size.height();
}
sauimone
theme interface to barcharts. some minor fixes
r113 void Bar::resize( qreal w, qreal h )
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 {
mWidth = w;
mHeight = h;
}
void Bar::setPos(qreal x, qreal y)
{
mXpos = x;
mYpos = y;
}
sauimone
brush support for bargroups
r183 void Bar::setPen(QPen pen)
{
mPen = pen;
}
void Bar::setBrush(QBrush brush)
{
mBrush = brush;
}
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 void Bar::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Tero Ahola
Squashed bunch of warnings
r611 Q_UNUSED(option)
Q_UNUSED(widget)
sauimone
correct drawing for barchart
r82 if (0 == mHeight) {
return;
}
Tero Ahola
Use light outline color instead of dark for bar, area and scatter
r653 painter->setPen(mPen);
sauimone
brush support for bargroups
r183 painter->setBrush(mBrush);
sauimone
theme interface to barcharts. some minor fixes
r113
// This compensates for rounding errors. drawRect takes ints and cumulative error of pos + size may be over 1.
int x0 = mXpos;
int x1 = (mXpos + mWidth);
int w = x1-x0;
int y0 = mYpos;
int y1 = (mYpos + mHeight);
int h = y1-y0;
painter->drawRect(x0, y0 ,w ,h);
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 }
QRectF Bar::boundingRect() const
{
sauimone
floating values working now. bounding rect bug fixed
r273 QRectF r(mXpos, mYpos, mWidth, mHeight);
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 return r;
}
sauimone
right click feature for bar series. Enables drilldown
r412 void Bar::mousePressEvent(QGraphicsSceneMouseEvent* event)
sauimone
Bug fix for bar presenters. It appears that order of childItems may change. Relying on order caused crash
r256 {
sauimone
right click feature for bar series. Enables drilldown
r412 if (event->button() == Qt::LeftButton) {
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 emit clicked(mCategory);
sauimone
right click feature for bar series. Enables drilldown
r412 } else if (event->button() == Qt::RightButton) {
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 emit rightClicked(mCategory);
sauimone
right click feature for bar series. Enables drilldown
r412 }
sauimone
Bug fix for bar presenters. It appears that order of childItems may change. Relying on order caused crash
r256 }
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent* event)
sauimone
updated barchart examples. minor fixes
r276 {
sauimone
tooltip for barcharts
r283 emit hoverEntered(event->lastScreenPos());
sauimone
updated barchart examples. minor fixes
r276 }
sauimone
tooltip for barcharts
r283 void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent* /*event*/)
sauimone
updated barchart examples. minor fixes
r276 {
sauimone
tooltip for barcharts
r283 emit hoverLeaved();
sauimone
updated barchart examples. minor fixes
r276 }
sauimone
Bug fix for bar presenters. It appears that order of childItems may change. Relying on order caused crash
r256 #include "moc_bar_p.cpp"
sauimone
signals and slots for bars and sets
r239
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 QTCOMMERCIALCHART_END_NAMESPACE