Mercurial > hg > svgui
comparison view/View.cpp @ 1495:6bb0afa607f5
Toward trying to figure out a progress-bar problem
author | Chris Cannam |
---|---|
date | Tue, 13 Aug 2019 15:10:32 +0100 |
parents | c5589d94b731 |
children | d09345e578a7 |
comparison
equal
deleted
inserted
replaced
1494:78d9282519b0 | 1495:6bb0afa607f5 |
---|---|
73 m_haveSelectedLayer(false), | 73 m_haveSelectedLayer(false), |
74 m_useAligningProxy(false), | 74 m_useAligningProxy(false), |
75 m_manager(nullptr), | 75 m_manager(nullptr), |
76 m_propertyContainer(new ViewPropertyContainer(this)) | 76 m_propertyContainer(new ViewPropertyContainer(this)) |
77 { | 77 { |
78 // cerr << "View::View(" << this << ")" << endl; | 78 // cerr << "View::View(" << getId() << ")" << endl; |
79 } | 79 } |
80 | 80 |
81 View::~View() | 81 View::~View() |
82 { | 82 { |
83 // cerr << "View::~View(" << this << ")" << endl; | 83 // cerr << "View::~View(" << getId() << ")" << endl; |
84 | 84 |
85 m_deleting = true; | 85 m_deleting = true; |
86 delete m_propertyContainer; | 86 delete m_propertyContainer; |
87 delete m_cache; | 87 delete m_cache; |
88 delete m_buffer; | 88 delete m_buffer; |
341 m_centreFrame = f; | 341 m_centreFrame = f; |
342 | 342 |
343 if (m_zoomLevel.zone == ZoomLevel::PixelsPerFrame) { | 343 if (m_zoomLevel.zone == ZoomLevel::PixelsPerFrame) { |
344 | 344 |
345 #ifdef DEBUG_VIEW | 345 #ifdef DEBUG_VIEW |
346 SVCERR << "View(" << this << ")::setCentreFrame: in PixelsPerFrame zone, so change must be visible" << endl; | 346 SVCERR << "View(" << getId() << ")::setCentreFrame: in PixelsPerFrame zone, so change must be visible" << endl; |
347 #endif | 347 #endif |
348 update(); | 348 update(); |
349 changeVisible = true; | 349 changeVisible = true; |
350 | 350 |
351 } else { | 351 } else { |
354 int newPixel = int(m_centreFrame / m_zoomLevel.level); | 354 int newPixel = int(m_centreFrame / m_zoomLevel.level); |
355 | 355 |
356 if (newPixel != formerPixel) { | 356 if (newPixel != formerPixel) { |
357 | 357 |
358 #ifdef DEBUG_VIEW | 358 #ifdef DEBUG_VIEW |
359 SVCERR << "View(" << this << ")::setCentreFrame: newPixel " << newPixel << ", formerPixel " << formerPixel << endl; | 359 SVCERR << "View(" << getId() << ")::setCentreFrame: newPixel " << newPixel << ", formerPixel " << formerPixel << endl; |
360 #endif | 360 #endif |
361 // ensure the centre frame is a multiple of the zoom level | 361 // ensure the centre frame is a multiple of the zoom level |
362 m_centreFrame = sv_frame_t(newPixel) * m_zoomLevel.level; | 362 m_centreFrame = sv_frame_t(newPixel) * m_zoomLevel.level; |
363 | 363 |
364 #ifdef DEBUG_VIEW | 364 #ifdef DEBUG_VIEW |
374 } | 374 } |
375 | 375 |
376 if (e) { | 376 if (e) { |
377 sv_frame_t rf = alignToReference(m_centreFrame); | 377 sv_frame_t rf = alignToReference(m_centreFrame); |
378 #ifdef DEBUG_VIEW | 378 #ifdef DEBUG_VIEW |
379 cerr << "View[" << this << "]::setCentreFrame(" << f | 379 cerr << "View[" << getId() << "]::setCentreFrame(" << f |
380 << "): m_centreFrame = " << m_centreFrame | 380 << "): m_centreFrame = " << m_centreFrame |
381 << ", emitting centreFrameChanged with aligned frame " | 381 << ", emitting centreFrameChanged with aligned frame " |
382 << rf << endl; | 382 << rf << endl; |
383 #endif | 383 #endif |
384 emit centreFrameChanged(rf, m_followPan, m_followPlay); | 384 emit centreFrameChanged(rf, m_followPan, m_followPlay); |
923 } | 923 } |
924 | 924 |
925 void | 925 void |
926 View::modelChanged(ModelId modelId) | 926 View::modelChanged(ModelId modelId) |
927 { | 927 { |
928 #ifdef DEBUG_VIEW_WIDGET_PAINT | 928 #if defined(DEBUG_VIEW_WIDGET_PAINT) || defined(DEBUG_PROGRESS_STUFF) |
929 cerr << "View(" << this << ")::modelChanged()" << endl; | 929 cerr << "View[" << getId() << "]::modelChanged(" << modelId << ")" << endl; |
930 #endif | 930 #endif |
931 | 931 |
932 // If the model that has changed is not used by any of the cached | 932 // If the model that has changed is not used by any of the cached |
933 // layers, we won't need to recreate the cache | 933 // layers, we won't need to recreate the cache |
934 | 934 |
961 { | 961 { |
962 sv_frame_t myStartFrame = getStartFrame(); | 962 sv_frame_t myStartFrame = getStartFrame(); |
963 sv_frame_t myEndFrame = getEndFrame(); | 963 sv_frame_t myEndFrame = getEndFrame(); |
964 | 964 |
965 #ifdef DEBUG_VIEW_WIDGET_PAINT | 965 #ifdef DEBUG_VIEW_WIDGET_PAINT |
966 cerr << "View(" << this << ")::modelChangedWithin(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << endl; | 966 cerr << "View(" << getId() << ")::modelChangedWithin(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << endl; |
967 #endif | 967 #endif |
968 | 968 |
969 if (myStartFrame > 0 && endFrame < myStartFrame) { | 969 if (myStartFrame > 0 && endFrame < myStartFrame) { |
970 checkProgress(modelId); | 970 checkProgress(modelId); |
971 return; | 971 return; |
1003 } | 1003 } |
1004 | 1004 |
1005 void | 1005 void |
1006 View::modelCompletionChanged(ModelId modelId) | 1006 View::modelCompletionChanged(ModelId modelId) |
1007 { | 1007 { |
1008 #ifdef DEBUG_PROGRESS_STUFF | |
1009 cerr << "View[" << getId() << "]::modelCompletionChanged(" << modelId << ")" << endl; | |
1010 #endif | |
1008 checkProgress(modelId); | 1011 checkProgress(modelId); |
1009 } | 1012 } |
1010 | 1013 |
1011 void | 1014 void |
1012 View::modelAlignmentCompletionChanged(ModelId modelId) | 1015 View::modelAlignmentCompletionChanged(ModelId modelId) |
1013 { | 1016 { |
1017 #ifdef DEBUG_PROGRESS_STUFF | |
1018 cerr << "View[" << getId() << "]::modelAlignmentCompletionChanged(" << modelId << ")" << endl; | |
1019 #endif | |
1014 checkProgress(modelId); | 1020 checkProgress(modelId); |
1015 } | 1021 } |
1016 | 1022 |
1017 void | 1023 void |
1018 View::modelReplaced() | 1024 View::modelReplaced() |
1019 { | 1025 { |
1020 #ifdef DEBUG_VIEW_WIDGET_PAINT | 1026 #ifdef DEBUG_VIEW_WIDGET_PAINT |
1021 cerr << "View(" << this << ")::modelReplaced()" << endl; | 1027 cerr << "View(" << getId() << ")::modelReplaced()" << endl; |
1022 #endif | 1028 #endif |
1023 m_cacheValid = false; | 1029 m_cacheValid = false; |
1024 update(); | 1030 update(); |
1025 } | 1031 } |
1026 | 1032 |
1066 View::globalCentreFrameChanged(sv_frame_t rf) | 1072 View::globalCentreFrameChanged(sv_frame_t rf) |
1067 { | 1073 { |
1068 if (m_followPan) { | 1074 if (m_followPan) { |
1069 sv_frame_t f = alignFromReference(rf); | 1075 sv_frame_t f = alignFromReference(rf); |
1070 #ifdef DEBUG_VIEW | 1076 #ifdef DEBUG_VIEW |
1071 cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf | 1077 cerr << "View[" << getId() << "]::globalCentreFrameChanged(" << rf |
1072 << "): setting centre frame to " << f << endl; | 1078 << "): setting centre frame to " << f << endl; |
1073 #endif | 1079 #endif |
1074 setCentreFrame(f, false); | 1080 setCentreFrame(f, false); |
1075 } | 1081 } |
1076 } | 1082 } |
1103 | 1109 |
1104 void | 1110 void |
1105 View::movePlayPointer(sv_frame_t newFrame) | 1111 View::movePlayPointer(sv_frame_t newFrame) |
1106 { | 1112 { |
1107 #ifdef DEBUG_VIEW | 1113 #ifdef DEBUG_VIEW |
1108 cerr << "View(" << this << ")::movePlayPointer(" << newFrame << ")" << endl; | 1114 cerr << "View(" << getId() << ")::movePlayPointer(" << newFrame << ")" << endl; |
1109 #endif | 1115 #endif |
1110 | 1116 |
1111 if (m_playPointerFrame == newFrame) return; | 1117 if (m_playPointerFrame == newFrame) return; |
1112 bool visibleChange = | 1118 bool visibleChange = |
1113 (getXForFrame(m_playPointerFrame) != getXForFrame(newFrame)); | 1119 (getXForFrame(m_playPointerFrame) != getXForFrame(newFrame)); |
1219 | 1225 |
1220 void | 1226 void |
1221 View::viewZoomLevelChanged(View *p, ZoomLevel z, bool locked) | 1227 View::viewZoomLevelChanged(View *p, ZoomLevel z, bool locked) |
1222 { | 1228 { |
1223 #ifdef DEBUG_VIEW_WIDGET_PAINT | 1229 #ifdef DEBUG_VIEW_WIDGET_PAINT |
1224 cerr << "View[" << this << "]: viewZoomLevelChanged(" << p << ", " << z << ", " << locked << ")" << endl; | 1230 cerr << "View[" << getId() << "]: viewZoomLevelChanged(" << p << ", " << z << ", " << locked << ")" << endl; |
1225 #endif | 1231 #endif |
1226 if (m_followZoom && p != this && locked) { | 1232 if (m_followZoom && p != this && locked) { |
1227 setZoomLevel(z); | 1233 setZoomLevel(z); |
1228 } | 1234 } |
1229 } | 1235 } |
1458 | 1464 |
1459 for (LayerList::const_iterator i = m_layerStack.begin(); i != m_layerStack.end(); ++i) { | 1465 for (LayerList::const_iterator i = m_layerStack.begin(); i != m_layerStack.end(); ++i) { |
1460 // SVDEBUG << "View::getScrollableBackLayers: calling isLayerDormant on layer " << *i << endl; | 1466 // SVDEBUG << "View::getScrollableBackLayers: calling isLayerDormant on layer " << *i << endl; |
1461 // cerr << "(name is " << (*i)->objectName() << ")" | 1467 // cerr << "(name is " << (*i)->objectName() << ")" |
1462 // << endl; | 1468 // << endl; |
1463 // SVDEBUG << "View::getScrollableBackLayers: I am " << this << endl; | 1469 // SVDEBUG << "View::getScrollableBackLayers: I am " << getId() << endl; |
1464 if ((*i)->isLayerDormant(this)) continue; | 1470 if ((*i)->isLayerDormant(this)) continue; |
1465 if ((*i)->isLayerOpaque()) { | 1471 if ((*i)->isLayerOpaque()) { |
1466 // You can't see anything behind an opaque layer! | 1472 // You can't see anything behind an opaque layer! |
1467 scrollables.clear(); | 1473 scrollables.clear(); |
1468 if (metUnscrollable) break; | 1474 if (metUnscrollable) break; |
1754 void | 1760 void |
1755 View::checkProgress(ModelId modelId) | 1761 View::checkProgress(ModelId modelId) |
1756 { | 1762 { |
1757 if (!m_showProgress) { | 1763 if (!m_showProgress) { |
1758 #ifdef DEBUG_PROGRESS_STUFF | 1764 #ifdef DEBUG_PROGRESS_STUFF |
1759 SVCERR << "View[" << this << "]::checkProgress(" << modelId << "): " | 1765 SVCERR << "View[" << getId() << "]::checkProgress(" << modelId << "): " |
1760 << "m_showProgress is off" << endl; | 1766 << "m_showProgress is off" << endl; |
1761 #endif | 1767 #endif |
1762 return; | 1768 return; |
1763 } | 1769 } |
1764 | 1770 |
1777 QPushButton *cancel = i->second.cancel; | 1783 QPushButton *cancel = i->second.cancel; |
1778 | 1784 |
1779 if (i->first && i->first->getModel() == modelId) { | 1785 if (i->first && i->first->getModel() == modelId) { |
1780 | 1786 |
1781 found = true; | 1787 found = true; |
1782 | 1788 bool isAlignmentProgress = false; |
1783 if (i->first->isLayerDormant(this)) { | |
1784 // A dormant (invisible) layer can still be busy | |
1785 // generating, but we don't usually want to indicate | |
1786 // it because it probably means it's a duplicate of a | |
1787 // visible layer | |
1788 cancel->hide(); | |
1789 pb->hide(); | |
1790 continue; | |
1791 } | |
1792 | 1789 |
1793 // The timer is used to test for stalls. If the progress | 1790 // The timer is used to test for stalls. If the progress |
1794 // bar does not get updated for some length of time, the | 1791 // bar does not get updated for some length of time, the |
1795 // timer prompts it to go back into "indeterminate" mode | 1792 // timer prompts it to go back into "indeterminate" mode |
1796 QTimer *timer = i->second.checkTimer; | 1793 QTimer *timer = i->second.checkTimer; |
1798 int completion = i->first->getCompletion(this); | 1795 int completion = i->first->getCompletion(this); |
1799 QString text = i->first->getPropertyContainerName(); | 1796 QString text = i->first->getPropertyContainerName(); |
1800 QString error = i->first->getError(this); | 1797 QString error = i->first->getError(this); |
1801 | 1798 |
1802 #ifdef DEBUG_PROGRESS_STUFF | 1799 #ifdef DEBUG_PROGRESS_STUFF |
1803 SVCERR << "View[" << this << "]::checkProgress(" << modelId << "): " | 1800 SVCERR << "View[" << getId() << "]::checkProgress(" << modelId << "): " |
1804 << "found progress bar " << pb << " for layer at height " << ph | 1801 << "found progress bar " << pb << " for layer at height " << ph |
1805 << ": completion = " << completion << endl; | 1802 << ": completion = " << completion << endl; |
1806 #endif | 1803 #endif |
1807 | 1804 |
1808 if (error != "" && error != m_lastError) { | 1805 if (error != "" && error != m_lastError) { |
1823 if (wfm || | 1820 if (wfm || |
1824 (model && | 1821 (model && |
1825 (wfm = ModelById::getAs<RangeSummarisableTimeValueModel> | 1822 (wfm = ModelById::getAs<RangeSummarisableTimeValueModel> |
1826 (model->getSourceModel())))) { | 1823 (model->getSourceModel())))) { |
1827 | 1824 |
1825 isAlignmentProgress = true; | |
1826 | |
1828 completion = wfm->getAlignmentCompletion(); | 1827 completion = wfm->getAlignmentCompletion(); |
1829 | 1828 |
1830 // We don't allow cancelling alignment operations | 1829 // We don't allow cancelling alignment operations |
1831 // - they aren't usually all that expensive, and | 1830 // - they aren't usually all that expensive, and |
1832 // it would leave things in a very uncertain state | 1831 // it would leave things in a very uncertain state |
1833 showCancelButton = false; | 1832 showCancelButton = false; |
1834 | 1833 |
1835 #ifdef DEBUG_PROGRESS_STUFF | 1834 #ifdef DEBUG_PROGRESS_STUFF |
1836 SVCERR << "View[" << this << "]::checkProgress(" << modelId << "): " | 1835 SVCERR << "View[" << getId() << "]::checkProgress(" << modelId << "): " |
1837 << "alignment completion = " << completion << endl; | 1836 << "alignment completion = " << completion << endl; |
1838 #endif | 1837 #endif |
1839 | 1838 |
1840 if (completion < 100) { | 1839 if (completion < 100) { |
1841 text = tr("Alignment"); | 1840 text = tr("Alignment"); |
1850 | 1849 |
1851 pb->hide(); | 1850 pb->hide(); |
1852 cancel->hide(); | 1851 cancel->hide(); |
1853 timer->stop(); | 1852 timer->stop(); |
1854 | 1853 |
1854 } else if (i->first->isLayerDormant(this) && !isAlignmentProgress) { | |
1855 | |
1856 // A dormant (invisible) layer can still be busy | |
1857 // generating, but we don't usually want to indicate | |
1858 // it because it probably means it's a duplicate of a | |
1859 // visible layer | |
1860 #ifdef DEBUG_PROGRESS_STUFF | |
1861 SVCERR << "View[" << getId() << "]::checkProgress(" | |
1862 << modelId << "): layer is dormant" << endl; | |
1863 #endif | |
1864 pb->hide(); | |
1865 cancel->hide(); | |
1866 timer->stop(); | |
1867 | |
1855 } else { | 1868 } else { |
1856 | 1869 |
1857 if (!pb->isVisible()) { | 1870 if (!pb->isVisible()) { |
1858 i->second.lastCheck = 0; | 1871 i->second.lastCheck = 0; |
1859 timer->setInterval(2000); | 1872 timer->setInterval(2000); |
1879 } | 1892 } |
1880 | 1893 |
1881 pb->show(); | 1894 pb->show(); |
1882 pb->update(); | 1895 pb->update(); |
1883 | 1896 |
1884 ph -= pb->height(); | 1897 if (pb->isVisible()) { |
1898 ph -= pb->height(); | |
1899 } | |
1885 } | 1900 } |
1886 } else { | 1901 } else { |
1887 if (pb->isVisible()) { | 1902 if (pb->isVisible()) { |
1888 ph -= pb->height(); | 1903 ph -= pb->height(); |
1889 } | 1904 } |
1890 } | 1905 } |
1891 } | 1906 } |
1892 | 1907 |
1893 if (!found) { | 1908 if (!found) { |
1894 #ifdef DEBUG_PROGRESS_STUFF | 1909 #ifdef DEBUG_PROGRESS_STUFF |
1895 SVCERR << "View[" << this << "]::checkProgress(" << modelId << "): " | 1910 SVCERR << "View[" << getId() << "]::checkProgress(" << modelId << "): " |
1896 << "failed to find layer for model in progress map" | 1911 << "failed to find layer for model in progress map" |
1897 << endl; | 1912 << endl; |
1898 #endif | 1913 #endif |
1899 } | 1914 } |
1900 } | 1915 } |
1909 for (ProgressMap::iterator i = m_progressBars.begin(); | 1924 for (ProgressMap::iterator i = m_progressBars.begin(); |
1910 i != m_progressBars.end(); ++i) { | 1925 i != m_progressBars.end(); ++i) { |
1911 | 1926 |
1912 if (i->second.checkTimer == t) { | 1927 if (i->second.checkTimer == t) { |
1913 | 1928 |
1929 int value = i->second.bar->value(); | |
1930 | |
1914 #ifdef DEBUG_PROGRESS_STUFF | 1931 #ifdef DEBUG_PROGRESS_STUFF |
1915 SVCERR << "View[" << this << "]::progressCheckStalledTimerElapsed for layer " << i->first << endl; | 1932 SVCERR << "View[" << getId() << "]::progressCheckStalledTimerElapsed for layer " << i->first << ": value is " << value << endl; |
1916 #endif | 1933 #endif |
1917 | 1934 |
1918 int value = i->second.bar->value(); | |
1919 if (value > 0 && value == i->second.lastCheck) { | 1935 if (value > 0 && value == i->second.lastCheck) { |
1920 i->second.bar->setMaximum(0); // indeterminate | 1936 i->second.bar->setMaximum(0); // indeterminate |
1921 } | 1937 } |
1922 i->second.lastCheck = value; | 1938 i->second.lastCheck = value; |
1923 return; | 1939 return; |
2030 bool layersChanged = false; | 2046 bool layersChanged = false; |
2031 LayerList scrollables = getScrollableBackLayers(true, layersChanged); | 2047 LayerList scrollables = getScrollableBackLayers(true, layersChanged); |
2032 LayerList nonScrollables = getNonScrollableFrontLayers(true, layersChanged); | 2048 LayerList nonScrollables = getNonScrollableFrontLayers(true, layersChanged); |
2033 | 2049 |
2034 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2050 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2035 cerr << "View(" << this << ")::paintEvent: have " << scrollables.size() | 2051 cerr << "View(" << getId() << ")::paintEvent: have " << scrollables.size() |
2036 << " scrollable back layers and " << nonScrollables.size() | 2052 << " scrollable back layers and " << nonScrollables.size() |
2037 << " non-scrollable front layers" << endl; | 2053 << " non-scrollable front layers" << endl; |
2038 #endif | 2054 #endif |
2039 | 2055 |
2040 if (layersChanged || scrollables.empty()) { | 2056 if (layersChanged || scrollables.empty()) { |
2060 shouldUseCache = true; | 2076 shouldUseCache = true; |
2061 shouldRepaintCache = true; | 2077 shouldRepaintCache = true; |
2062 cacheAreaToRepaint = wholeArea; | 2078 cacheAreaToRepaint = wholeArea; |
2063 | 2079 |
2064 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2080 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2065 cerr << "View(" << this << "): cache " << m_cache << ", cache zoom " | 2081 cerr << "View(" << getId() << "): cache " << m_cache << ", cache zoom " |
2066 << m_cacheZoomLevel << ", zoom " << m_zoomLevel << endl; | 2082 << m_cacheZoomLevel << ", zoom " << m_zoomLevel << endl; |
2067 #endif | 2083 #endif |
2068 | 2084 |
2069 using namespace std::rel_ops; | 2085 using namespace std::rel_ops; |
2070 | 2086 |
2080 m_cacheValid = false; | 2096 m_cacheValid = false; |
2081 shouldUseCache = false; | 2097 shouldUseCache = false; |
2082 shouldRepaintCache = false; | 2098 shouldRepaintCache = false; |
2083 | 2099 |
2084 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2100 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2085 cerr << "View(" << this << ")::paintEvent: cache is invalid but only small area requested, will repaint directly instead" << endl; | 2101 cerr << "View(" << getId() << ")::paintEvent: cache is invalid but only small area requested, will repaint directly instead" << endl; |
2086 #endif | 2102 #endif |
2087 } else { | 2103 } else { |
2088 | 2104 |
2089 if (!m_cache || | 2105 if (!m_cache || |
2090 m_cache->size() != wholeSize) { | 2106 m_cache->size() != wholeSize) { |
2091 delete m_cache; | 2107 delete m_cache; |
2092 m_cache = new QPixmap(wholeSize); | 2108 m_cache = new QPixmap(wholeSize); |
2093 } | 2109 } |
2094 | 2110 |
2095 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2111 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2096 cerr << "View(" << this << ")::paintEvent: cache is invalid, will repaint whole" << endl; | 2112 cerr << "View(" << getId() << ")::paintEvent: cache is invalid, will repaint whole" << endl; |
2097 #endif | 2113 #endif |
2098 } | 2114 } |
2099 | 2115 |
2100 count.miss(); | 2116 count.miss(); |
2101 | 2117 |
2117 } | 2133 } |
2118 | 2134 |
2119 count.partial(); | 2135 count.partial(); |
2120 | 2136 |
2121 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2137 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2122 cerr << "View(" << this << ")::paintEvent: scrolled cache by " << dx << endl; | 2138 cerr << "View(" << getId() << ")::paintEvent: scrolled cache by " << dx << endl; |
2123 #endif | 2139 #endif |
2124 } else { | 2140 } else { |
2125 count.miss(); | 2141 count.miss(); |
2126 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2142 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2127 cerr << "View(" << this << ")::paintEvent: scrolling too far" << endl; | 2143 cerr << "View(" << getId() << ")::paintEvent: scrolling too far" << endl; |
2128 #endif | 2144 #endif |
2129 } | 2145 } |
2130 | 2146 |
2131 } else { | 2147 } else { |
2132 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2148 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2133 cerr << "View(" << this << ")::paintEvent: cache is good" << endl; | 2149 cerr << "View(" << getId() << ")::paintEvent: cache is good" << endl; |
2134 #endif | 2150 #endif |
2135 count.hit(); | 2151 count.hit(); |
2136 shouldRepaintCache = false; | 2152 shouldRepaintCache = false; |
2137 } | 2153 } |
2138 } | 2154 } |
2139 | 2155 |
2140 #ifdef DEBUG_VIEW_WIDGET_PAINT | 2156 #ifdef DEBUG_VIEW_WIDGET_PAINT |
2141 cerr << "View(" << this << ")::paintEvent: m_cacheValid = " << m_cacheValid << ", shouldUseCache = " << shouldUseCache << ", shouldRepaintCache = " << shouldRepaintCache << ", cacheAreaToRepaint = " << cacheAreaToRepaint.x() << "," << cacheAreaToRepaint.y() << " " << cacheAreaToRepaint.width() << "x" << cacheAreaToRepaint.height() << endl; | 2157 cerr << "View(" << getId() << ")::paintEvent: m_cacheValid = " << m_cacheValid << ", shouldUseCache = " << shouldUseCache << ", shouldRepaintCache = " << shouldRepaintCache << ", cacheAreaToRepaint = " << cacheAreaToRepaint.x() << "," << cacheAreaToRepaint.y() << " " << cacheAreaToRepaint.width() << "x" << cacheAreaToRepaint.height() << endl; |
2142 #endif | 2158 #endif |
2143 | 2159 |
2144 if (shouldRepaintCache && !shouldUseCache) { | 2160 if (shouldRepaintCache && !shouldUseCache) { |
2145 // If we are repainting the cache, then we paint the | 2161 // If we are repainting the cache, then we paint the |
2146 // scrollables only to the cache, not to the buffer. So if | 2162 // scrollables only to the cache, not to the buffer. So if |
2959 } | 2975 } |
2960 | 2976 |
2961 ViewPropertyContainer::ViewPropertyContainer(View *v) : | 2977 ViewPropertyContainer::ViewPropertyContainer(View *v) : |
2962 m_v(v) | 2978 m_v(v) |
2963 { | 2979 { |
2964 // cerr << "ViewPropertyContainer: " << this << " is owned by View " << v << endl; | 2980 // cerr << "ViewPropertyContainer: " << getId() << " is owned by View " << v << endl; |
2965 connect(m_v, SIGNAL(propertyChanged(PropertyContainer::PropertyName)), | 2981 connect(m_v, SIGNAL(propertyChanged(PropertyContainer::PropertyName)), |
2966 this, SIGNAL(propertyChanged(PropertyContainer::PropertyName))); | 2982 this, SIGNAL(propertyChanged(PropertyContainer::PropertyName))); |
2967 } | 2983 } |
2968 | 2984 |
2969 ViewPropertyContainer::~ViewPropertyContainer() | 2985 ViewPropertyContainer::~ViewPropertyContainer() |