Escher: Add more attributes when logging views

Change-Id: Ic8632e7fbfcaba143f7ff0ea4965f6a34948f041
This commit is contained in:
Romain Goyet
2016-05-27 12:17:51 +02:00
parent 8f30223aab
commit 97be08027f
7 changed files with 21 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ public:
protected:
#if ESCHER_VIEW_LOGGING
const char * className() const override;
void logAttributes(std::ostream &os) const override;
#endif
private:
KDColor m_color;

View File

@@ -19,6 +19,7 @@ public:
protected:
#if ESCHER_VIEW_LOGGING
const char * className() const override;
void logAttributes(std::ostream &os) const override;
#endif
void storeSubviewAtIndex(View * view, int index) override;
private:

View File

@@ -13,6 +13,7 @@ public:
protected:
#if ESCHER_VIEW_LOGGING
const char * className() const override;
void logAttributes(std::ostream &os) const override;
#endif
private:
bool m_active;

View File

@@ -14,4 +14,9 @@ void SolidColorView::drawRect(KDRect rect) const {
const char * SolidColorView::className() const {
return "SolidColorView";
}
void SolidColorView::logAttributes(std::ostream &os) const {
View::logAttributes(os);
os << " color=\"" << (int)m_color << "\"";
}
#endif

View File

@@ -61,4 +61,10 @@ void TabView::storeSubviewAtIndex(View * view, int index) {
const char * TabView::className() const {
return "TabView";
}
void TabView::logAttributes(std::ostream &os) const {
View::logAttributes(os);
os << " numberOfTabs=\"" << (int)m_numberOfTabs << "\"";
os << " activeTabIndex=\"" << (int)m_activeTabIndex << "\"";
}
#endif

View File

@@ -28,5 +28,10 @@ void TabViewCell::drawRect(KDRect rect) const {
const char * TabViewCell::className() const {
return "TabViewCell";
}
#endif
void TabViewCell::logAttributes(std::ostream &os) const {
View::logAttributes(os);
os << " active=\"" << m_active << "\"";
os << " name=\"" << m_name << "\"";
}
#endif

View File

@@ -137,8 +137,8 @@ const char * View::className() const {
}
void View::logAttributes(std::ostream &os) const {
os << " address=\"" << this << "\"";
os << " frame=\"" << m_frame.x << "," << m_frame.y << "," << m_frame.width << "," << m_frame.height << "\"";
//os << " child_count=\"" << numberOfSubviews() << "\"";
}
std::ostream &operator<<(std::ostream &os, const View &view) {