A modern tile-view widget built on QGraphicsView for PySide6/PyQt6. It provides smooth, animated scrolling, a responsive grid layout and rich card interactions.
- Dynamic Grid Layout: Automatically adjusts the number of columns/rows based on the view size.
- Smooth Scrolling: Animated scrolling for both mouse wheel and programmatic control, with proper handling of queued inputs.
- Rich Card Interactions:
- Animated scaling effect on click.
- Animated border and glow effect on hover.
- Clickable favorite button.
- Emits
clickedandfavoriteChangedsignals.
- Theming: Light and dark themes provided via a built-in
ThemeManager. - Customizable: Cards can be dynamically resized, and the view's padding is adjustable.
- Cross-compatible: Built on
qtpyto support both PySide6 and PyQt6.
pip install qttileThis package is not yet on PyPI. The above command shows how it will be installed once published.
Here's a simple example of how to use QtTileView and QtTileCard:
import sys
from qtpy.QtWidgets import QApplication, QMainWindow
from qttile.tile_view import QtTileView
from qttile.tile_card import QtTileCard
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("QtTile Demo")
self.setGeometry(100, 100, 800, 600)
self.tile_view = QtTileView()
self.setCentralWidget(self.tile_view)
# Add sample cards
icon_names = [
"fa5s.music", "fa5s.film", "fa5s.camera", "fa5s.gamepad", "fa5s.book"
]
for i in range(15):
icon_name = icon_names[i % len(icon_names)]
card = QtTileCard(icon_name, f"Item {i + 1}")
card.clicked.connect(lambda i=i: print(f"Card {i + 1} clicked!"))
self.tile_view.add_tile_card(card)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())