Qt-interest Archive, March 2002
Drawing grid lines in QListView
Message 1 in thread
Does anyone know how to draw grid lines in QListView? The archived solution
does not help. Thanks.
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Message 2 in thread
Anyone have any ideas on how to do this?
I want to put a toolbar with one widget in the top of my application.
I want that widget to be the stretchable widget.
This is because on Mac OS X, the toolbar button is hooked up to turn
off the the toolbar.
The problem is, when I make the window smaller than that big widget
in the toolbar, the toolbar puts a big "there's more here to click
on" arrow button in the top right of the toolbar.
How do I make a toolbar that cannot be sized smaller than its
stretchable widget's minimum size?
_ michael
Message 3 in thread
On Thu, 28 Mar 2002 18:04:18 -0800
Michael Bishop <mbishop@perforce.com> wrote:
> I want to put a toolbar with one widget in the top of my application.
> I want that widget to be the stretchable widget.
In this case, lookup QDockWindow. This is the base class for QToolbar and
provides the basic handle-dock-undock functionalities.
I think that it should go smoothly provided you do not want to have a lot
of these and make fancy layouts like I do. The few tries I have run for
this have given me very unsatisfactory results, with windows that keep
rearranging and resizing themselves (usually eating up much more space
than I expect them to) each time I move something.
Also, it seems some controls I would have expected to be really basic are
missing, like knowing whether a window is minimized and popping it up when
it is (tried raise(), show() and undock(), without success. The
QDockWindow code suggests it is really more complex than that :/ )
--
[ signature omitted ]
Message 4 in thread
You have to override QListViewItem::paintCell
drawing a line on the bottom and the right of the item makes it appear as a
grid.
void MyItem::paintCell(QPainter * p, const QColorGroup & cg,
int column, int width, int align)
{
// Do the standard painting
QListViewItem::paintCell(p,cg,column,width,align);
// Draw a box around the Cell
p->setPen(cg.color(QColorGroup::Background));
p->drawLine(0,height() - 1,width - 1,height() - 1);
p->lineTo(width - 1, 0);
}
Does anyone know how to draw grid lines in QListView? The archived
solution
does not help. Thanks.
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--
[ signature omitted ]