Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/necrolog
6 changes: 3 additions & 3 deletions libqf/libqfqmlwidgets/src/framework/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ QString Plugin::findReportFile(const QString &report_file_path) const
search_paths << effectiveReportsDir() + '/' + m_featureId + "/qml/reports";
//search_paths << qmlReportsDir();
for(const QString &dir : search_paths) {
//qfInfo() << "search_path:" << dir;
qfMessage() << "search_path:" << dir;
auto fn = dir + '/' + report_file_path;
//qfInfo() << "trying:" << fn;
qfMessage() << "trying:" << fn;
QFileInfo fi(fn);
if(fi.isFile()) {
//qfInfo() << "HIT:" << fn;
qfMessage() << "HIT:" << fn;
return fn;
}
}
Expand Down
55 changes: 26 additions & 29 deletions libqf/libqfqmlwidgets/src/tableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ TableView::TableView(QWidget *parent) :
qfLogFuncFrame() << this;
setItemDelegate(new TableItemDelegate(this));
{
HeaderView *h = new HeaderView(Qt::Horizontal, this);
auto *h = new HeaderView(Qt::Horizontal, this);
setHorizontalHeader(h);
connect(this, &TableView::seekStringChanged, h, &HeaderView::setSeekString);
}
{
HeaderView *h = new HeaderView(Qt::Vertical, this);
auto *h = new HeaderView(Qt::Vertical, this);
setVerticalHeader(h);
}
setSortingEnabled(true);
Expand Down Expand Up @@ -132,7 +132,7 @@ QAbstractProxyModel* TableView::lastProxyModel() const
{
QAbstractProxyModel *ret = nullptr;
for(auto m=Super::model(); m; ) {
QAbstractProxyModel *pxm = qobject_cast<QAbstractProxyModel*>(m);
auto *pxm = qobject_cast<QAbstractProxyModel*>(m);
if(pxm) {
ret = pxm;
m = pxm->sourceModel();
Expand All @@ -156,7 +156,7 @@ void TableView::setModel(QAbstractItemModel *model)

qf::core::model::TableModel *TableView::tableModel() const
{
qf::core::model::TableModel *ret = qobject_cast<qf::core::model::TableModel *>(lastProxyModel()->sourceModel());
auto *ret = qobject_cast<qf::core::model::TableModel *>(lastProxyModel()->sourceModel());
return ret;
}

Expand Down Expand Up @@ -355,8 +355,9 @@ void TableView::setDirtyRowsMenuSectionEnabled(bool b)

void TableView::setReadOnly(bool ro)
{
if(ro == isReadOnly())
if(ro == isReadOnly()) {
return;
}
m_isReadOnly = ro;

setEditRowsMenuSectionEnabled(!ro);
Expand Down Expand Up @@ -523,7 +524,7 @@ void TableView::paste()
try {
dialogs::Dialog dlg(this);
dlg.setButtons(QDialogButtonBox::Ok);
internal::TableViewCopyToDialogWidget *w = new internal::TableViewCopyToDialogWidget();
auto *w = new internal::TableViewCopyToDialogWidget();
dlg.setCentralWidget(w);
int col_cnt = 0;
{
Expand Down Expand Up @@ -567,7 +568,7 @@ void TableView::paste()
r.clearEditFlags();
}
TableView *tv = w->tableView();
qfm::TableModel *tm = new qfm::TableModel(tv);
auto *tm = new qfm::TableModel(tv);
tm->setTable(t);
tv->setTableModel(tm);
tv->setContextMenuActions(tv->contextMenuActionsForGroups(AllActions));
Expand Down Expand Up @@ -698,7 +699,7 @@ void TableView::editCellContentInEditor()
cell_text = QString::fromUtf8(cell_value.toByteArray());
else
cell_text = cell_value.toString();
TextEditWidget *w = new TextEditWidget(this);
auto *w = new TextEditWidget(this);
w->setText(cell_text);
w->setSuggestedFileName("new_file.txt");
/*
Expand All @@ -708,7 +709,7 @@ void TableView::editCellContentInEditor()
}
*/
dialogs::Dialog dlg(this);
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
QAbstractButton *bt_save = bb->addButton(QDialogButtonBox::Save);
connect(bt_save, &QAbstractButton::clicked, &dlg, &QDialog::accept);
dlg.setButtonBox(bb);
Expand Down Expand Up @@ -742,13 +743,13 @@ void TableView::exportCSV()
if(!m)
return;

qf::qmlwidgets::ExportCsvTableViewWidget *w = new qf::qmlwidgets::ExportCsvTableViewWidget(this, this);
auto *w = new qf::qmlwidgets::ExportCsvTableViewWidget(this, this);
if(!persistentSettingsPath().isEmpty()) {
w->setPersistentOptionsPath(persistentSettingsPath() + "/exportCSV");
w->loadPersistentOptions();
}
dialogs::Dialog dlg(this);
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
QAbstractButton *bt_apply = bb->addButton(QDialogButtonBox::Apply);
connect(bt_apply, &QAbstractButton::clicked, w, &qf::qmlwidgets::ExportCsvTableViewWidget::applyOptions, Qt::QueuedConnection);
dlg.setButtonBox(bb);
Expand All @@ -762,13 +763,13 @@ void TableView::exportCSV()
void TableView::exportReport()
{
qfLogFuncFrame();
reports::PrintTableViewWidget *w = new reports::PrintTableViewWidget(this);
auto *w = new reports::PrintTableViewWidget(this);
if(!persistentSettingsPath().isEmpty()) {
w->setPersistentOptionsPath(persistentSettingsPath() + "/exportReport");
w->loadPersistentOptions();
}
dialogs::Dialog dlg(this);
DialogButtonBox *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
auto *bb = new DialogButtonBox(QDialogButtonBox::Cancel, this);
QAbstractButton *bt_apply = bb->addButton(QDialogButtonBox::Apply);
connect(bt_apply, &QAbstractButton::clicked, w, &reports::PrintTableViewWidget::applyOptions, Qt::QueuedConnection);
dlg.setButtonBox(bb);
Expand Down Expand Up @@ -931,7 +932,7 @@ void TableView::exportReport_helper(const QVariant& _options)

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

reports::ReportViewWidget *rw = new reports::ReportViewWidget(nullptr);
auto *rw = new reports::ReportViewWidget(nullptr);
rw->setTableData(QString(), ttable);
QString report_fn = opts.value("report").toMap().value("fileName").toString();
rw->setReport(report_fn);
Expand Down Expand Up @@ -1341,7 +1342,7 @@ void TableView::savePersistentSettings()
if(!path.isEmpty()) {
QSettings settings;
settings.beginGroup(path);
HeaderView *horiz_header = qobject_cast<HeaderView*>(horizontalHeader());
auto *horiz_header = qobject_cast<HeaderView*>(horizontalHeader());

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

void TableView::keyPressEvent(QKeyEvent *e)
{
qfLogFuncFrame() << "key:" << e->key() << "modifiers:" << e->modifiers();
// qfLogFuncFrame() << "key:" << e->key() << "modifiers:" << e->modifiers();
if(!model()) {
e->ignore();
return;
Expand All @@ -1375,12 +1376,12 @@ void TableView::keyPressEvent(QKeyEvent *e)
e->accept();
return;
}
else if(e->key() == Qt::Key_V) {
if(e->key() == Qt::Key_V) {
paste();
e->accept();
return;
}
else if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
qfDebug() << "\tCTRL+ENTER";
postRow();
e->accept();
Expand Down Expand Up @@ -1458,9 +1459,7 @@ void TableView::keyPressEvent(QKeyEvent *e)
e->accept();
return;
}
else {
cancelSeek();
}
cancelSeek();
//bool event_should_be_accepted = false;
/// nejedna se o inkrementalni vyhledavani, zkusime editaci
if(state() == EditingState) {
Expand Down Expand Up @@ -1808,7 +1807,7 @@ void TableView::createActions()
a->setOid("select");
m_actionGroups[SelectActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto *m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Select current column"), this);
Expand All @@ -1835,7 +1834,7 @@ void TableView::createActions()
a->setOid("calculate");
m_actionGroups[CalculateActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto *m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Sum column"), this);
Expand All @@ -1855,7 +1854,7 @@ void TableView::createActions()
a->setOid("export");
m_actionGroups[ExportActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto *m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("Report"), this);
Expand Down Expand Up @@ -1900,7 +1899,7 @@ void TableView::createActions()
a->setOid("import");
m_actionGroups[ImportActions] << a->oid();
m_actions[a->oid()] = a;
QMenu *m = new QMenu(this);
auto *m = new QMenu(this);
a->setMenu(m);
{
a = new Action(tr("CSV"), this);
Expand Down Expand Up @@ -2126,7 +2125,7 @@ void TableView::insertRowInline()
if(tri < 0) {
qfWarning() << "Valid proxy model index has invalid table model index!";
/// this can happen when one inserts to empty table ???? why ????
tri = ri = 0;
tri = 0;
}
}
tableModel()->insertRow(tri);
Expand Down Expand Up @@ -2247,9 +2246,7 @@ bool TableView::edit(const QModelIndex& index, EditTrigger trigger, QEvent* even
}
else {
if(trigger == QTableView::DoubleClicked || trigger == QTableView::EditKeyPressed) {
if(read_only) {
}
else {
if(!read_only) {
emit editCellRequest(index);
QVariant id = selectedRow().value(idColumnName());
if(id.isValid()) {
Expand Down
6 changes: 2 additions & 4 deletions libqf/libqfqmlwidgets/src/tableviewtoolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ TableViewToolBar::TableViewToolBar(QWidget *parent) :
#endif
}

TableViewToolBar::~TableViewToolBar()
{
}


void TableViewToolBar::setTableView(TableView *table_view)
{
Expand All @@ -66,7 +64,7 @@ void TableViewToolBar::addPendingActions()
Q_FOREACH(auto a, m_pendingActions)
lst << a;
addActions(lst);
QLabel *lbl = new QLabel(tr("Filter"));
auto *lbl = new QLabel(tr("Filter"));
auto *style = Style::instance();
QPixmap px = style->pixmap("find");
lbl->setPixmap(px);
Expand Down
7 changes: 4 additions & 3 deletions libqf/libqfqmlwidgets/src/tableviewtoolbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ class FilterCombo : public QComboBox
class QFQMLWIDGETS_DECL_EXPORT TableViewToolBar : public QToolBar
{
Q_OBJECT

using Super = QToolBar;

Q_PROPERTY(qf::qmlwidgets::TableView* tableView READ tableView WRITE setTableView FINAL)
private:
typedef QToolBar Super;
public:
explicit TableViewToolBar(QWidget *parent = nullptr);
~TableViewToolBar() Q_DECL_OVERRIDE;
~TableViewToolBar() Q_DECL_OVERRIDE = default;
public:
void setTableView(TableView *table_view);
qf::qmlwidgets::TableView* tableView() const { return m_tableView; }
Expand Down
25 changes: 12 additions & 13 deletions quickevent/app/quickevent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,8 @@ add_executable(quickevent
plugins/Classes/src/importcoursedef.cpp

plugins/Competitors/src/competitordocument.cpp
plugins/Competitors/src/competitorsplugin.cpp
plugins/Competitors/src/competitorswidget.cpp
plugins/Competitors/src/competitorswidget.ui
plugins/Competitors/src/competitorwidget.cpp
plugins/Competitors/src/competitorwidget.ui
plugins/Competitors/src/findregistrationedit.cpp
plugins/Competitors/src/lentcardssettingspage.cpp
plugins/Competitors/src/lentcardssettingspage.ui
plugins/Competitors/src/registrationswidget.cpp
plugins/Competitors/src/registrationswidget.ui
plugins/Competitors/src/stationsbackupmemorywidget.cpp
plugins/Competitors/src/stationsbackupmemorywidget.ui

plugins/Core/src/coreplugin.cpp
plugins/Core/src/reportssettings.cpp
Expand All @@ -80,7 +70,11 @@ add_executable(quickevent
plugins/Event/src/stagedocument.cpp
plugins/Event/src/stagewidget.cpp
plugins/Event/src/stagewidget.ui

plugins/Event/src/findregistrationedit.cpp
plugins/Event/src/lentcardssettingspage.cpp
plugins/Event/src/lentcardssettingspage.ui
plugins/Event/src/registrationswidget.cpp
plugins/Event/src/registrationswidget.ui
plugins/Event/src/services/emmaclient.cpp
plugins/Event/src/services/emmaclientwidget.cpp
plugins/Event/src/services/emmaclientwidget.ui
Expand Down Expand Up @@ -187,7 +181,7 @@ add_executable(quickevent
quickevent.rc

plugins/Classes/qml/reports/table.qml
plugins/Competitors/qml/reports/competitorsStatistics.qml

plugins/Event/qml/DbSchema.qml
plugins/Event/qml/sql/def/Boolean.qml
plugins/Event/qml/sql/def/Date.qml
Expand All @@ -205,16 +199,19 @@ add_executable(quickevent
plugins/Event/qml/sql/def/Table.qml
plugins/Event/qml/sql/def/Time.qml
plugins/Event/qml/sql/def/private/FieldType.qml

plugins/Receipts/qml/reports/error.qml
plugins/Receipts/qml/reports/sicard.qml
plugins/Receipts/qml/reports/receipts/Classic.qml
plugins/Receipts/qml/reports/receipts/ClassicLottery.qml
plugins/Receipts/qml/reports/receipts/Default.qml
plugins/Receipts/qml/reports/receipts/private/LotteryTicket.qml

plugins/Relays/qml/reports/results.qml
plugins/Relays/qml/reports/results_condensed.qml
plugins/Relays/qml/reports/startList_classes.qml
plugins/Relays/qml/reports/startList_clubs.qml

plugins/Runs/qml/reports/competitorsWithCardRent.qml
plugins/Runs/qml/reports/results_nstages.qml
plugins/Runs/qml/reports/results_nstagesSpeaker.qml
Expand All @@ -231,6 +228,8 @@ add_executable(quickevent
plugins/Runs/qml/reports/awards/results_stage_awards-hsh-2023.qml
plugins/Runs/qml/reports/awards/results_stage_awards-hsh.qml
plugins/Runs/qml/reports/awards/results_stage_awards.qml
plugins/Runs/qml/reports/competitorsStatistics.qml

plugins/shared/qml/reports/Cell.qml
plugins/shared/qml/reports/HeaderCell.qml
plugins/shared/qml/reports/QfObject.qml
Expand Down Expand Up @@ -269,6 +268,6 @@ install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_BINDIR}/translations)

#install(DIRECTORY plugins/Runs/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/Runs/qml)
#install(DIRECTORY plugins/Receipts/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/Receipts/qml)
foreach(plugin IN ITEMS Classes Competitors Runs Relays Receipts shared)
foreach(plugin IN ITEMS Classes Runs Relays Receipts shared)
install(DIRECTORY plugins/${plugin}/qml/reports DESTINATION ${CMAKE_INSTALL_BINDIR}/reports/${plugin}/qml)
endforeach()
Loading
Loading