| 1877 | } |
| 1878 | |
| 1879 | void insertItem(int attr, const char* text) |
| 1880 | { |
| 1881 | setTopCell(count); |
| 1882 | |
| 1883 | setAutoUpdate(FALSE); |
| 1884 | |
| 1885 | int i; |
| 1886 | if (count<maxitems) { |
| 1887 | i=count++; |
| 1888 | setNumRows(count); |
| 1889 | } else { |
| 1890 | i=count-1; |
| 1891 | first=(first+1)%maxitems; |
| 1892 | } |
| 1893 | item(i).attr=attr; |
| 1894 | item(i).text=strdup(text); |
| 1895 | int w=datumWidth(item(i)); |
| 1896 | |
| 1897 | if (w > cellWidth()) { |
| 1898 | // Get wider. |
| 1899 | setCellWidth(w); |
| 1900 | } |
| 1901 | setTopCell(count); |
| 1902 | |
| 1903 | setAutoUpdate(TRUE); |
| 1904 | |
| 1905 | if (viewHeight() >= totalHeight()-cellHeight()) { |
| 1906 | repaint(); |
| 1907 | } else { |
| 1908 | scroll(0,cellHeight()); |
| 1909 | } |
| 1910 | } |
| 1911 | |
| 1912 | virtual void setFont(const QFont& font) |
| 1913 | { |
no outgoing calls
no test coverage detected