void Room::setupUI(void) { gamesListModel = new GamesListModel(); gamesView->setModel(gamesListModel); //IGS needs bigger rank column with the "+"s, etc., also whole thing looks sloppy FIXME gamesView->setColumnWidth ( 0, 40 ); //35 gamesView->setColumnWidth ( 1, 100 ); gamesView->setColumnWidth ( 2, 40 ); //35 gamesView->setColumnWidth ( 3, 100 ); gamesView->setColumnWidth ( 4, 40 ); //35 gamesView->setColumnWidth ( 5, 30 ); //30 gamesView->setColumnWidth ( 6, 30 ); //25 gamesView->setColumnWidth ( 7, 20 ); //20 gamesView->setColumnWidth ( 8, 35 ); //30 gamesView->setColumnWidth ( 9, 35 ); //25 gamesView->setColumnWidth ( 10, 35 ); //20 gamesView->setColumnWidth ( 11, 30 ); //25 playerListModel = new PlayerListModel(); playerView->setModel(playerListModel); playerListModel->setView(playerView); playerView->setColumnWidth ( 0, 40 ); playerView->setColumnWidth ( 1, 100 ); playerView->setColumnWidth ( 2, 40 ); playerView->setColumnWidth ( 3, 40 ); playerView->setColumnWidth ( 4, 40); playerView->setColumnWidth ( 5, 40 ); playerView->setColumnWidth ( 6, 40 ); playerView->setColumnWidth ( 7, 40 ); playerView->setColumnWidth ( 8, 80 ); /* Maybe also a "clicked" for something? */ connect(playerView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(slot_playersDoubleClicked(const QModelIndex &))); connect(playerView, SIGNAL(customContextMenuRequested (const QPoint &)), SLOT(slot_showPopup(const QPoint &))); connect(gamesView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(slot_gamesDoubleClicked(const QModelIndex &))); connect(gamesView, SIGNAL(customContextMenuRequested (const QPoint &)), SLOT(slot_showGamesPopup(const QPoint &))); connect(connectionWidget->ui->refreshPlayersButton, SIGNAL(pressed()), SLOT(slot_refreshPlayers())); connect(connectionWidget->ui->refreshGamesButton, SIGNAL(pressed()), SLOT(slot_refreshGames())); connect(editFriendsWatchesListButton, SIGNAL(pressed()), SLOT(slot_editFriendsWatchesList())); playerView->blockSignals(false); gamesView->blockSignals(false); }
void Room::setupUI(void) { gamesListModel = new GamesListModel(); /*ui.ListView_games->header()->setSortIndicatorShown ( FALSE ); ui.ListView_games->hideColumn(12); ui.ListView_games->hideColumn(13);*/ gamesView->setModel(gamesListModel); gamesView->setFilter(new GamesListFilter(gamesListModel)); /* Justifications??? */ /* No sort indicator??? */ /* Qt 4.4.1 made sortIndicatorShown necesssary for sort behavior * !!!! */ gamesView->header()->setSortIndicatorShown ( true ); //gamesView->setSelectionBehavior(QAbstractItemView::SelectRows); /*ui.gamesView->setColumnWidth ( 0, 40 ); //35 ui.gamesView->setColumnWidth ( 1, 100 ); ui.gamesView->setColumnWidth ( 2, 48 ); //35 ui.gamesView->setColumnWidth ( 3, 100 ); ui.gamesView->setColumnWidth ( 4, 48 ); //35 ui.gamesView->setColumnWidth ( 5, 45 ); //30 ui.gamesView->setColumnWidth ( 6, 45 ); //25 ui.gamesView->setColumnWidth ( 7, 38 ); //20 ui.gamesView->setColumnWidth ( 8, 35 ); //30 ui.gamesView->setColumnWidth ( 9, 43 ); //25 ui.gamesView->setColumnWidth ( 10, 60 ); //20 ui.gamesView->setColumnWidth ( 11, 55 ); //25 */ //IGS needs bigger rank column with the "+"s, etc., also whole thing looks sloppy FIXME gamesView->setColumnWidth ( 0, 40 ); //35 gamesView->setColumnWidth ( 1, 100 ); gamesView->setColumnWidth ( 2, 40 ); //35 gamesView->setColumnWidth ( 3, 100 ); gamesView->setColumnWidth ( 4, 40 ); //35 gamesView->setColumnWidth ( 5, 30 ); //30 gamesView->setColumnWidth ( 6, 30 ); //25 gamesView->setColumnWidth ( 7, 20 ); //20 gamesView->setColumnWidth ( 8, 35 ); //30 gamesView->setColumnWidth ( 9, 35 ); //25 gamesView->setColumnWidth ( 10, 35 ); //20 gamesView->setColumnWidth ( 11, 30 ); //25 //ui.gamesView->show(); playerListModel = new PlayerListModel(); /* FIXME the below seems to have no affect, so I commented it out. * I changed references to the listmodel to the sortproxy in the id * registries, in the hope that they would... well I think that was the * wrong way, but I can't be sure since it could be an issue with * the network connection as well... anyway, if I get it working * correctly, probably more like the way it was, then I should change * the sortproxy references back maybe... */ // playerView->setIconSize(QSize(20, 20)); playerView->setModel(playerListModel); playerListModel->setView(playerView); playerView->setFilter(new PlayerListFilter(playerListModel)); playerView->header()->setSortIndicatorShown ( true ); playerView->setColumnWidth ( 0, 40 ); playerView->setColumnWidth ( 1, 100 ); playerView->setColumnWidth ( 2, 40 ); playerView->setColumnWidth ( 3, 40 ); playerView->setColumnWidth ( 4, 40); playerView->setColumnWidth ( 5, 40 ); playerView->setColumnWidth ( 6, 40 ); playerView->setColumnWidth ( 7, 40 ); playerView->setColumnWidth ( 8, 80 ); /*ui.ListView_players->hideColumn(6); ui.ListView_players->hideColumn(7); ui.ListView_players->hideColumn(8); ui.ListView_players->hideColumn(9); ui.ListView_players->hideColumn(12); ui.ListView_players->setColumnWidth ( 0, 30 ); ui.ListView_players->setColumnWidth ( 1, 100 ); ui.ListView_players->setColumnWidth ( 2, 30 ); ui.ListView_players->setColumnWidth ( 3, 30 ); ui.ListView_players->setColumnWidth ( 4, 30); ui.ListView_players->setColumnWidth ( 5, 30 ); // ui.ListView_players->setColumnWidth ( 6, 80 ); ui.ListView_players->setColumnWidth ( 7, 80 ); // ui.ListView_players->setColumnWidth ( 8, 30 ); // ui.ListView_players->setColumnWidth ( 9, 25 ); ui.ListView_players->setColumnWidth ( 10, 50 ); // ui.ListView_players->setColumnWidth ( 11, 25 );*/ whoBox1->setCurrentIndex(0); whoBox2->setCurrentIndex(0); /* Maybe also a "clicked" for something? */ connect(playerView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(slot_playersDoubleClicked(const QModelIndex &))); connect(playerView, SIGNAL(customContextMenuRequested (const QPoint &)), SLOT(slot_showPopup(const QPoint &))); connect(gamesView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(slot_gamesDoubleClicked(const QModelIndex &))); connect(gamesView, SIGNAL(customContextMenuRequested (const QPoint &)), SLOT(slot_showGamesPopup(const QPoint &))); connect(refreshPlayersButton, SIGNAL(pressed()), SLOT(slot_refreshPlayers())); connect(refreshGamesButton, SIGNAL(pressed()), SLOT(slot_refreshGames())); connect(whoBox1, SIGNAL(currentIndexChanged(int)), SLOT(slot_setRankSpreadView())); connect(whoBox2, SIGNAL(currentIndexChanged(int)), SLOT(slot_setRankSpreadView())); connect(whoOpenCheckBox, SIGNAL(stateChanged(int)), SLOT(slot_showOpen(int))); connect(friendsCheckBox, SIGNAL(stateChanged(int)), SLOT(slot_showFriends(int))); connect(watchesCheckBox, SIGNAL(stateChanged(int)), SLOT(slot_showWatches(int))); connect(editFriendsWatchesListButton, SIGNAL(pressed()), SLOT(slot_editFriendsWatchesList())); editFriendsWatchesListButton->setEnabled(true); whoOpenCheckBox->setEnabled(true); friendsCheckBox->setEnabled(true); watchesCheckBox->setEnabled(true); playerView->blockSignals(false); gamesView->blockSignals(false); playerView->header()->blockSignals(false); gamesView->header()->blockSignals(false); }