Changeset View
Changeset View
Standalone View
Standalone View
kmplot/view.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 87 | : QWidget( parent ), | |||
---|---|---|---|---|---|
91 | m_AccumulatedDelta(0), | 91 | m_AccumulatedDelta(0), | ||
92 | m_viewportAnimation( new QPropertyAnimation( this, "viewport" ) ) | 92 | m_viewportAnimation( new QPropertyAnimation( this, "viewport" ) ) | ||
93 | { | 93 | { | ||
94 | assert( !m_self ); // this class should only be constructed once | 94 | assert( !m_self ); // this class should only be constructed once | ||
95 | m_self = this; | 95 | m_self = this; | ||
96 | setAttribute( Qt::WA_StaticContents ); | 96 | setAttribute( Qt::WA_StaticContents ); | ||
97 | 97 | | |||
98 | m_haveRoot = false; | 98 | m_haveRoot = false; | ||
99 | emit updateRootValue( false, 0 ); | ||||
99 | m_xmin = m_xmax = m_ymin = m_ymax = 0.0; | 100 | m_xmin = m_xmax = m_ymin = m_ymax = 0.0; | ||
100 | m_printHeaderTable = false; | 101 | m_printHeaderTable = false; | ||
101 | m_printBackground = false; | 102 | m_printBackground = false; | ||
102 | m_printWidth = 0.0; | 103 | m_printWidth = 0.0; | ||
103 | m_printHeight = 0.0; | 104 | m_printHeight = 0.0; | ||
104 | m_stopCalculating = false; | 105 | m_stopCalculating = false; | ||
105 | m_isDrawing = false; | 106 | m_isDrawing = false; | ||
106 | m_popupMenuStatus = NoPopup; | 107 | m_popupMenuStatus = NoPopup; | ||
▲ Show 20 Lines • Show All 3399 Lines • ▼ Show 20 Line(s) | 3496 | { | |||
3506 | { | 3507 | { | ||
3507 | double x0 = m_crosshairPosition.x(); | 3508 | double x0 = m_crosshairPosition.x(); | ||
3508 | if ( !m_haveRoot && findRoot( &x0, m_currentPlot, PreciseRoot ) ) | 3509 | if ( !m_haveRoot && findRoot( &x0, m_currentPlot, PreciseRoot ) ) | ||
3509 | { | 3510 | { | ||
3510 | QString str=" "; | 3511 | QString str=" "; | ||
3511 | str += i18n("root") + ": x" + SubscriptZeroSymbol + " = "; | 3512 | str += i18n("root") + ": x" + SubscriptZeroSymbol + " = "; | ||
3512 | setStatusBar( str+QString().sprintf("%+.5f", x0), RootSection ); | 3513 | setStatusBar( str+QString().sprintf("%+.5f", x0), RootSection ); | ||
3513 | m_haveRoot=true; | 3514 | m_haveRoot=true; | ||
3515 | emit updateRootValue( true, x0 ); | ||||
3514 | } | 3516 | } | ||
3515 | } | 3517 | } | ||
3516 | else | 3518 | else | ||
3519 | { | ||||
aacid: spacing here looks weird to me and looks like it should be on the same horizontal position as… | |||||
3517 | m_haveRoot=false; | 3520 | m_haveRoot=false; | ||
3521 | emit updateRootValue( false, 0 ); | ||||
3522 | } | ||||
3518 | } | 3523 | } | ||
3519 | 3524 | | |||
3520 | // For Cartesian plots, only adjust the cursor position if it is not at the ends of the view | 3525 | // For Cartesian plots, only adjust the cursor position if it is not at the ends of the view | ||
3521 | if ( ((it->type() != Function::Cartesian) && (it->type() != Function::Differential)) || m_clipRect.contains( mousePos.toPoint() ) ) | 3526 | if ( ((it->type() != Function::Cartesian) && (it->type() != Function::Differential)) || m_clipRect.contains( mousePos.toPoint() ) ) | ||
3522 | { | 3527 | { | ||
3523 | mousePos = toPixel( m_crosshairPosition, ClipAll, mousePos ); | 3528 | mousePos = toPixel( m_crosshairPosition, ClipAll, mousePos ); | ||
3524 | QPoint globalPos = mapToGlobal( mousePos.toPoint() ); | 3529 | QPoint globalPos = mapToGlobal( mousePos.toPoint() ); | ||
3525 | QCursor::setPos( globalPos ); | 3530 | QCursor::setPos( globalPos ); | ||
▲ Show 20 Lines • Show All 717 Lines • ▼ Show 20 Line(s) | 4247 | { | |||
4243 | m_printWidth = width; | 4248 | m_printWidth = width; | ||
4244 | } | 4249 | } | ||
4245 | 4250 | | |||
4246 | void View::setPrintHeight( double height ) | 4251 | void View::setPrintHeight( double height ) | ||
4247 | { | 4252 | { | ||
4248 | m_printHeight = height; | 4253 | m_printHeight = height; | ||
4249 | } | 4254 | } | ||
4250 | 4255 | | |||
4256 | QPointF View::getCrosshairPosition() const | ||||
4257 | { | ||||
4258 | return m_crosshairPosition; | ||||
4259 | } | ||||
4260 | | ||||
4251 | //END class View | 4261 | //END class View | ||
4252 | 4262 | | |||
4253 | 4263 | | |||
4254 | 4264 | | |||
4255 | //BEGIN class IntegralDrawSettings | 4265 | //BEGIN class IntegralDrawSettings | ||
4256 | IntegralDrawSettings::IntegralDrawSettings() | 4266 | IntegralDrawSettings::IntegralDrawSettings() | ||
4257 | { | 4267 | { | ||
4258 | dmin = dmax = 0.0; | 4268 | dmin = dmax = 0.0; | ||
4259 | draw = false; | 4269 | draw = false; | ||
4260 | } | 4270 | } | ||
4261 | //END class IntegralDrawSettings | 4271 | //END class IntegralDrawSettings |
spacing here looks weird to me and looks like it should be on the same horizontal position as "else" but since you didn't use arc i can't see the rest of the file to see if that's actually the style for the file, feel free to ignore this.