Qt-interest Archive, March 2002
QTable QTableItem and QPixmap Please Help!
Message 1 in thread
Variable t is the QTable pointer.
1) I can't save nor see the pixmap in the table (table row height is 30, I
checked and the local dir is writable).
2) Do I have to allocate the QPixmap on a setPixmap (QTable takes ownership)
or is it copied to the QTable object?
Please help!
Consider the following code using Qt 3.0.2:
--------------------------------------------------------------------
QPixmap* pix = new QPixmap(QSize(t->rowHeight(i), t->rowHeight(i)));
QPainter p;
p.begin(pix);
p.setPen(Qt::red);
p.drawLine(0, 0, t->rowHeight(i), t->rowHeight(i));
p.end();
if (!pix->save("pix.png", "png"))
{
cerr << "Could not save pixmap!" << endl;;
}
QTableItem* item = new QTableItem(t, QTableItem::Never,
pDefect->type(), *pix);
t->setItem(i, TypeCol, item);
--------------------------------------------------------------------
Maxime Asselin
Programmer-Analyst
Research and Development
Message 2 in thread
Hi,
I have a list view, which has some list view items as the children. Each of
these list view items themselves have some other list view items as the
children. What i want is, to have the whole list sorted alphabetically so that
all of its children and the children of these children are sorted
alphabetically (By default the list is sorted like this if we dont change the
sorting by setSorting method), now i want
one of the listview's children to have its own sorting scheme. Means, one of the
children of the list view can have its own children sorted differently than the
global sorting scheme, may be in reverse order.. may be sorted based on some
other key. Is it possible ?? I can have a sorting scheme for one particular list
view item if i disable sorting of the list view, but i do want the list view to
be sorted alphabetically. I searched the QT documentation and didnt find any way
to do it.
Any help ??
Thanks
--abhishek
Message 3 in thread
It should be possible via deriving from QListViewItem and reimplementing
the virtual QListViewItem::sortChildItems(int,bool), shouldn't it?
Daniel
On Mon, 25 Mar 2002, Abhishek Bisaria wrote:
> Hi,
> I have a list view, which has some list view items as the children. Each of
> these list view items themselves have some other list view items as the
> children. What i want is, to have the whole list sorted alphabetically so that
> all of its children and the children of these children are sorted
> alphabetically (By default the list is sorted like this if we dont change the
> sorting by setSorting method), now i want
> one of the listview's children to have its own sorting scheme. Means, one of the
> children of the list view can have its own children sorted differently than the
> global sorting scheme, may be in reverse order.. may be sorted based on some
> other key. Is it possible ?? I can have a sorting scheme for one particular list
> view item if i disable sorting of the list view, but i do want the list view to
> be sorted alphabetically. I searched the QT documentation and didnt find any way
> to do it.
> Any help ??
>
> Thanks
> --abhishek
>
> --
> List archive and information: http://qt-interest.trolltech.com
>