|
@@
-181,7
+181,7
void tst_qbarmodelmapper::verticalMapper()
|
|
181
|
181
|
|
|
182
|
182
|
m_chart->addSeries(m_series);
|
|
183
|
183
|
|
|
184
|
|
QCOMPARE(m_series->barsetCount(), expectedBarSetCount);
|
|
|
184
|
QCOMPARE(m_series->count(), expectedBarSetCount);
|
|
185
|
185
|
QCOMPARE(mapper->firstBarSetColumn(), qMax(-1, firstBarSetColumn));
|
|
186
|
186
|
QCOMPARE(mapper->lastBarSetColumn(), qMax(-1, lastBarSetColumn));
|
|
187
|
187
|
|
|
@@
-216,7
+216,7
void tst_qbarmodelmapper::verticalMapperCustomMapping()
|
|
216
|
216
|
|
|
217
|
217
|
m_series = new QGroupedBarSeries;
|
|
218
|
218
|
|
|
219
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
219
|
QCOMPARE(m_series->count(), 0);
|
|
220
|
220
|
|
|
221
|
221
|
QVBarModelMapper *mapper = new QVBarModelMapper;
|
|
222
|
222
|
mapper->setFirstBarSetColumn(0);
|
|
@@
-227,7
+227,7
void tst_qbarmodelmapper::verticalMapperCustomMapping()
|
|
227
|
227
|
mapper->setCount(countLimit);
|
|
228
|
228
|
m_chart->addSeries(m_series);
|
|
229
|
229
|
|
|
230
|
|
QCOMPARE(m_series->barsetCount(), expectedBarSetCount);
|
|
|
230
|
QCOMPARE(m_series->count(), expectedBarSetCount);
|
|
231
|
231
|
|
|
232
|
232
|
if (expectedBarSetCount > 0)
|
|
233
|
233
|
QCOMPARE(m_series->barSets().first()->count(), expectedCount);
|
|
@@
-236,7
+236,7
void tst_qbarmodelmapper::verticalMapperCustomMapping()
|
|
236
|
236
|
mapper->setFirstBarSetColumn(-1);
|
|
237
|
237
|
mapper->setLastBarSetColumn(1);
|
|
238
|
238
|
|
|
239
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
239
|
QCOMPARE(m_series->count(), 0);
|
|
240
|
240
|
|
|
241
|
241
|
delete mapper;
|
|
242
|
242
|
mapper = 0;
|
|
@@
-271,7
+271,7
void tst_qbarmodelmapper::horizontalMapper()
|
|
271
|
271
|
|
|
272
|
272
|
m_chart->addSeries(m_series);
|
|
273
|
273
|
|
|
274
|
|
QCOMPARE(m_series->barsetCount(), expectedBarSetCount);
|
|
|
274
|
QCOMPARE(m_series->count(), expectedBarSetCount);
|
|
275
|
275
|
QCOMPARE(mapper->firstBarSetRow(), qMax(-1, firstBarSetRow));
|
|
276
|
276
|
QCOMPARE(mapper->lastBarSetRow(), qMax(-1, lastBarSetRow));
|
|
277
|
277
|
|
|
@@
-306,7
+306,7
void tst_qbarmodelmapper::horizontalMapperCustomMapping()
|
|
306
|
306
|
|
|
307
|
307
|
m_series = new QGroupedBarSeries;
|
|
308
|
308
|
|
|
309
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
309
|
QCOMPARE(m_series->count(), 0);
|
|
310
|
310
|
|
|
311
|
311
|
QHBarModelMapper *mapper = new QHBarModelMapper;
|
|
312
|
312
|
mapper->setFirstBarSetRow(0);
|
|
@@
-317,7
+317,7
void tst_qbarmodelmapper::horizontalMapperCustomMapping()
|
|
317
|
317
|
mapper->setCount(countLimit);
|
|
318
|
318
|
m_chart->addSeries(m_series);
|
|
319
|
319
|
|
|
320
|
|
QCOMPARE(m_series->barsetCount(), expectedBarSetCount);
|
|
|
320
|
QCOMPARE(m_series->count(), expectedBarSetCount);
|
|
321
|
321
|
|
|
322
|
322
|
if (expectedBarSetCount > 0)
|
|
323
|
323
|
QCOMPARE(m_series->barSets().first()->count(), expectedCount);
|
|
@@
-326,7
+326,7
void tst_qbarmodelmapper::horizontalMapperCustomMapping()
|
|
326
|
326
|
mapper->setFirstBarSetRow(-1);
|
|
327
|
327
|
mapper->setLastBarSetRow(1);
|
|
328
|
328
|
|
|
329
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
329
|
QCOMPARE(m_series->count(), 0);
|
|
330
|
330
|
|
|
331
|
331
|
delete mapper;
|
|
332
|
332
|
mapper = 0;
|
|
@@
-379,39
+379,39
void tst_qbarmodelmapper::verticalModelInsertRows()
|
|
379
|
379
|
{
|
|
380
|
380
|
// setup the mapper
|
|
381
|
381
|
createVerticalMapper();
|
|
382
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
382
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
383
|
383
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
384
|
384
|
QVERIFY(m_vMapper->model() != 0);
|
|
385
|
385
|
|
|
386
|
386
|
int insertCount = 4;
|
|
387
|
387
|
m_model->insertRows(3, insertCount);
|
|
388
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
388
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
389
|
389
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount);
|
|
390
|
390
|
|
|
391
|
391
|
int first = 3;
|
|
392
|
392
|
m_vMapper->setFirst(3);
|
|
393
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
393
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
394
|
394
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount - first);
|
|
395
|
395
|
|
|
396
|
396
|
m_model->insertRows(3, insertCount);
|
|
397
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
397
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
398
|
398
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 2 * insertCount - first);
|
|
399
|
399
|
|
|
400
|
400
|
int countLimit = 6;
|
|
401
|
401
|
m_vMapper->setCount(countLimit);
|
|
402
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
402
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
403
|
403
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 2 * insertCount - first));
|
|
404
|
404
|
|
|
405
|
405
|
m_model->insertRows(3, insertCount);
|
|
406
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
406
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
407
|
407
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount - first));
|
|
408
|
408
|
|
|
409
|
409
|
m_vMapper->setFirst(0);
|
|
410
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
410
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
411
|
411
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount));
|
|
412
|
412
|
|
|
413
|
413
|
m_vMapper->setCount(-1);
|
|
414
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
414
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
415
|
415
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 3 * insertCount);
|
|
416
|
416
|
}
|
|
417
|
417
|
|
|
@@
-419,39
+419,39
void tst_qbarmodelmapper::verticalModelRemoveRows()
|
|
419
|
419
|
{
|
|
420
|
420
|
// setup the mapper
|
|
421
|
421
|
createVerticalMapper();
|
|
422
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
422
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
423
|
423
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
424
|
424
|
QVERIFY(m_vMapper->model() != 0);
|
|
425
|
425
|
|
|
426
|
426
|
int removeCount = 2;
|
|
427
|
427
|
m_model->removeRows(1, removeCount);
|
|
428
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
428
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
429
|
429
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount);
|
|
430
|
430
|
|
|
431
|
431
|
int first = 1;
|
|
432
|
432
|
m_vMapper->setFirst(first);
|
|
433
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
433
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
434
|
434
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount - first);
|
|
435
|
435
|
|
|
436
|
436
|
m_model->removeRows(1, removeCount);
|
|
437
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
437
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
438
|
438
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 2 * removeCount - first);
|
|
439
|
439
|
|
|
440
|
440
|
int countLimit = 3;
|
|
441
|
441
|
m_vMapper->setCount(countLimit);
|
|
442
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
442
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
443
|
443
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 2 * removeCount - first));
|
|
444
|
444
|
|
|
445
|
445
|
m_model->removeRows(1, removeCount);
|
|
446
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
446
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
447
|
447
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount - first));
|
|
448
|
448
|
|
|
449
|
449
|
m_vMapper->setFirst(0);
|
|
450
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
450
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
451
|
451
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount));
|
|
452
|
452
|
|
|
453
|
453
|
m_vMapper->setCount(-1);
|
|
454
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
454
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
455
|
455
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 3 * removeCount);
|
|
456
|
456
|
}
|
|
457
|
457
|
|
|
@@
-459,13
+459,13
void tst_qbarmodelmapper::verticalModelInsertColumns()
|
|
459
|
459
|
{
|
|
460
|
460
|
// setup the mapper
|
|
461
|
461
|
createVerticalMapper();
|
|
462
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
462
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
463
|
463
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
464
|
464
|
QVERIFY(m_vMapper->model() != 0);
|
|
465
|
465
|
|
|
466
|
466
|
int insertCount = 4;
|
|
467
|
467
|
m_model->insertColumns(3, insertCount);
|
|
468
|
|
QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
|
468
|
QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1);
|
|
469
|
469
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
470
|
470
|
}
|
|
471
|
471
|
|
|
@@
-473,31
+473,31
void tst_qbarmodelmapper::verticalModelRemoveColumns()
|
|
473
|
473
|
{
|
|
474
|
474
|
// setup the mapper
|
|
475
|
475
|
createVerticalMapper();
|
|
476
|
|
QCOMPARE(m_series->barsetCount(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1));
|
|
|
476
|
QCOMPARE(m_series->count(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1));
|
|
477
|
477
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
478
|
478
|
QVERIFY(m_vMapper->model() != 0);
|
|
479
|
479
|
|
|
480
|
480
|
int removeCount = m_modelColumnCount - 2;
|
|
481
|
481
|
m_model->removeColumns(0, removeCount);
|
|
482
|
|
QCOMPARE(m_series->barsetCount(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1));
|
|
|
482
|
QCOMPARE(m_series->count(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1));
|
|
483
|
483
|
QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount);
|
|
484
|
484
|
|
|
485
|
485
|
// leave all the columns
|
|
486
|
486
|
m_model->removeColumns(0, m_modelColumnCount - removeCount);
|
|
487
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
487
|
QCOMPARE(m_series->count(), 0);
|
|
488
|
488
|
}
|
|
489
|
489
|
|
|
490
|
490
|
void tst_qbarmodelmapper::horizontalModelInsertRows()
|
|
491
|
491
|
{
|
|
492
|
492
|
// setup the mapper
|
|
493
|
493
|
createHorizontalMapper();
|
|
494
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
494
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
495
|
495
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
496
|
496
|
QVERIFY(m_hMapper->model() != 0);
|
|
497
|
497
|
|
|
498
|
498
|
int insertCount = 4;
|
|
499
|
499
|
m_model->insertRows(3, insertCount);
|
|
500
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
500
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
501
|
501
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
502
|
502
|
}
|
|
503
|
503
|
|
|
@@
-505,57
+505,57
void tst_qbarmodelmapper::horizontalModelRemoveRows()
|
|
505
|
505
|
{
|
|
506
|
506
|
// setup the mapper
|
|
507
|
507
|
createHorizontalMapper();
|
|
508
|
|
QCOMPARE(m_series->barsetCount(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1));
|
|
|
508
|
QCOMPARE(m_series->count(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1));
|
|
509
|
509
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
510
|
510
|
QVERIFY(m_hMapper->model() != 0);
|
|
511
|
511
|
|
|
512
|
512
|
int removeCount = m_modelRowCount - 2;
|
|
513
|
513
|
m_model->removeRows(0, removeCount);
|
|
514
|
|
QCOMPARE(m_series->barsetCount(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1));
|
|
|
514
|
QCOMPARE(m_series->count(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1));
|
|
515
|
515
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
516
|
516
|
|
|
517
|
517
|
// leave all the columns
|
|
518
|
518
|
m_model->removeRows(0, m_modelRowCount - removeCount);
|
|
519
|
|
QCOMPARE(m_series->barsetCount(), 0);
|
|
|
519
|
QCOMPARE(m_series->count(), 0);
|
|
520
|
520
|
}
|
|
521
|
521
|
|
|
522
|
522
|
void tst_qbarmodelmapper::horizontalModelInsertColumns()
|
|
523
|
523
|
{
|
|
524
|
524
|
// setup the mapper
|
|
525
|
525
|
createHorizontalMapper();
|
|
526
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
526
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
527
|
527
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
528
|
528
|
QVERIFY(m_hMapper->model() != 0);
|
|
529
|
529
|
|
|
530
|
530
|
int insertCount = 4;
|
|
531
|
531
|
m_model->insertColumns(3, insertCount);
|
|
532
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
532
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
533
|
533
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount);
|
|
534
|
534
|
|
|
535
|
535
|
int first = 3;
|
|
536
|
536
|
m_hMapper->setFirst(3);
|
|
537
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
537
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
538
|
538
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount - first);
|
|
539
|
539
|
|
|
540
|
540
|
m_model->insertColumns(3, insertCount);
|
|
541
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
541
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
542
|
542
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 2 * insertCount - first);
|
|
543
|
543
|
|
|
544
|
544
|
int countLimit = 6;
|
|
545
|
545
|
m_hMapper->setCount(countLimit);
|
|
546
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
546
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
547
|
547
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 2 * insertCount - first));
|
|
548
|
548
|
|
|
549
|
549
|
m_model->insertColumns(3, insertCount);
|
|
550
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
550
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
551
|
551
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount - first));
|
|
552
|
552
|
|
|
553
|
553
|
m_hMapper->setFirst(0);
|
|
554
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
554
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
555
|
555
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount));
|
|
556
|
556
|
|
|
557
|
557
|
m_hMapper->setCount(-1);
|
|
558
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
558
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
559
|
559
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 3 * insertCount);
|
|
560
|
560
|
}
|
|
561
|
561
|
|
|
@@
-563,39
+563,39
void tst_qbarmodelmapper::horizontalModelRemoveColumns()
|
|
563
|
563
|
{
|
|
564
|
564
|
// setup the mapper
|
|
565
|
565
|
createHorizontalMapper();
|
|
566
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
566
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
567
|
567
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount);
|
|
568
|
568
|
QVERIFY(m_hMapper->model() != 0);
|
|
569
|
569
|
|
|
570
|
570
|
int removeCount = 2;
|
|
571
|
571
|
m_model->removeColumns(1, removeCount);
|
|
572
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
572
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
573
|
573
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount);
|
|
574
|
574
|
|
|
575
|
575
|
int first = 1;
|
|
576
|
576
|
m_hMapper->setFirst(first);
|
|
577
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
577
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
578
|
578
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount - first);
|
|
579
|
579
|
|
|
580
|
580
|
m_model->removeColumns(1, removeCount);
|
|
581
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
581
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
582
|
582
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 2 * removeCount - first);
|
|
583
|
583
|
|
|
584
|
584
|
int countLimit = 3;
|
|
585
|
585
|
m_hMapper->setCount(countLimit);
|
|
586
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
586
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
587
|
587
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 2 * removeCount - first));
|
|
588
|
588
|
|
|
589
|
589
|
m_model->removeColumns(1, removeCount);
|
|
590
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
590
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
591
|
591
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount - first));
|
|
592
|
592
|
|
|
593
|
593
|
m_hMapper->setFirst(0);
|
|
594
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
594
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
595
|
595
|
QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount));
|
|
596
|
596
|
|
|
597
|
597
|
m_hMapper->setCount(-1);
|
|
598
|
|
QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
|
598
|
QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1);
|
|
599
|
599
|
QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 3 * removeCount);
|
|
600
|
600
|
}
|
|
601
|
601
|
|