0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Slint 1.14 のリリースについて

Last updated at Posted at 2025-12-04

はじめに

この記事は Slint Advent Calendar 2025 5日目の記事です。

昨日は以下の記事を書きました。

今日は 2025年10月21日にリリースされた Slint 1.14 についてです。

Slint 1.14 リリース

本日 Slint 1.14 をリリースしました。強力なグラフィック変換をサポートし、Python 統合を改善しました。

表示の変換をユニバーサル化

拡大縮小と回転が言語の主要機能して実装され、全ての要素に対して適用可能になりました。従来は Image と Text の回転のみ対応していましたが、あらゆる表示アイテムを変形できるようになりました。これにより、アイテムの親子関係を気にする必要がなくなり、言語の記述が大幅に簡単になりました。

Speedometer Demo.gif

この機能を活用した デモ をご覧ください。

Python 統合

Python 向けの Slint に asyncio サポートを追加し、非同期コードの記述を可能にしました。Slint 独自のイベントループがasyncio.EventLoop として動作し、aiohttp などのフレームワークをそのまま利用できる基盤を提供します。API の Python っぽさをさらに高めるため、Slint コールバックでも async を使用可能です。以下は毎回異なる詩を取得する Python コードの簡略例です:

import slint
import aiohttp

class AppWindow(slint.loader.app_window.AppWindow):
    #  コールバックは自動的に .slintの `refresh-peom` コールバックに接続されます。呼び出されると、新しい asyncio タスクとして実行されます
    @slint.callback
    async def refresh_poem(self):
        async with aiohttp.ClientSession() as session:
            async with session.get("https://poetrydb.org/random") as response:
                json = await response.json()
                lines = json[0]["lines"]
                text = "\n".join(lines)
                # Slintからpoemテキストプロパティを更新し、TextEditを更新
                self.poem = text

async def main():
    app = AppWindow()
    app.show()
    app.refresh_poem()

slint.run_event_loop(main())

Python統合はSlintの ローカライズファイル にも対応しました。

統一されたテキストレイアウト

Slintには4つの組み込みレンダラー(FemtoVG、Skia、Qt、および独自のソフトウェアレンダラー)が付属しています。テキスト表示において、それぞれが独自のフォント読み込みとテキストレイアウトの仕組みを備えています。

今回のリリースでは、Linebender が開発する Fontique および Parley クレートを基盤として、これらをすべて統合しました。これにより、プラットフォームを問わずすべてのユーザーに一貫した動作を提供し、Linux でのフォント選択を改善し、リッチテキスト サポートへの道を開きます。

🛠️ その他の変更

すべての変更の完全なリストについては、完全な ChangeLog を参照してください。

おわりに

今回は Slint 1.14 のリリースを紹介しました。

Slint 1.13 で私が追加した円錐グラデーションに対して、.slint のプレビューアーや SlintPad のツール側の対応が行われました。
image.png

また、細かい改善として、スライダーのピッカーの位置関係がおかしかった問題を解決しました。

491065470-94736f8a-3672-474c-9555-0b4a8d3d5cc0.gif

明日は @hermit4 さんがなんか書いてくれるようです。お楽しみに!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?