Subversion Repositories svn1-original

Rev

Rev 314 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 314 Rev 318
Line 27... Line 27...
27
qmFullData::qmFullData(QWidget *parent) :
27
qmFullData::qmFullData(QWidget *parent) :
28
    QWidget(parent)
28
    QWidget(parent)
29
{
29
{
30
 
30
 
31
    /*
31
    /*
-
 
32
    ** Init vars 
-
 
33
    */
-
 
34
    sorted = false;
-
 
35
 
-
 
36
    /*
32
    ** Create the main display region 
37
    ** Create the main display region 
33
    **      A groupbox with a table in it
38
    **      A groupbox with a table in it
34
    **      A 'refresh' button
39
    **      A 'refresh' button
35
    */
40
    */
36
 
41
 
Line 41... Line 46...
41
    verticalLayout->addWidget(groupBox);
46
    verticalLayout->addWidget(groupBox);
42
    QVBoxLayout *verticalLayout2 = new QVBoxLayout(groupBox);
47
    QVBoxLayout *verticalLayout2 = new QVBoxLayout(groupBox);
43
    tableWidget = new QTableWidget(groupBox);
48
    tableWidget = new QTableWidget(groupBox);
44
    tableWidget->setAlternatingRowColors(true);
49
    tableWidget->setAlternatingRowColors(true);
45
    //tableWidget->setRowCount(config.num_teams + 1);
50
    //tableWidget->setRowCount(config.num_teams + 1);
46
    //tableWidget->setColumnCount(config.num_legs + 3);
-
 
47
    //tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
51
    //tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
 
52
    tableWidget->setColumnCount(config.num_legs + 3 + 5);
48
    tableWidget->horizontalHeader()->setVisible(true);
53
    tableWidget->horizontalHeader()->setVisible(true);
49
    tableWidget->horizontalHeader()->setDefaultSectionSize(70);
54
    tableWidget->horizontalHeader()->setDefaultSectionSize(70);
50
    tableWidget->horizontalHeader()->setHighlightSections(true);
55
    tableWidget->horizontalHeader()->setHighlightSections(true);
51
 
56
 
52
    tableWidget->verticalHeader()->setVisible(true);
57
    tableWidget->verticalHeader()->setVisible(true);
Line 72... Line 77...
72
    labels << "Team" << "Full Name" << "Cat";
77
    labels << "Team" << "Full Name" << "Cat";
73
    for (int ii = 0; ii < config.num_legs; ii++)
78
    for (int ii = 0; ii < config.num_legs; ii++)
74
    {
79
    {
75
        labels << config.leg_name[ii];
80
        labels << config.leg_name[ii];
76
    }
81
    }
77
//    loadData();
82
    labels << "Disq" << "NonEq" << "Enabled" << "Vet Check" << "Bad Times";
78
 
83
 
79
    tableWidget->setHorizontalHeaderLabels(labels);
84
    tableWidget->setHorizontalHeaderLabels(labels);
80
    tableWidget->resizeColumnsToContents();
85
    tableWidget->resizeColumnsToContents();
81
}
86
}
82
 
87
 
Line 91... Line 96...
91
**
96
**
92
----------------------------------------------------------------------------*/
97
----------------------------------------------------------------------------*/
93
 
98
 
94
void qmFullData::showEvent ( QShowEvent * event )
99
void qmFullData::showEvent ( QShowEvent * event )
95
{
100
{
96
    qDebug("qmFullData::showEvent");
101
    //qDebug("qmFullData::showEvent");
97
    if ( ! event->spontaneous() )
102
    if ( ! event->spontaneous() )
98
    {
103
    {
99
        loadData();
104
        loadData();
100
    }
105
    }
101
}
106
}
Line 119... Line 124...
119
    /*
124
    /*
120
    ** Delete existing entries in the table
125
    ** Delete existing entries in the table
121
    */
126
    */
122
    tableWidget->clearContents();
127
    tableWidget->clearContents();
123
    tableWidget->setRowCount(config.max_team+1);
128
    tableWidget->setRowCount(config.max_team+1);
124
    tableWidget->setColumnCount(config.num_legs + 3 + 5);
-
 
125
    tableWidget->setSortingEnabled(FALSE);
129
    tableWidget->setSortingEnabled(FALSE);
126
 
130
 
127
    /*
131
    /*
128
    ** Scan all the team data
132
    ** Scan all the team data
129
    */
133
    */
Line 153... Line 157...
153
                tableWidget->setItem(team, 3+leg++, new qmTwiFlag("VetCheck", team_buf.flags.vet_check) );
157
                tableWidget->setItem(team, 3+leg++, new qmTwiFlag("VetCheck", team_buf.flags.vet_check) );
154
                tableWidget->setItem(team, 3+leg++, new qmTwiFlag("Bad Times", team_buf.flags.bad_times) );
158
                tableWidget->setItem(team, 3+leg++, new qmTwiFlag("Bad Times", team_buf.flags.bad_times) );
155
            }
159
            }
156
        }
160
        }
157
    }
161
    }
-
 
162
    if (!sorted)
-
 
163
    {
158
    tableWidget->sortByColumn(0,Qt::AscendingOrder);
164
        tableWidget->sortByColumn(0, Qt::AscendingOrder);
-
 
165
        sorted = true; 
-
 
166
    }
159
    tableWidget->setSortingEnabled(TRUE);
167
    tableWidget->setSortingEnabled(TRUE);
160
    tableWidget->resizeColumnsToContents();
168
    tableWidget->resizeColumnsToContents();
161
}
169
}
162
 
170
 
163
/*----------------------------------------------------------------------------
171
/*----------------------------------------------------------------------------