@@ -368,10 +368,12 int QBarCategoriesAxisPrivate::ticksCount() const | |||||
368 |
|
368 | |||
369 | void QBarCategoriesAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int count) |
|
369 | void QBarCategoriesAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int count) | |
370 | { |
|
370 | { | |
371 | Q_Q(QBarCategoriesAxis); |
|
371 | // Q_Q(QBarCategoriesAxis); | |
372 | Q_UNUSED(count); |
|
|||
373 | m_min = min; |
|
372 | m_min = min; | |
374 | m_max = max; |
|
373 | m_max = max; | |
|
374 | m_ticksCount = count; | |||
|
375 | // TODO: causes crash in some situations. added to known issues | |||
|
376 | /* | |||
375 | int minIndex = qFloor(min); |
|
377 | int minIndex = qFloor(min); | |
376 | int maxIndex = qFloor(max); |
|
378 | int maxIndex = qFloor(max); | |
377 |
|
|
379 | ||
@@ -380,6 +382,9 void QBarCategoriesAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int | |||||
380 | } |
|
382 | } | |
381 | if (maxIndex > m_categories.count()-1){ |
|
383 | if (maxIndex > m_categories.count()-1){ | |
382 | maxIndex = m_categories.count()-1; |
|
384 | maxIndex = m_categories.count()-1; | |
|
385 | if (maxIndex<0) { | |||
|
386 | maxIndex = 0; | |||
|
387 | } | |||
383 | } |
|
388 | } | |
384 |
|
|
389 | ||
385 | bool changed = false; |
|
390 | bool changed = false; | |
@@ -398,6 +403,7 void QBarCategoriesAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int | |||||
398 | if (changed) { |
|
403 | if (changed) { | |
399 | emit q->rangeChanged(m_minCategory, m_maxCategory); |
|
404 | emit q->rangeChanged(m_minCategory, m_maxCategory); | |
400 | } |
|
405 | } | |
|
406 | */ | |||
401 | } |
|
407 | } | |
402 |
|
408 | |||
403 | ChartAxis* QBarCategoriesAxisPrivate::createGraphics(ChartPresenter* presenter) |
|
409 | ChartAxis* QBarCategoriesAxisPrivate::createGraphics(ChartPresenter* presenter) | |
@@ -417,6 +423,9 void QBarCategoriesAxisPrivate::emitRange() | |||||
417 |
|
423 | |||
418 | void QBarCategoriesAxisPrivate::initialize(Domain* domain) |
|
424 | void QBarCategoriesAxisPrivate::initialize(Domain* domain) | |
419 | { |
|
425 | { | |
|
426 | Q_UNUSED(domain); | |||
|
427 | // TODO: this causes crash now. added to known issues. | |||
|
428 | /* | |||
420 | if (qFuzzyCompare(m_max, m_min)) { |
|
429 | if (qFuzzyCompare(m_max, m_min)) { | |
421 | if(m_orientation==Qt::Vertical){ |
|
430 | if(m_orientation==Qt::Vertical){ | |
422 | handleAxisRangeChanged(domain->minY(),domain->maxY(),domain->tickXCount()); |
|
431 | handleAxisRangeChanged(domain->minY(),domain->maxY(),domain->tickXCount()); | |
@@ -424,6 +433,7 void QBarCategoriesAxisPrivate::initialize(Domain* domain) | |||||
424 | handleAxisRangeChanged(domain->minX(),domain->maxX(),domain->tickYCount()); |
|
433 | handleAxisRangeChanged(domain->minX(),domain->maxX(),domain->tickYCount()); | |
425 | } |
|
434 | } | |
426 | } |
|
435 | } | |
|
436 | */ | |||
427 | } |
|
437 | } | |
428 |
|
438 | |||
429 | #include "moc_qbarcategoriesaxis.cpp" |
|
439 | #include "moc_qbarcategoriesaxis.cpp" |
General Comments 0
You need to be logged in to leave comments.
Login now