DGameTree::DGameTree(QWidget* parent_widget) : QTreeWidget(parent_widget) { m_ui = std::make_unique<Ui::DGameTree>(); m_ui->setupUi(this); SetViewStyle(STYLE_TREE); setIconSize(QSize(BANNER_WIDTH, BANNER_HEIGHT)); sortByColumn(COL_TITLE, Qt::AscendingOrder); connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(ItemActivated(QTreeWidgetItem*))); }
DGameTracker::DGameTracker(QWidget* parent_widget) : QStackedWidget(parent_widget), m_watcher(this) { connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(ScanForGames())); m_tree_widget = new DGameTree(this); addWidget(m_tree_widget); connect(m_tree_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame())); m_grid_widget = new DGameGrid(this); addWidget(m_grid_widget); connect(m_grid_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame())); SetViewStyle(STYLE_LIST); }
DGameTracker::DGameTracker(QWidget* parent_widget) : QStackedWidget(parent_widget), m_watcher(new QFileSystemWatcher(this)) { connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &DGameTracker::ScanForGames); m_tree_widget = new DGameTree(this); addWidget(m_tree_widget); connect(m_tree_widget, &DGameTree::StartGame, this, &DGameTracker::StartGame); m_grid_widget = new DGameGrid(this); addWidget(m_grid_widget); connect(m_grid_widget, &DGameGrid::StartGame, this, &DGameTracker::StartGame); SetViewStyle(STYLE_LIST); }