Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QScrollArea(widgetResizable) #148

Merged
merged 10 commits into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
if: matrix.os.matrix == 'linux'
run: |
sudo apt-get update --yes
sudo apt-get install --yes libgl1
sudo apt-get install --yes libgl1 libgl1-mesa-dev xvfb x11-utils libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
# Required to stubtest QtMultimedia
sudo apt-get install --yes libpulse-mainloop-glib0
- name: Install
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
* [#138](https://github.com/python-qt-tools/PyQt5-stubs/pull/138) update to PyQt5 5.15.3
* [#144](https://github.com/python-qt-tools/PyQt5-stubs/pull/144) add `QTreeWidgetItem.__lt__()` to allow sorting of items in a QTreeWidget
* [#148](https://github.com/python-qt-tools/PyQt5-stubs/pull/148) add `widgetResizable` parameter to `QScrollArea.__init__()`

## 5.15.2.0

Expand Down
2 changes: 1 addition & 1 deletion PyQt5-stubs/QtWidgets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8147,7 +8147,7 @@ class QRubberBand(QWidget):

class QScrollArea(QAbstractScrollArea):

def __init__(self, parent: typing.Optional[QWidget] = ...) -> None: ...
def __init__(self, parent: typing.Optional[QWidget] = ..., *, widgetResizable: bool = ...) -> None: ...

def viewportSizeHint(self) -> QtCore.QSize: ...
def scrollContentsBy(self, dx: int, dy: int) -> None: ...
Expand Down
4 changes: 4 additions & 0 deletions tests/qscrollarea.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyQt5 import QtWidgets

# https://github.com/python-qt-tools/PyQt5-stubs/issues/147
QtWidgets.QScrollArea(widgetResizable=True)
6 changes: 6 additions & 0 deletions tests/test_stubs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import os.path
import pytest
from mypy import api
from PyQt5 import QtWidgets


TESTS_DIR = os.path.dirname(__file__)


application = QtWidgets.QApplication.instance()
assert application is None
application = QtWidgets.QApplication([])


def gen_tests():
for filename in os.listdir(TESTS_DIR):
if filename.endswith('.py') and not filename.startswith('test_'):
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ envlist = py3{5,6,7,8,9}
deps =
mypy @ git+https://github.com/python/mypy@538d36481526135c44b90383663eaa177cfc32e3
pytest
pytest-xvfb
pip>=20.0
commands =
pip install PyQt5==5.15.* PyQt3D==5.15.* PyQtChart==5.15.* PyQtDataVisualization==5.15.* PyQtNetworkAuth==5.15.* PyQtPurchasing==5.15.* PyQtWebEngine==5.15.*
Expand Down