I want to be able to do something like an iterative cycle in which I call my parametrized paint method, each time with a different parameter value.
The idea is to fill a comboBox with different text values for each row.
Something along these lines:
for ( int i
= o; i <
QColor().
colorNames().
length(); i
++ ) {
paint(indexofColorname)
}
for ( int i = o; i < QColor().colorNames().length(); i++ )
{
paint(indexofColorname)
}
To copy to clipboard, switch view to plain text mode
and then I'd expect something like this in the Class:aint(indexofColorname) method implementation:
class::paint(/***/)
{
painter
->drawText
(QColor().
colorNames(index
);
}
class::paint(/***/)
{
painter->drawText(QColor().colorNames(index);
}
To copy to clipboard, switch view to plain text mode
and, thus, I'd expect to fill a QComboBox with the names of the colorNames QStringList.
However, I can't use the paint method like that, can I?
Bookmarks