@@ -205,6 +205,21 void QBarCategoriesAxis::insert(int index, const QString &category) | |||||
205 | } |
|
205 | } | |
206 |
|
206 | |||
207 | /*! |
|
207 | /*! | |
|
208 | Replaces \a oldCategory with \a newCategory. | |||
|
209 | If \a oldCategory does not exits on the axis nothing is done. | |||
|
210 | */ | |||
|
211 | void QBarCategoriesAxis::replace(const QString &oldCategory, const QString &newCategory) | |||
|
212 | { | |||
|
213 | Q_D(QBarCategoriesAxis); | |||
|
214 | int pos = d->m_categories.indexOf(oldCategory); | |||
|
215 | if (pos != -1) { | |||
|
216 | d->m_categories.replace(pos, newCategory); | |||
|
217 | d->emitUpdated(); | |||
|
218 | emit categoriesChanged(); | |||
|
219 | } | |||
|
220 | } | |||
|
221 | ||||
|
222 | /*! | |||
208 | Removes all categories. |
|
223 | Removes all categories. | |
209 | */ |
|
224 | */ | |
210 | void QBarCategoriesAxis::clear() |
|
225 | void QBarCategoriesAxis::clear() |
@@ -47,6 +47,7 public: | |||||
47 | void append(const QString &category); |
|
47 | void append(const QString &category); | |
48 | void remove(const QString &category); |
|
48 | void remove(const QString &category); | |
49 | void insert(int index, const QString &category); |
|
49 | void insert(int index, const QString &category); | |
|
50 | void replace(const QString &oldCategory, const QString &newCategory); | |||
50 | void clear(); |
|
51 | void clear(); | |
51 | void setCategories(const QStringList &categories); |
|
52 | void setCategories(const QStringList &categories); | |
52 | QStringList categories(); |
|
53 | QStringList categories(); |
General Comments 0
You need to be logged in to leave comments.
Login now