Questions tagged [qgridlayout]

A QGridLayout is a class from the Qt toolkit which lays out GUI widgets in a grid.

QGridLayout takes the space made available to it by its parent layout or widget, divides it up into rows and columns, and puts each widget it manages into the correct cell.

Each column and row has a minimum width/height and a stretch factor (which determines how much of the available space the column or row will get over and above its necessary minimum). It is also possible for widgets to span multiple rows and/or columns.

The official Qt documentation can be found here.

203 questions
0
votes
1 answer

PyQt - Keeping spacing at zero during window resize, grid layout

I'm making an emacs-esque toy text editor. At startup, there's one large window (a QTextEdit derivative) in the top center of the screen, with a minibuffer (QLineEdit derivative) underneath. Both of the actual editing widgets are contained in the…
0
votes
1 answer

Python 2.7 PyQt4 Add Main Window File to Tab of Another Main Window

I am creating a program with Python 2.7, and have run into a problem that hours of searching Google and the forums have not answered. My program consists of a Main_Window called sessions_window.py that holds a Tab Widget. Within each tab, there…
ksmith
  • 23
  • 5
0
votes
1 answer

Minimize the space widgets fill in a QGridLayout

Below is a picture of my QDockWidget, which has a QFrame, and this QFrame has a QGridLayout. The single row I have in this layout places itself in the middle, but I'd like it to just sit neatly at the top instead. Does QGridLayout have any methods…
vandelay
  • 1,965
  • 8
  • 35
  • 52
0
votes
3 answers

Aligning textviews with imageview in a gridlayout

I'm trying to align 5 textviews with an imageview. I've created a gridlayout with 2 columns and 5 rows. In column 0 are 5 textviews divided in 5 rows. In column 1 is an imageview that spans over the 5 rows. But I can't get my desired layout. See…
0
votes
1 answer

QWidget for Image

I am trying to create a simple QGridLayout of images in PyQt5 but have found myself stuck because QGridLayout only has functionality for adding widgets and layouts via .addWidget() and .addLayout(). Below is my code that expects a QWidget but is…
Max
  • 2,072
  • 5
  • 26
  • 42
0
votes
1 answer

Qt QGridLayout setRowStretch not working

I am new to Qt. I am trying to create a window with following layout, -------------------------- | Button1 | Button2| |------------------------| |------- Image--------| ------------------------- I am able to create this layout using…
Arul
  • 303
  • 1
  • 5
  • 16
0
votes
1 answer

Proper way to manually set the layout of a window in Qt

I need a QMainWindow layout to change depending on the number of cores. Therefore I set it manually (not using the Design mode). My question is: After this layout was created, how can I refer to the widgets it…
0
votes
1 answer

PySide Frame doesn't appear on Grid Layout

I'm trying to add a simple square to a grid layout, but it doesn't seem to work. Here is the code: self.resultFrame = QFrame() self.resultFrame.setGeometry(100, 200, 0, 0) self.resultFrame.setStyleSheet("QWidget { background-color: #000…
Gustavo Amgarten
  • 396
  • 4
  • 20
0
votes
2 answers

Qt odd layout arrangement

I got the following arrangement (original here): Five unconvencional unsual sized buttons (w:400, h:300) and they are arranged int the following way: four square mode (two on top and two at buttom), closely tight together, and a fifth button in the…
0
votes
1 answer

pyqt. how to add and delete widgets?

i use python 2.7 + qt4.8 how to dynamically change the number of widgets in the window? I need to remove all the widgets and create new ones in the right quantity. testarovaniya made for a simple script: import sys from PyQt4 import QtCore, QtGui,…
Massimo
  • 836
  • 3
  • 17
  • 38
0
votes
1 answer

How to know if QLayoutItem is hidden by scroll in QScrollArea?

I have a similar question as asked in How to know if QListWidgetItem is hidden by scroll? and the answer to that question didn't fix my problem. Basically I have a QScrollArea having QGridLayout. This layout has many QToolButtons. Based on some…
Gangadhar
  • 3
  • 2
0
votes
1 answer

PyQt5: gridlayout spacing issue

I am a newbie in PyQt5. I'm trying to create a cell grid with a button at the bottom: g = QGridLayout(window) for i in range(N): for j in range(N): b = QPushButton() g.addWidget(b, i, j, 1, 1) …
theluckyemil
  • 663
  • 1
  • 7
  • 16
0
votes
0 answers

QWidget corner widths

I have an application that holds a QWidget inside a QMainWindow. I have added QGgridLayout to add additonal QWidgets inside, but there is a border-like line which I want to dissapear. This line belongs to QGridlayout.
thehilmisu
  • 342
  • 1
  • 5
  • 13
0
votes
1 answer

PyQt dynamic adding tab with buttons - layout issue

I'm trying to create a system that will automatically add tabs according to how many product types there are and then automatically add buttons within their corresponding tab for the items, but for some reason all the tabs have the same button as…
Inthu
  • 1,009
  • 1
  • 8
  • 16
0
votes
1 answer

QGridLayouts within a QGridLayout

Is it possible to have QGridLayouts within another QGridLayout? I have been trying to do this using the UI designer, so that I can resize all QGridLayouts uniformly. This is for an Ultimate-Tic-Tac-Toe game I am creating for fun. Here, I have nine…
Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71