Skip to content

Commit 7638f2f

Browse files
authored
Remove competitors (#1004)
* Remove Competitors perspective * Remove unused competitors files * Fix clang-tidy warnings * Add save button to competitor widget * Fix draw class and remove drawing buttons auto connect * Select free start times doubleclicking on start time in competitor dialog * Add IOF-ID column to run table * Fix cannot add or remove competitor by [+] [-] buttons
1 parent 2e250b4 commit 7638f2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+702
-1167
lines changed

3rdparty/necrolog

libqf/libqfqmlwidgets/src/framework/plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ QString Plugin::findReportFile(const QString &report_file_path) const
5757
search_paths << effectiveReportsDir() + '/' + m_featureId + "/qml/reports";
5858
//search_paths << qmlReportsDir();
5959
for(const QString &dir : search_paths) {
60-
//qfInfo() << "search_path:" << dir;
60+
qfMessage() << "search_path:" << dir;
6161
auto fn = dir + '/' + report_file_path;
62-
//qfInfo() << "trying:" << fn;
62+
qfMessage() << "trying:" << fn;
6363
QFileInfo fi(fn);
6464
if(fi.isFile()) {
65-
//qfInfo() << "HIT:" << fn;
65+
qfMessage() << "HIT:" << fn;
6666
return fn;
6767
}
6868
}

libqf/libqfqmlwidgets/src/tableview.cpp

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ TableView::TableView(QWidget *parent) :
5757
qfLogFuncFrame() << this;
5858
setItemDelegate(new TableItemDelegate(this));
5959
{
60-
HeaderView *h = new HeaderView(Qt::Horizontal, this);
60+
auto *h = new HeaderView(Qt::Horizontal, this);
6161
setHorizontalHeader(h);
6262
connect(this, &TableView::seekStringChanged, h, &HeaderView::setSeekString);
6363
}
6464
{
65-
HeaderView *h = new HeaderView(Qt::Vertical, this);
65+
auto *h = new HeaderView(Qt::Vertical, this);
6666
setVerticalHeader(h);
6767
}
6868
setSortingEnabled(true);
@@ -132,7 +132,7 @@ QAbstractProxyModel* TableView::lastProxyModel() const
132132
{
133133
QAbstractProxyModel *ret = nullptr;
134134
for(auto m=Super::model(); m; ) {
135-
QAbstractProxyModel *pxm = qobject_cast<QAbstractProxyModel*>(m);
135+
auto *pxm = qobject_cast<QAbstractProxyModel*>(m);
136136
if(pxm) {
137137
ret = pxm;
138138
m = pxm->sourceModel();
@@ -156,7 +156,7 @@ void TableView::setModel(QAbstractItemModel *model)
156156

157157
qf::core::model::TableModel *TableView::tableModel() const
158158
{
159-
qf::core::model::TableModel *ret = qobject_cast<qf::core::model::TableModel *>(lastProxyModel()->sourceModel());
159+
auto *ret = qobject_cast<qf::core::model::TableModel *>(lastProxyModel()->sourceModel());
160160
return ret;
161161
}
162162

@@ -355,8 +355,9 @@ void TableView::setDirtyRowsMenuSectionEnabled(bool b)
355355

356356
void TableView::setReadOnly(bool ro)
357357
{
358-
if(ro == isReadOnly())
358+
if(ro == isReadOnly()) {
359359
return;
360+
}
360361
m_isReadOnly = ro;
361362

362363
setEditRowsMenuSectionEnabled(!ro);
@@ -523,7 +524,7 @@ void TableView::paste()
523524
try {
524525
dialogs::Dialog dlg(this);
525526
dlg.setButtons(QDialogButtonBox::Ok);
526-
internal::TableViewCopyToDialogWidget *w = new internal::TableViewCopyToDialogWidget();
527+
auto *w = new internal::TableViewCopyToDialogWidget();
527528
dlg.setCentralWidget(w);
528529
int col_cnt = 0;
529530
{
@@ -567,7 +568,7 @@ void TableView::paste()
567568
r.clearEditFlags();
568569
}
569570
TableView *tv = w->tableView();
570-
qfm::TableModel *tm = new qfm::TableModel(tv);
571+
auto *tm = new qfm::TableModel(tv);
571572
tm->setTable(t);
572573
tv->setTableModel(tm);
573574
tv->setContextMenuActions(tv->contextMenuActionsForGroups(AllActions));
@@ -698,7 +699,7 @@ void TableView::editCellContentInEditor()
698699
cell_text = QString::fromUtf8(cell_value.toByteArray());
699700
else
700701
cell_text = cell_value.toString();
701-
TextEditWidget *w = new TextEditWidget(this);
702+
auto *w = new TextEditWidget(this);
702703
w->setText(cell_text);
703704
w->setSuggestedFileName("new_file.txt");
704705
/*
@@ -708,7 +709,7 @@ void TableView::editCellContentInEditor()
708709
}
709710
*/
710711
dialogs::Dialog dlg(this);
711-
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
712+
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
712713
QAbstractButton *bt_save = bb->addButton(QDialogButtonBox::Save);
713714
connect(bt_save, &QAbstractButton::clicked, &dlg, &QDialog::accept);
714715
dlg.setButtonBox(bb);
@@ -742,13 +743,13 @@ void TableView::exportCSV()
742743
if(!m)
743744
return;
744745

745-
qf::qmlwidgets::ExportCsvTableViewWidget *w = new qf::qmlwidgets::ExportCsvTableViewWidget(this, this);
746+
auto *w = new qf::qmlwidgets::ExportCsvTableViewWidget(this, this);
746747
if(!persistentSettingsPath().isEmpty()) {
747748
w->setPersistentOptionsPath(persistentSettingsPath() + "/exportCSV");
748749
w->loadPersistentOptions();
749750
}
750751
dialogs::Dialog dlg(this);
751-
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
752+
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
752753
QAbstractButton *bt_apply = bb->addButton(QDialogButtonBox::Apply);
753754
connect(bt_apply, &QAbstractButton::clicked, w, &qf::qmlwidgets::ExportCsvTableViewWidget::applyOptions, Qt::QueuedConnection);
754755
dlg.setButtonBox(bb);
@@ -762,13 +763,13 @@ void TableView::exportCSV()
762763
void TableView::exportReport()
763764
{
764765
qfLogFuncFrame();
765-
reports::PrintTableViewWidget *w = new reports::PrintTableViewWidget(this);
766+
auto *w = new reports::PrintTableViewWidget(this);
766767
if(!persistentSettingsPath().isEmpty()) {
767768
w->setPersistentOptionsPath(persistentSettingsPath() + "/exportReport");
768769
w->loadPersistentOptions();
769770
}
770771
dialogs::Dialog dlg(this);
771-
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
772+
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
772773
QAbstractButton *bt_apply = bb->addButton(QDialogButtonBox::Apply);
773774
connect(bt_apply, &QAbstractButton::clicked, w, &reports::PrintTableViewWidget::applyOptions, Qt::QueuedConnection);
774775
dlg.setButtonBox(bb);
@@ -931,7 +932,7 @@ void TableView::exportReport_helper(const QVariant& _options)
931932

932933
//qfInfo() << ttable.toString();
933934

934-
reports::ReportViewWidget *rw = new reports::ReportViewWidget(nullptr);
935+
auto *rw = new reports::ReportViewWidget(nullptr);
935936
rw->setTableData(QString(), ttable);
936937
QString report_fn = opts.value("report").toMap().value("fileName").toString();
937938
rw->setReport(report_fn);
@@ -1341,7 +1342,7 @@ void TableView::savePersistentSettings()
13411342
if(!path.isEmpty()) {
13421343
QSettings settings;
13431344
settings.beginGroup(path);
1344-
HeaderView *horiz_header = qobject_cast<HeaderView*>(horizontalHeader());
1345+
auto *horiz_header = qobject_cast<HeaderView*>(horizontalHeader());
13451346

13461347
QByteArray header_state = horiz_header->saveState();
13471348
settings.setValue("horizontalheader", QString::fromLatin1(header_state.toBase64()));
@@ -1357,7 +1358,7 @@ void TableView::onSqlException(const QString &what, const QString &where, const
13571358

13581359
void TableView::keyPressEvent(QKeyEvent *e)
13591360
{
1360-
qfLogFuncFrame() << "key:" << e->key() << "modifiers:" << e->modifiers();
1361+
// qfLogFuncFrame() << "key:" << e->key() << "modifiers:" << e->modifiers();
13611362
if(!model()) {
13621363
e->ignore();
13631364
return;
@@ -1375,12 +1376,12 @@ void TableView::keyPressEvent(QKeyEvent *e)
13751376
e->accept();
13761377
return;
13771378
}
1378-
else if(e->key() == Qt::Key_V) {
1379+
if(e->key() == Qt::Key_V) {
13791380
paste();
13801381
e->accept();
13811382
return;
13821383
}
1383-
else if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
1384+
if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
13841385
qfDebug() << "\tCTRL+ENTER";
13851386
postRow();
13861387
e->accept();
@@ -1458,9 +1459,7 @@ void TableView::keyPressEvent(QKeyEvent *e)
14581459
e->accept();
14591460
return;
14601461
}
1461-
else {
1462-
cancelSeek();
1463-
}
1462+
cancelSeek();
14641463
//bool event_should_be_accepted = false;
14651464
/// nejedna se o inkrementalni vyhledavani, zkusime editaci
14661465
if(state() == EditingState) {
@@ -1808,7 +1807,7 @@ void TableView::createActions()
18081807
a->setOid("select");
18091808
m_actionGroups[SelectActions] << a->oid();
18101809
m_actions[a->oid()] = a;
1811-
QMenu *m = new QMenu(this);
1810+
auto *m = new QMenu(this);
18121811
a->setMenu(m);
18131812
{
18141813
a = new Action(tr("Select current column"), this);
@@ -1835,7 +1834,7 @@ void TableView::createActions()
18351834
a->setOid("calculate");
18361835
m_actionGroups[CalculateActions] << a->oid();
18371836
m_actions[a->oid()] = a;
1838-
QMenu *m = new QMenu(this);
1837+
auto *m = new QMenu(this);
18391838
a->setMenu(m);
18401839
{
18411840
a = new Action(tr("Sum column"), this);
@@ -1855,7 +1854,7 @@ void TableView::createActions()
18551854
a->setOid("export");
18561855
m_actionGroups[ExportActions] << a->oid();
18571856
m_actions[a->oid()] = a;
1858-
QMenu *m = new QMenu(this);
1857+
auto *m = new QMenu(this);
18591858
a->setMenu(m);
18601859
{
18611860
a = new Action(tr("Report"), this);
@@ -1900,7 +1899,7 @@ void TableView::createActions()
19001899
a->setOid("import");
19011900
m_actionGroups[ImportActions] << a->oid();
19021901
m_actions[a->oid()] = a;
1903-
QMenu *m = new QMenu(this);
1902+
auto *m = new QMenu(this);
19041903
a->setMenu(m);
19051904
{
19061905
a = new Action(tr("CSV"), this);
@@ -2126,7 +2125,7 @@ void TableView::insertRowInline()
21262125
if(tri < 0) {
21272126
qfWarning() << "Valid proxy model index has invalid table model index!";
21282127
/// this can happen when one inserts to empty table ???? why ????
2129-
tri = ri = 0;
2128+
tri = 0;
21302129
}
21312130
}
21322131
tableModel()->insertRow(tri);
@@ -2247,9 +2246,7 @@ bool TableView::edit(const QModelIndex& index, EditTrigger trigger, QEvent* even
22472246
}
22482247
else {
22492248
if(trigger == QTableView::DoubleClicked || trigger == QTableView::EditKeyPressed) {
2250-
if(read_only) {
2251-
}
2252-
else {
2249+
if(!read_only) {
22532250
emit editCellRequest(index);
22542251
QVariant id = selectedRow().value(idColumnName());
22552252
if(id.isValid()) {

libqf/libqfqmlwidgets/src/tableviewtoolbar.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ TableViewToolBar::TableViewToolBar(QWidget *parent) :
4141
#endif
4242
}
4343

44-
TableViewToolBar::~TableViewToolBar()
45-
{
46-
}
44+
4745

4846
void TableViewToolBar::setTableView(TableView *table_view)
4947
{
@@ -66,7 +64,7 @@ void TableViewToolBar::addPendingActions()
6664
Q_FOREACH(auto a, m_pendingActions)
6765
lst << a;
6866
addActions(lst);
69-
QLabel *lbl = new QLabel(tr("Filter"));
67+
auto *lbl = new QLabel(tr("Filter"));
7068
auto *style = Style::instance();
7169
QPixmap px = style->pixmap("find");
7270
lbl->setPixmap(px);

libqf/libqfqmlwidgets/src/tableviewtoolbar.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ class FilterCombo : public QComboBox
2929
class QFQMLWIDGETS_DECL_EXPORT TableViewToolBar : public QToolBar
3030
{
3131
Q_OBJECT
32+
33+
using Super = QToolBar;
34+
3235
Q_PROPERTY(qf::qmlwidgets::TableView* tableView READ tableView WRITE setTableView FINAL)
33-
private:
34-
typedef QToolBar Super;
3536
public:
3637
explicit TableViewToolBar(QWidget *parent = nullptr);
37-
~TableViewToolBar() Q_DECL_OVERRIDE;
38+
~TableViewToolBar() Q_DECL_OVERRIDE = default;
3839
public:
3940
void setTableView(TableView *table_view);
4041
qf::qmlwidgets::TableView* tableView() const { return m_tableView; }

quickevent/app/quickevent/CMakeLists.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,8 @@ add_executable(quickevent
4545
plugins/Classes/src/importcoursedef.cpp
4646

4747
plugins/Competitors/src/competitordocument.cpp
48-
plugins/Competitors/src/competitorsplugin.cpp
49-
plugins/Competitors/src/competitorswidget.cpp
50-
plugins/Competitors/src/competitorswidget.ui
5148
plugins/Competitors/src/competitorwidget.cpp
5249
plugins/Competitors/src/competitorwidget.ui
53-
plugins/Competitors/src/findregistrationedit.cpp
54-
plugins/Competitors/src/lentcardssettingspage.cpp
55-
plugins/Competitors/src/lentcardssettingspage.ui
56-
plugins/Competitors/src/registrationswidget.cpp
57-
plugins/Competitors/src/registrationswidget.ui
58-
plugins/Competitors/src/stationsbackupmemorywidget.cpp
59-
plugins/Competitors/src/stationsbackupmemorywidget.ui
6050

6151
plugins/Core/src/coreplugin.cpp
6252
plugins/Core/src/reportssettings.cpp
@@ -80,7 +70,11 @@ add_executable(quickevent
8070
plugins/Event/src/stagedocument.cpp
8171
plugins/Event/src/stagewidget.cpp
8272
plugins/Event/src/stagewidget.ui
83-
73+
plugins/Event/src/findregistrationedit.cpp
74+
plugins/Event/src/lentcardssettingspage.cpp
75+
plugins/Event/src/lentcardssettingspage.ui
76+
plugins/Event/src/registrationswidget.cpp
77+
plugins/Event/src/registrationswidget.ui
8478
plugins/Event/src/services/emmaclient.cpp
8579
plugins/Event/src/services/emmaclientwidget.cpp
8680
plugins/Event/src/services/emmaclientwidget.ui
@@ -187,7 +181,7 @@ add_executable(quickevent
187181
quickevent.rc
188182

189183
plugins/Classes/qml/reports/table.qml
190-
plugins/Competitors/qml/reports/competitorsStatistics.qml
184+
191185
plugins/Event/qml/DbSchema.qml
192186
plugins/Event/qml/sql/def/Boolean.qml
193187
plugins/Event/qml/sql/def/Date.qml
@@ -205,16 +199,19 @@ add_executable(quickevent
205199
plugins/Event/qml/sql/def/Table.qml
206200
plugins/Event/qml/sql/def/Time.qml
207201
plugins/Event/qml/sql/def/private/FieldType.qml
202+
208203
plugins/Receipts/qml/reports/error.qml
209204
plugins/Receipts/qml/reports/sicard.qml
210205
plugins/Receipts/qml/reports/receipts/Classic.qml
211206
plugins/Receipts/qml/reports/receipts/ClassicLottery.qml
212207
plugins/Receipts/qml/reports/receipts/Default.qml
213208
plugins/Receipts/qml/reports/receipts/private/LotteryTicket.qml
209+
214210
plugins/Relays/qml/reports/results.qml
215211
plugins/Relays/qml/reports/results_condensed.qml
216212
plugins/Relays/qml/reports/startList_classes.qml
217213
plugins/Relays/qml/reports/startList_clubs.qml
214+
218215
plugins/Runs/qml/reports/competitorsWithCardRent.qml
219216
plugins/Runs/qml/reports/results_nstages.qml
220217
plugins/Runs/qml/reports/results_nstagesSpeaker.qml
@@ -231,6 +228,8 @@ add_executable(quickevent
231228
plugins/Runs/qml/reports/awards/results_stage_awards-hsh-2023.qml
232229
plugins/Runs/qml/reports/awards/results_stage_awards-hsh.qml
233230
plugins/Runs/qml/reports/awards/results_stage_awards.qml
231+
plugins/Runs/qml/reports/competitorsStatistics.qml
232+
234233
plugins/shared/qml/reports/Cell.qml
235234
plugins/shared/qml/reports/HeaderCell.qml
236235
plugins/shared/qml/reports/QfObject.qml
@@ -269,6 +268,6 @@ install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_BINDIR}/translations)
269268

270269
#install(DIRECTORY plugins/Runs/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/Runs/qml)
271270
#install(DIRECTORY plugins/Receipts/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/Receipts/qml)
272-
foreach(plugin IN ITEMS Classes Competitors Runs Relays Receipts shared)
271+
foreach(plugin IN ITEMS Classes Runs Relays Receipts shared)
273272
install(DIRECTORY plugins/${plugin}/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/${plugin}/qml)
274273
endforeach()

0 commit comments

Comments
 (0)