EnumComboBox

Qt Widgets

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

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).

Ratings & Comments

0 Comments

Be the first to comment
Pling
0 Affiliates
Details
license
version 0.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Qt Widgets:

Widget Virtual Keyboard
embitel
last update date: 15 years ago

Score 5.3

Widget Marquee Label
embitel
last update date: 15 years ago

Score 6.1

Widget Color Picker
embitel
last update date: 15 years ago

Score 4.7

QtitanDataGrid advanced Grid for Qt
BigZ1
last update date: 8 years ago

Score 5.7

QtitanRibbon Microsoft RibbonUI and Office Styles for Qt
BigZ1
last update date: 8 years ago

Score 5.2

Q7TaskBar
QDevelopper
last update date: 13 years ago

Score 6.1