カンテラの光の下で

dNaga392's memorandom

QtDesigner の custom widget plugin を作る

参考

%%QTDIR%%/examples/designer/worldtimeclockplugin

構成

ファイル 例(worldtimeclockplugin)
ウィジェットクラスファイル worldtimeclock.h worldtimeclock.cpp
プラグインクラスファイル worldtimeclockplugin.h worldtimeclockplugin.cpp
プロジェクトファイル worldtimeclockplugin.pro

カスタムウィジェットプラグインを作る場合、この3種類のファイルが必要となる。

既にカスタムウィジェットを作成している場合、 プラグインクラスファイルとプロジェクトファイルを用意することで、 カスタムウィジェットプラグインのプロジェクトとなる。

追加

release ビルドを実行。
以下の2ファイルが生成される(***:project name)。

  • lib***.a
  • ***.dll

これを以下に配置すると追加プラグインとして利用できる。

%%QTDIR%%/plugins\designer