Changeset View
Changeset View
Standalone View
Standalone View
src/backend/generalTest/GeneralTest.cpp
Context not available. | |||||
32 | #include "backend/core/column/Column.h" | 32 | #include "backend/core/column/Column.h" | ||
---|---|---|---|---|---|
33 | #include "backend/lib/macros.h" | 33 | #include "backend/lib/macros.h" | ||
34 | 34 | | |||
35 | #include "backend/generalTest/MyTableModel.h" | ||||
36 | | ||||
35 | #include <QLabel> | 37 | #include <QLabel> | ||
36 | #include <QVBoxLayout> | 38 | #include <QVBoxLayout> | ||
37 | #include <QStandardItemModel> | 39 | #include <QStandardItemModel> | ||
Context not available. | |||||
47 | 49 | | |||
48 | GeneralTest::GeneralTest(const QString& name, const AspectType& type) : AbstractPart(name, type), | 50 | GeneralTest::GeneralTest(const QString& name, const AspectType& type) : AbstractPart(name, type), | ||
49 | m_summaryLayout(new QVBoxLayout()), | 51 | m_summaryLayout(new QVBoxLayout()), | ||
50 | m_inputStatsTableModel(new QStandardItemModel) { | 52 | m_inputStatsTableModel(new MyTableModel()) { | ||
51 | 53 | | |||
52 | for (int i = 0; i < RESULTLINESCOUNT; i++) { | 54 | for (int i = 0; i < RESULTLINESCOUNT; i++) { | ||
53 | m_resultLine[i] = new QLabel(); | 55 | m_resultLine[i] = new QLabel(); | ||
Context not available. | |||||
440 | table = "<style type=text/css>" | 442 | table = "<style type=text/css>" | ||
441 | ".tg {border-collapse:collapse;border: 1px solid black;}" | 443 | ".tg {border-collapse:collapse;border: 1px solid black;}" | ||
442 | ".tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border: 1px solid black;overflow:hidden;word-break:normal;color:#333;background-color:#fff;}" | 444 | ".tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border: 1px solid black;overflow:hidden;word-break:normal;color:#333;background-color:#fff;}" | ||
443 | ".tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border: 1px solid black;overflow:hidden;word-break:normal;color:#333;background-color:#f0f0f0;}" | 445 | ".tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:bold;padding:10px 5px;border: 1px solid black;overflow:hidden;word-break:normal;color:#333;background-color:#f0f0f0;}" | ||
444 | "</style>"; | 446 | "</style>"; | ||
445 | 447 | | |||
446 | table += "<table class=tg>"; | 448 | table += "<table class=tg>"; | ||
Context not available. | |||||
533 | return !reader->hasError(); | 535 | return !reader->hasError(); | ||
534 | } | 536 | } | ||
535 | 537 | | |||
538 | void GeneralTest::clearInputStatsTable() { | ||||
539 | // int rowCount = m_inputStatsTableModel->rowCount(); | ||||
540 | // int columnCount = m_inputStatsTableModel->columnCount(); | ||||
541 | | ||||
542 | QList<QStandardItem *> horizontalHeader = m_inputStatsTableModel->takeRow(0); | ||||
543 | QList<QStandardItem *> verticalHeader = m_inputStatsTableModel->takeColumn(0); | ||||
544 | | ||||
545 | m_inputStatsTableModel->clear(); | ||||
546 | m_inputStatsTableModel->appendRow(horizontalHeader); | ||||
547 | | ||||
548 | verticalHeader.push_front(m_inputStatsTableModel->takeColumn(0)[0]); | ||||
549 | m_inputStatsTableModel->insertColumn(0, verticalHeader); | ||||
550 | } | ||||
551 | | ||||
536 | Spreadsheet *GeneralTest::dataSourceSpreadsheet() const { | 552 | Spreadsheet *GeneralTest::dataSourceSpreadsheet() const { | ||
537 | return m_dataSourceSpreadsheet; | 553 | return m_dataSourceSpreadsheet; | ||
538 | } | 554 | } | ||
539 | 555 | | |||
540 | | ||||
541 | bool GeneralTest::exportView() const { | 556 | bool GeneralTest::exportView() const { | ||
542 | return true; | 557 | return true; | ||
543 | } | 558 | } | ||
Context not available. |