You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ville Ranki edited this page Sep 19, 2019
·
5 revisions
How to implement your own panel items in ExtPlane-Panel 2
Create new QML file
Pick a suitable name and directory for the instrument and create a new QML file.
Add the QML file to qml.qrc resource file so it'll be compiled into the executable.
Minimal contents
See for example CompassBasic.qml for a minimal working panel item.
You'll need to use PanelItem element as the root element. You probably also want a DataRef element to read X-Plane datarefs. Otherwise it's up to you.
If it's a needle instrument, you'll probably want to use CircularGauge and/or CircularGaugeBars elements. See other examples on how to use those. Use GaugeArc to draw nice colored arcs on the gauges.
For rectangular electric gauges such as battery voltage, fuel amount etc there is ElectricGauge element that can be used as root element.
Item Settings
Assign an array of elements to propertiesDialog.propertyItems - these will be placed in grid layout.
Again, see examples on how to do this. There are useful widgets in panelitems/settingsui.
Register your new item
Add the item to AddItemDialog's list. You'll need the file path (without .qml), item name and short description for it. After this you should be able to add your item to panel.
How to wrap existing c++ PanelItems from ExtPlane-Panel 1.x
Create a new panel item QML file like normally. But the contents need to contain only PaintedPanelItem object and itemName pointing to the c++ side item name. See for example HSIK55.qml how to do it.
Include the .cpp / .h file for the item and it's dependencies in qmlui.pro or compilation will fail.
Painted items' settings need to be implemented in QML if needed, the widget based settings won't work.