FreeCAD Logo FreeCAD 1.0
  • 英語 アフリカーンス語 アラビア語 ベラルーシ語 カタロニア語 チェコ語 ドイツ語 ギリシャ語 スペイン語 スペイン語 バスク語 フィンランド語 フィリピン語 フランス語 ガリシア語 クロアチア語 ハンガリー語 インドネシア語 イタリア語 日本語 カビル語 韓国語 リトアニア語 オランダ語 ブークモール・ノルウェー語 ポーランド語 ポルトガル語 ポルトガル語 ルーマニア語 ロシア語 スロバキア語 スロベニア語 セルビア語 スウェーデン語 トルコ語 ウクライナ語 バレンシア語 ベトナム語 中国語 中国語
  • 特徴
  • ダウンロード
  • ブログ
  • ドキュメント
    ドキュメントの目次 初めての方へ ユーザー ドキュメント FreeCAD マニュアル ワークベンチのドキュメント Python コーディングドキュメント C++ コーディングドキュメント チュートリアル よくある質問 プライバシーポリシー FreeCADについて
  • 協力する
    協力するには Sponsor バグを報告 プルリクエストを作成 雇用と資金援助 コントリビューション ガイドライン 開発者ハンドブック 翻訳
  • コミュニティ
    行動規範 フォーラム The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn カレンダー
  • ♥ Donate

Donate

$
SEPA 情報
SEPA 銀行振込を設定してください。:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
銀行振込サービス: BNP Paribas Fortis
アドレス: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Pivy
ユーザーインタフェースの作成
インデックス

概要

PySideライブラリを使うと、Pythonから、クロスプラットフォームのGUIツールキットのQtにアクセスできます。QtはC++のライブラリ集ですが、PySideを使うことで、PythonからもQtの機能を活用することができます。C++で作れるユーザーインタフェースは、同じようにPythonでも作成したり変更したりできます。ソースコードをコンパイルせずに開発とテストをその場で行うことができるのが、Pythonを使ってQtを用いたインタフェースを作成する利点の1つです。

The recommended way to import PySide (of any version) in FreeCAD is:

from PySide import QtCore, QtGui, QtWidgets

Qt & PySide versions

  • Version 1.0 of Qt was released in mid 1990’s
  • Version 4.0 of Qt was released in 2005 and the 4.x series was officially retired in 2015
    • The python wrapper for Qt4.x has the name PySide
  • Version 5.0 of Qt was released in 2012 and the 5.x series was officially retired in 2020.
    • The python wrapper for Qt5.x has the name PySide2
  • Version 6.0 of Qt was released in 2020, it is the current version-series
    • The python wrapper for Qt6.x has the name PySide6

PySideを使って作成したユーザーインタフェースの例。左:単純なダイアログの例。右:グラフを含む複雑なダイアログの例。

Top

FreeCAD and PySide

The original idea behind FreeCAD was to bring Cas.CADE (geometric kernel), Qt (gui toolkit) and Python together to create a free 3D parametric CAD program with a built-in scripting engine. This was in the early 2000’s, i.e. prior to the existence of PySide, thus a different wrapper – PyQt – was used for the first good decade of FreeCAD’s life. PySide came about to solve licensing issues with PyQt, and the switch for FreeCAD to PySide was made in 2013 (commit 1dc122dc9a).

If you would like to know which Qt version your installation uses, the About dialog has version listings where Qt is included.

詳細は以下を参照してください。

  • Wikipedia:PySide
  • PySideとPyQtの相違点

FreeCADをインストールすると、QtとPySideも同梱されているはずです。自分でコンパイルした場合は、これら2つのライブラリがインストールされているか確認してください。FreeCADを正しく動作させるためにはこれらが必要です。もちろん、QtがないとPySideは動作しません。

Top

Multi version compatibility

The main difference between the PySide and subsequent PySide2 and PySide6 libraries is the namespacing. PySide (Qt4) has the main namespaces QtGui and QtCore, whereas PySide2 (Qt5) and PySide6 (Qt6) introduced the additional namespace QtWidgets, where all the widgets are now located, they used to be in QtGui namespace.

FreeCAD’s approach to handle the different versions of Qt/PySide is to call them all PySide, which really should be thought of as PySideX. It does not matter which Qt/PySide version is installed, they are all imported with PySide.

A shim handles the differences between the versions. This PySide shim is located in the Ext/ directory of an installation of FreeCAD compiled for Qt5/Qt6.

/usr/share/freecad/Ext/PySide

This module just imports the necessary classes from PySide2/6, and places them in the PySide namespace. This approach was chosen for it's ability to provide backwards compatibility from a Qt4 perspective.

PySide2.QtCore -> PySide.QtCore
PySide2.QtGui -> PySide.QtGui
PySide2.QtWidgets -> PySide.QtWidgets
PySide2.QtSvg -> PySide.QtSvg
PySide2.QtUiTools -> PySide.QtUiTools

For this reason the PySide2.QtWidgets classes are also placed in the PySide.QtGui namespace.

PySide2.QtWidgets.QCheckBox -> PySide.QtGui.QCheckBox

But the current recommended way is to use the modern namespacing.

from PySide import QtCore, QtGui, QtWidgets

my_check_box = QtWidgets.QCheckBox()

Top

Examples of PySide use

  • Beginner PySide Examples ( Hello World、お知らせ、テキストを入力、番号を入力
  • PySide Intermediate Examples (ウィンドウのサイズ変更、ウィジェットの非表示、ポップアップメニュー、マウスの位置、マウスイベント)
  • Advanced PySide Examples (ウィジェットなど)

彼らは主題を3つの部分に分け、PySide、PythonそしてFreeCAD内部への露出のレベルによって区別しました。最初のページには概要と背景資料があり、PySideとそのまとめ方について説明していますが、2ページ目と3ページ目は、ほとんどが異なるレベルのコード例です。

その意図は、問題に取り組むユーザがコードを簡単にコピーして自分の作業に貼り付け、必要に応じてそれを修正し、FreeCADによる問題解決に戻ることができるように、関連ページがPySideを実行する単純なPythonコードを提供することです。うまくいけば、彼らはPySideの質問に対する答えを探すためにインターネットを越えて追いかけに行く必要はありません。同時にこのページは、Web上で利用可能なさまざまな包括的なPySideチュートリアルと参照サイトを置き換えることを意図していません。

Top

Documentation

There are some differences in the handling of widgets between the different versions. Programmers should be aware of these incompatibilities, and consult the official documentation if something doesn't work as expected on a given platform. Although rare, sometimes it may be required to make versioned calls through if-clauses.

The PySide documentation refers to the Python-style classes; however, since Qt is originally a C++ library, the same information should be available in the corresponding C++ reference.

  • Qt Modules available from PySide2/PySide6 (Qt5/Qt6).
  • All Qt classes by module in Qt5 for C++.
  • Qt Modules available from PySide (Qt4).

Top

Pivy
ユーザーインタフェースの作成
インデックス

このページは以下から取得されています https://wiki.freecad.org/PySide

お問い合わせ
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD チーム. ホームページの画像クレジット(上から下へ): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

このプロジェクトは次の人によってサポートされています: , KiCad Services Corp. および その他のスポンサー

GitHubGitHub でこのページを改善する