Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Options Widget Interface
OptionsInterface.png


The OptionsInterface can be used by plugins to add an own widget to OpenFlippers Options dialog.

This Interface should be used by plugins which will provide their own options widget in OpenFlippers Options Dialog. For your options to show up in OpenFlippers Options window implement the initializeOptionsWidget() function.

The widget you return with this slot will be integrated into the options window and when the user hits the apply- or ok-button in the options window the slot applyOptions() is called and thus enables you to store the changes in your options.

To use the OptionsInterface:

  • include OptionsInterface.hh in your plugins header file
  • derive your plugin from the class OptionsInterface
  • add Q_INTERFACES(OptionsInterface) to your plugin class
  • Implement all functions from this interface
bool ExamplePlugin::initializeOptionsWidget(QWidget*& _widget){
// Global variable .. in header file: QWidget* optionswidget_;
optionsWidget_ = new QWidget();
// Setup widget here
//connect the signals
connect(optionsWidget_->setA, SIGNAL( clicked() ), this, SLOT( slotSetA() ) );
_widget = optionsWidget_;
return true;
}
void ExamplePlugin::applyOptions(){
// Get some value from the widget
int value = optionsWidget_->getValue();
//
...
}