Skip to content

donghoonpark/QtTile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QtTile

A modern tile-view widget built on QGraphicsView for PySide6/PyQt6. It provides smooth, animated scrolling, a responsive grid layout and rich card interactions.

QtTile Demo

Features

  • 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 clicked and favoriteChanged signals.
  • 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 qtpy to support both PySide6 and PyQt6.

Installation

pip install qttile

This package is not yet on PyPI. The above command shows how it will be installed once published.

Usage

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_())

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages