Programming
The class definition of the dll file should look like this:
#define SLESTESTCUSTOMWIDGET_EXPORT Q_DECL_EXPORT
class SLESTESTCUSTOMWIDGET_EXPORT SlEsTestCustomWidget : public QWidget
{
Q_OBJECT
....
public slots:
bool serialize(const QString& szFilePath, bool bIsStoring);
....
}
7.4.3 Structure of the custom widget interface
Description
The library is supplemented by an interface in order to display the custom widget in the dialog.
This contains macro definitions with which "Run MyScreens" initiates the custom widget. The
interface is available in the form of a cpp file. The file name can be freely selected, e.g.:
sleswidgetfactory.cpp
Programming
The interface is defined as follows:
#include "slestestcustomwidget.h" ; The header file for the relevant custom widg-
ets is inserted at the beginning of the file
....
//Makros ; Macro definitions are not changed
....
WIDGET_CLASS_EXPORT(SlEsTestCustom-
Widget)
; The relevant custom widget is declared at
the end of the file
Example
Content of the file sleswidgetfactory.cpp for a custom widget with the class name
SlEsTestCustomWidget":
#include <Qt/qglobal.h>
#include "slestestcustomwidget.h"
Graphic and logic elements
7.4 Custom widgets
SINUMERIK Integrate Run MyScreens (BE2)
Programming Manual, 12/2017, 6FC5397-1DP40-6BA1 207