EnumComboBox
Qt Widgets
Score 50%
Description:

Overview:
Let's say you have an enumeration like this

class ExampleClass : public QObject
{
Q_OBJECT
public:
enum Type { Apple, Pear, Banana, Pineapple }
}

The following source code will generated a combobox with items, {"Apple", "Pear", "Banana", Pineapple"}

QComboBox *c = NEMO_NEW_ENUM_QCOMBOBOX(ExampleClass, Type, /*parent=*/NULL);

Explanation:
The widget is actually a macro that generates a new class derived from QComboBox.
The macro uses the QMetaEnum and MetaObject system to add items to this combobox that are corresponding to the enum. Using this widget is actually a little bit more refined that in the overview above: Since the MetaObject system is used, only enums declared in QObjects will work (See example included in the source code, main.h and main.cpp).
Be the first to comment

product-maker 6 6

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
0.1
updated Jul 05 2014
added Jul 05 2014
downloads today
0
page views today 0