PyQt QGridLayout question

Discussion in 'Python' started by Volker Lenhardt, Nov 23, 2005.

  1. Once again a maybe silly question, but I find no solution, neither in
    the documentation nor in examples.

    I have got some different layouts to change place by the help of a
    QGridLayout in its parent widget. To make it nice I use row/col spacing
    and stretch respectively as well as multicell widgets. There is no
    problem if the layout next to come uses more rows and columns than the
    former one. But if it is the other way round, the grid seems to take
    those now unused rows and columns into account and uses more space than
    expected.

    Before changing to another layout I remove and delete all widgets within
    the grid and set spacing and stretch of all used rows and columns to 0:

    for c in self.gridContents.values():
    self.grid.removeChild(c)
    self.gridContents.clear()
    for i in range(20):
    self.grid.addColSpacing(i,0)
    self.grid.addRowSpacing(i,0)
    self.grid.setColStretch(i,0)
    self.grid.setRowStretch(i,0)

    Only if I do a total resection and remove the grid and the parent
    widget, too, to set them up again, all is fine but for the flicker on
    the screen. Is there a more convenient way? Remove rows/columns as can
    be done in tables?

    Best wishes
    Volker

    --
    Volker Lenhardt
    E-Mail:
     
    Volker Lenhardt, Nov 23, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulysses
    Replies:
    4
    Views:
    823
    Werner Schiendl
    Oct 22, 2003
  2. Eric Williams

    Updating PyQt widgets question

    Eric Williams, Nov 18, 2003, in forum: Python
    Replies:
    0
    Views:
    430
    Eric Williams
    Nov 18, 2003
  3. dusty

    Noob question on PyQt and Qt

    dusty, Aug 1, 2004, in forum: Python
    Replies:
    2
    Views:
    554
    dusty
    Aug 1, 2004
  4. Volker Lenhardt
    Replies:
    5
    Views:
    3,434
    Volker Lenhardt
    Nov 19, 2005
  5. Samir Grover

    PyQt QScrollView/QGridLayout question

    Samir Grover, Jul 11, 2008, in forum: Python
    Replies:
    0
    Views:
    528
    Samir Grover
    Jul 11, 2008
Loading...

Share This Page