By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,156 Members | 962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,156 IT Pros & Developers. It's quick & easy.

PyQt(Qt): unexpected scrollbars in QCanvasView

P: n/a
For a card playing game I constructed a layout of 49 playing cards
(size of each: x=71, y=96) which are arranged in a 7X7 matrix side by
side. Accordingly the pysical size of the Canvas is x=71*7, y=96*7:

in the main program:
canvas=QCanvas(497,672)

class Board(QCanvasView):
def __init__(self,canvas,parent):
QCanvasView.__init__(self,canvas,parent)

but QCanvasView produces a layout with scrollbars in both directions.
This is very annoying for the player because although the screen's
size is more than appropriate for a total layout only some of the
cards can be viewed without scrolling. The QScrollView documentation
states that as default QScrollView shows a scrollbar when the content
is too tall to fit and not else. What goes wrong?
I am using PyQt 3.11 and Qt 3.3.1 under Linux.
Thanks for any help.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sat, 14 Aug 2004 09:33:51 GMT, Konrad Koller <ko******@compuserve.de> wrote:
For a card playing game I constructed a layout of 49 playing cards
(size of each: x=71, y=96) which are arranged in a 7X7 matrix side by
side. Accordingly the pysical size of the Canvas is x=71*7, y=96*7:

in the main program:
canvas=QCanvas(497,672)

class Board(QCanvasView):
def __init__(self,canvas,parent):
QCanvasView.__init__(self,canvas,parent)

but QCanvasView produces a layout with scrollbars in both directions.
This is very annoying for the player because although the screen's
size is more than appropriate for a total layout only some of the
cards can be viewed without scrolling. The QScrollView documentation
states that as default QScrollView shows a scrollbar when the content
is too tall to fit and not else. What goes wrong?
I am using PyQt 3.11 and Qt 3.3.1 under Linux.
Thanks for any help.


I would guess it is using the viewable size with the scrollbars to determine
whether scrollbars are needed, rather than the size without them.

If you know the scrollbars aren't needed you can manually turn them off:

self.setVScrollBarMode(QCanvasView.AlwaysOff)
self.setHScrollBarMode(QCanvasView.AlwaysOff)
--
Sam Holden
Jul 18 '05 #2

P: n/a
>> For a card playing game I constructed a layout of 49 playing cards
(size of each: x=71, y=96) which are arranged in a 7X7 matrix side by
side. Accordingly the pysical size of the Canvas is x=71*7, y=96*7:

in the main program:
canvas=QCanvas(497,672)

class Board(QCanvasView):
def __init__(self,canvas,parent):
QCanvasView.__init__(self,canvas,parent)

but QCanvasView produces a layout with scrollbars in both directions.
This is very annoying for the player because although the screen's
size is more than appropriate for a total layout only some of the
cards can be viewed without scrolling. The QScrollView documentation
states that as default QScrollView shows a scrollbar when the content
is too tall to fit and not else. What goes wrong?
I am using PyQt 3.11 and Qt 3.3.1 under Linux.

Sam Holden wrote:I would guess it is using the viewable size with the scrollbars to determine
whether scrollbars are needed, rather than the size without them.
If you know the scrollbars aren't needed you can manually turn them off:
self.setVScrollBarMode(QCanvasView.AlwaysOff)
self.setHScrollBarMode(QCanvasView.AlwaysOff)

Both scrollbars now have disappeared. All 7 columns can be viewed, but
not all 7 rows. This remains as an unexpected problem.
Konrad Koller
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.