title: How to determine whether the scrollbar of scrollArea is visible in PyQt5?
body: <p>Well. The question seems to be very easy, but the result I get is different from what I expect to.</p>
  
  <p>I have an app, which height depends on its content. Here is auto-resize code:</p>
  
  <pre><code>def resizeApp(self):
      n = len(self.listOfWidgets) 
      if self.screenHEIGHT - 40 &gt; n * 125 + 50:
          self.resize(self.width(), n * 125 + 50)
          self.scrollArea.resize(self.scrollArea.width(), n * 125 + 20)
      else:
          self.resize(self.width(), self.screenHEIGHT - 40)
          self.scrollArea.resize(self.scrollArea.width(), self.screenHEIGHT - 40 - 30)
      print(self.scrollArea.verticalScrollBar().isVisible())
  </code></pre>
  
  <p>You can see that after the resize we can define the visibility of the verticalScrollbar. Look at the app and console screenshot. We can see the that app has verticalScrollbar, but console says that it doesn't. It seems isVisible() lags a bit and tells me previous state.</p>
  
  <p>For example. When I add widgets, while there is no verticalScrollbar, the console says False (verticalScrollbar is not visible). When the amount of widgets requires verticalScrollbar, scrollArea creates this verticalScrollbar, however I receive message that the verticalScrollbar is not visible. And later, after adding one more widget, I get message that the verticalScrollbar is visible. </p>
  
  <p>And vice versa. When I delete widgets, I receive message that the verticalScrollbar is visible after one more widget is deleted. However it should say me "False" one step earlier.</p>
  
  <p>Am I missing something?</p>
  
  <p><strong>UPDATE1.</strong> As requested, I add a working example without redundant code. You can download a zip archive from my dropbox <a href="https://www.dropbox.com/s/n74gfb6zgnq6x9z/CM%20%E2%80%93%20minimalExample.zip?dl=0" rel="nofollow noreferrer">>here&lt;</a> </p>
  
  <p><a href="https://virustotal.com/en/file/bd07d4085ea8fd9fa24521d036d79c8ee7fd8aa9aa41a395c24af4cafafc28d4/analysis/1501235175/" rel="nofollow noreferrer">>Virustotal.com analysis&lt;</a></p>
  
  <p><a href="https://i.stack.imgur.com/ei6mD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ei6mD.png" alt="App screenshot"></a></p>