Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I got answer on a different channel, thanks to the guys on #pyqt on freenode. The problem is that <code>QScrollArea</code> needs a <code>QWidget</code> set by <code>setWidget()</code>, and that should contain the <code>QVBoxLayout</code>.</p> <p>Here is the fixed code:</p> <pre><code> while self.tabWidget.widget(0): self.tabWidget.removeTab(0) for i in data['tabList']: self.log("Adding tab: '%s'" % i, DEBUG) self.data['tabDict'][i]['scrollarea'] = QScrollArea() self.data['tabDict'][i]['scrollarea'].setWidgetResizable(True) self.data['tabDict'][i]['widget'] = QWidget() self.data['tabDict'][i]['vbox'] = QVBoxLayout() for j in self.data['tabDict'][i]['groupList']: self.log("Adding group: '%s'" % j, DEBUG) self.data['tabDict'][i]['groupDict'][j]['groupbox'] = QGroupBox(j) self.data['tabDict'][i]['groupDict'][j]['formlo'] = QFormLayout() print self.data['tabDict'][i]['groupDict'][j]['formlo'] for k in self.data['tabDict'][i]['groupDict'][j]['fields']: self.log("Adding field: '%s'" % k['name']) k['lineedit'] = QLineEdit(k['value']) k['lineedit'].setToolTip('&lt;b&gt;Type:&lt;/b&gt; %s&lt;br&gt;&lt;b&gt;TSDB path:&lt;/b&gt; %s&lt;br&gt;&lt;b&gt;Line:&lt;/b&gt; %d&lt;br&gt;&lt;b&gt;Comment:&lt;/b&gt; %s' % (k['type'],k['path'],k['row'], k['comment'])) self.data['tabDict'][i]['groupDict'][j]['formlo'].addRow(k['name'], k['lineedit']) self.data['tabDict'][i]['groupDict'][j]['groupbox'].setLayout(self.data['tabDict'][i]['groupDict'][j]['formlo']) self.data['tabDict'][i]['vbox'].addWidget(self.data['tabDict'][i]['groupDict'][j]['groupbox']) self.data['tabDict'][i]['widget'].setLayout(self.data['tabDict'][i]['vbox']) self.data['tabDict'][i]['scrollarea'].setWidget(self.data['tabDict'][i]['widget']) self.tabWidget.addTab(self.data['tabDict'][i]['scrollarea'], i) </code></pre> <p>It is still an open question though that what resulted the weird behavior of the first code. :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload