mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12:15 -07:00
Debug messages.
This commit is contained in:
parent
6c60fc482b
commit
d6f3f876c3
5 changed files with 35 additions and 3 deletions
|
|
@ -27,7 +27,12 @@ CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent,
|
||||||
banner = new BannerWidget(this, cardGroupCategory, Qt::Orientation::Vertical, bannerOpacity);
|
banner = new BannerWidget(this, cardGroupCategory, Qt::Orientation::Vertical, bannerOpacity);
|
||||||
|
|
||||||
layout->addWidget(banner);
|
layout->addWidget(banner);
|
||||||
CardGroupDisplayWidget::updateCardDisplays();
|
qInfo() << "Tracked index (default CardGroupDisplayWidget): " << cardGroupCategory << " (" << zoneName << ")"
|
||||||
|
<< "_trackedIndex.isValid()=" << _trackedIndex.isValid()
|
||||||
|
<< "row=" << _trackedIndex.row()
|
||||||
|
<< "column=" << _trackedIndex.column()
|
||||||
|
<< "parent(row)=" << _trackedIndex.parent().row()
|
||||||
|
<< "parent(column)=" << _trackedIndex.parent().column();
|
||||||
|
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &CardGroupDisplayWidget::onCardAddition);
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &CardGroupDisplayWidget::onCardAddition);
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &CardGroupDisplayWidget::onCardRemoval);
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &CardGroupDisplayWidget::onCardRemoval);
|
||||||
|
|
@ -58,7 +63,7 @@ QWidget* CardGroupDisplayWidget::constructWidgetForIndex(int rowIndex)
|
||||||
|
|
||||||
void CardGroupDisplayWidget::updateCardDisplays()
|
void CardGroupDisplayWidget::updateCardDisplays()
|
||||||
{
|
{
|
||||||
qInfo() << "Constructing Card Display Widgets for Card Group Display widget";
|
qInfo() << "Constructing Card Display Widgets for Card Group Display widget for zone: " << cardGroupCategory;
|
||||||
qInfo() << deckListModel->data(trackedIndex.sibling(trackedIndex.row(), 1), Qt::EditRole).toString() << " has "
|
qInfo() << deckListModel->data(trackedIndex.sibling(trackedIndex.row(), 1), Qt::EditRole).toString() << " has "
|
||||||
<< deckListModel->rowCount(trackedIndex.sibling(trackedIndex.row(), 0)) << " entries.";
|
<< deckListModel->rowCount(trackedIndex.sibling(trackedIndex.row(), 0)) << " entries.";
|
||||||
for (int i = 0; i < deckListModel->rowCount(trackedIndex); ++i) {
|
for (int i = 0; i < deckListModel->rowCount(trackedIndex); ++i) {
|
||||||
|
|
@ -69,6 +74,13 @@ void CardGroupDisplayWidget::updateCardDisplays()
|
||||||
void CardGroupDisplayWidget::onCardAddition(const QModelIndex &parent, int first, int last)
|
void CardGroupDisplayWidget::onCardAddition(const QModelIndex &parent, int first, int last)
|
||||||
{
|
{
|
||||||
if (parent == trackedIndex) {
|
if (parent == trackedIndex) {
|
||||||
|
qInfo() << "Tracked index (default CardGroupDisplayWidget): " << cardGroupCategory << " (" << zoneName << ")"
|
||||||
|
<< "_trackedIndex.isValid()=" << trackedIndex.isValid()
|
||||||
|
<< "row=" << trackedIndex.row()
|
||||||
|
<< "column=" << trackedIndex.column()
|
||||||
|
<< "parent(row)=" << trackedIndex.parent().row()
|
||||||
|
<< "parent(column)=" << trackedIndex.parent().column();
|
||||||
|
qInfo() << "Card addition to " << cardGroupCategory;
|
||||||
for (int i = first; i <= last; i++) {
|
for (int i = first; i <= last; i++) {
|
||||||
insertIntoLayout(constructWidgetForIndex(i), i);
|
insertIntoLayout(constructWidgetForIndex(i), i);
|
||||||
}
|
}
|
||||||
|
|
@ -81,6 +93,7 @@ void CardGroupDisplayWidget::onCardRemoval(const QModelIndex &parent, int first,
|
||||||
Q_UNUSED(first);
|
Q_UNUSED(first);
|
||||||
Q_UNUSED(last);
|
Q_UNUSED(last);
|
||||||
if (parent == trackedIndex) {
|
if (parent == trackedIndex) {
|
||||||
|
qInfo() << "Card removal from " << cardGroupCategory;
|
||||||
for (const QPersistentModelIndex &idx : indexToWidgetMap.keys()) {
|
for (const QPersistentModelIndex &idx : indexToWidgetMap.keys()) {
|
||||||
if (!idx.isValid()) {
|
if (!idx.isValid()) {
|
||||||
removeFromLayout(indexToWidgetMap.value(idx));
|
removeFromLayout(indexToWidgetMap.value(idx));
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ FlatCardGroupDisplayWidget::FlatCardGroupDisplayWidget(QWidget *parent,
|
||||||
banner->setBuddy(flowWidget);
|
banner->setBuddy(flowWidget);
|
||||||
|
|
||||||
layout->addWidget(flowWidget);
|
layout->addWidget(flowWidget);
|
||||||
|
qInfo() << "Initialized a flat CardGroupDisplayWidget";
|
||||||
FlatCardGroupDisplayWidget::updateCardDisplays();
|
FlatCardGroupDisplayWidget::updateCardDisplays();
|
||||||
// connect(deckListModel, &DeckListModel::dataChanged, this, &FlatCardGroupDisplayWidget::updateCardDisplays);
|
// connect(deckListModel, &DeckListModel::dataChanged, this, &FlatCardGroupDisplayWidget::updateCardDisplays);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ OverlappedCardGroupDisplayWidget::OverlappedCardGroupDisplayWidget(QWidget *pare
|
||||||
banner->setBuddy(overlapWidget);
|
banner->setBuddy(overlapWidget);
|
||||||
|
|
||||||
layout->addWidget(overlapWidget);
|
layout->addWidget(overlapWidget);
|
||||||
|
qInfo() << "Initialized an overlap CardGroupDisplayWidget";
|
||||||
OverlappedCardGroupDisplayWidget::updateCardDisplays();
|
OverlappedCardGroupDisplayWidget::updateCardDisplays();
|
||||||
|
|
||||||
connect(cardSizeWidget->getSlider(), &QSlider::valueChanged, this,
|
connect(cardSizeWidget->getSlider(), &QSlider::valueChanged, this,
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,27 @@ DeckCardZoneDisplayWidget::DeckCardZoneDisplayWidget(QWidget *parent,
|
||||||
// connect(deckListModel, &DeckListModel::dataChanged, this, &DeckCardZoneDisplayWidget::decklistDataChanged);
|
// connect(deckListModel, &DeckListModel::dataChanged, this, &DeckCardZoneDisplayWidget::decklistDataChanged);
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &DeckCardZoneDisplayWidget::onCategoryAddition);
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &DeckCardZoneDisplayWidget::onCategoryAddition);
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &DeckCardZoneDisplayWidget::onCategoryRemoval);
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &DeckCardZoneDisplayWidget::onCategoryRemoval);
|
||||||
|
|
||||||
|
qInfo() << "Tracked index:" << zoneName << "_trackedIndex.isValid()=" << _trackedIndex.isValid()
|
||||||
|
<< "row=" << _trackedIndex.row() << "column=" << _trackedIndex.column()
|
||||||
|
<< "parent(row)=" << _trackedIndex.parent().row() << "parent(column)=" << _trackedIndex.parent().column()
|
||||||
|
<< "parent(valid)=" << _trackedIndex.parent().isValid();
|
||||||
}
|
}
|
||||||
|
qInfo() << "Cleaning up invalid card group " << displayWidget->cardGroupCategory << " from " << displayWidget->zoneName;
|
||||||
|
qInfo() << "Cleaned.";
|
||||||
|
qInfo() << categoryName << " is already contained in the index to widget map";
|
||||||
|
qInfo() << categoryName << " needs a widget";
|
||||||
|
qInfo() << "It's getting an overlap widget.";
|
||||||
|
qInfo() << "Getting a flat widget for christmas";
|
||||||
|
qInfo() << "Constructing Group Display Widgets for Zone Display widget";
|
||||||
|
qInfo() << deckListModel->data(trackedIndex.sibling(trackedIndex.row(), 1), Qt::EditRole).toString() << " has "
|
||||||
|
<< deckListModel->rowCount(trackedIndex.sibling(trackedIndex.row(), 0)) << " entries.";
|
||||||
|
|
||||||
void DeckCardZoneDisplayWidget::onCategoryAddition(const QModelIndex &parent, int first, int last)
|
void DeckCardZoneDisplayWidget::onCategoryAddition(const QModelIndex &parent, int first, int last)
|
||||||
{
|
{
|
||||||
if (parent == trackedIndex) {
|
if (parent == trackedIndex) {
|
||||||
qInfo() << deckListModel->data(trackedIndex.sibling(trackedIndex.row(), 1), Qt::EditRole).toString() << " zone thinks it has a new category";
|
qInfo() << deckListModel->data(trackedIndex.sibling(trackedIndex.row(), 1), Qt::EditRole).toString()
|
||||||
|
<< " zone thinks it has a new category";
|
||||||
for (int i = first; i <= last; i++) {
|
for (int i = first; i <= last; i++) {
|
||||||
QPersistentModelIndex index = QPersistentModelIndex(deckListModel->index(i, 0, trackedIndex));
|
QPersistentModelIndex index = QPersistentModelIndex(deckListModel->index(i, 0, trackedIndex));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,8 @@ void VisualDeckEditorWidget::retranslateUi()
|
||||||
displayTypeButton->setToolTip(
|
displayTypeButton->setToolTip(
|
||||||
tr("Change how cards are displayed within zones (i.e. overlapped or fully visible.)"));
|
tr("Change how cards are displayed within zones (i.e. overlapped or fully visible.)"));
|
||||||
}
|
}
|
||||||
|
qInfo() << "Cleaning up invalid card zone " << displayWidget->zoneName;
|
||||||
|
qInfo() << "Cleaned.";
|
||||||
|
|
||||||
void VisualDeckEditorWidget::onCardAddition(const QModelIndex &parent, int first, int last)
|
void VisualDeckEditorWidget::onCardAddition(const QModelIndex &parent, int first, int last)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue