File indexing completed on 2024-12-01 03:47:54
0001 /* 0002 SPDX-FileCopyrightText: 2003 Russell Steffen <rsteffen@bayarea.net> 0003 SPDX-FileCopyrightText: 2003 Stephan Zehetner <s.zehetner@nevox.org> 0004 SPDX-FileCopyrightText: 2006 Dmitry Suzdalev <dimsuz@gmail.com> 0005 SPDX-FileCopyrightText: 2006 Inge Wallin <inge@lysator.liu.se> 0006 SPDX-FileCopyrightText: 2006 Pierre Ducroquet <pinaraf@gmail.com> 0007 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #include "scoredlg.h" 0012 0013 #include <QDialogButtonBox> 0014 #include <QPushButton> 0015 #include <QVBoxLayout> 0016 0017 ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, const QList<Player *> &players ) 0018 : QDialog(parent) 0019 { 0020 setObjectName( QStringLiteral( "ScoreDlg" ) ); 0021 setModal( true ); 0022 setWindowTitle(title); 0023 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); 0024 QWidget *mainWidget = new QWidget(this); 0025 QVBoxLayout *mainLayout = new QVBoxLayout; 0026 setLayout(mainLayout); 0027 mainLayout->addWidget(mainWidget); 0028 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); 0029 okButton->setDefault(true); 0030 okButton->setShortcut(Qt::CTRL | Qt::Key_Return); 0031 connect(buttonBox, &QDialogButtonBox::accepted, this, &ScoreDlg::accept); 0032 connect(buttonBox, &QDialogButtonBox::rejected, this, &ScoreDlg::reject); 0033 0034 m_standingsWidget = new StandingsWidget(this, players); 0035 mainLayout->addWidget(m_standingsWidget ); 0036 mainLayout->addWidget(buttonBox); 0037 } 0038 0039 0040 ScoreDlg::~ScoreDlg() 0041 { 0042 }