явно указываем в .cpp коде имя первого столбца
[novacoin.git] / src / qt / overviewpage.cpp
index 898f940..21cdba0 100644 (file)
@@ -45,7 +45,11 @@ public:
         bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();
         QVariant value = index.data(Qt::ForegroundRole);
         QColor foreground = option.palette.color(QPalette::Text);
+#if QT_VERSION < 0x050000
         if(qVariantCanConvert<QColor>(value))
+#else
+        if(value.canConvert(QMetaType::QColor))
+#endif
         {
             foreground = qvariant_cast<QColor>(value);
         }
@@ -154,6 +158,14 @@ void OverviewPage::setBalance(qint64 total, qint64 watchOnly, qint64 stake, qint
     bool showWatchOnly = watchOnly != 0;
     ui->labelBalanceWatchOnly->setVisible(showWatchOnly);
     ui->labelBalanceWatchOnlyText->setVisible(showWatchOnly);
+   
+}
+
+// show/hide watch-only labels
+void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly)
+{
+    ui->labelBalanceWatchOnly->setVisible(showWatchOnly);
+    ui->labelBalanceWatchOnlyText->setVisible(showWatchOnly);
 }
 
 void OverviewPage::setNumTransactions(int count)
@@ -186,6 +198,9 @@ void OverviewPage::setModel(WalletModel *model)
         connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
 
         connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
+
+        updateWatchOnlyLabels(model->haveWatchOnly());
+        connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool)));
     }
 
     // update the display unit, to not use the default ("BTC")