Qt 为QCombobox添加项

Qt 为QCombobox添加项
其实很简单,代码如下:

            QComboBox *combobox = new QComboBox(this);
            QStringList strings;
            strings << tr("自由") << tr("典型") << tr("默认") ;
            combobox->addItems(strings);

你可能感兴趣的:(Qt 为QCombobox添加项)