Setting size of terminal spawned by QProcess
-
I am writing a widget that displays a terminal emulator within my programm
class EmbeddedTerminal(QWidget): finished = pyqtSignal() def __init__(self, parent=None): super(EmbeddedTerminal, self).__init__(parent) self.process = QProcess(self) self.process.finished.connect(self.term_finished) self.terminal = QWidget(self) layout = QVBoxLayout(self) layout.addWidget(self.terminal) self.process.start('alacritty', ['--embed', str(int(self.winId()))]) @pyqtSlot() def term_finished(self): self.finished.emit()
When I start this widget, the terminal is always 640x480 pixels, but I want it do take as much space as possible. As far as I can tell there should be two ways
First, the Layout should tell the Process to take the space (preferred way, but I don't know how).
Second, I need the width and height in pixels of the available space, to calculate the dimensions of the terminal by hand and give it as a parameter in process.start().I really don't want to have to resort to the second option. Any suggestions on how to solve the issue? Maybe something completely different I did not think of?
Thanks in advance!
-
@julkip said in Setting size of terminal spawned by QProcess:
self.process.start('alacritty', ['--embed', str(int(self.winId()))])
You are providing the winId from your EmbeddedTerminal widget, not self.terminal inside EmbeddedTerminal.