[Qt-creator] BUG: Code completion fails with std::vector::iterator
Robert Hairgrove
evorgriahr at hispeed.ch
Fri Jan 2 10:50:03 CET 2009
Qt Creator 0.9.1 on Ubuntu Linux 7.04...
When writing this code, everything works WRT code completion until I
enter the "for" loop:
==== code begins: ====
#include <vector>
#include "abstractdbconfig.h"
typedef std::vector<AbstractDbConfig *> ConfigWidgets;
// snip ...
// the class "DbSettings" has a member "config_pages" of this type...
//
void DbSettings::handleApply(QAbstractButton* btn)
{
if (ui->buttonBox->buttonRole(btn) == QDialogButtonBox::ApplyRole)
{
for (ConfigWidgets::iterator it = config_pages.begin();
it != config_pages.end(); ++it)
{
// save changes to settings:
(*it)->handleApplyBtn();
}
ui->buttonBox->button(QDialogButtonBox::Apply)
->setEnabled(false);
dirty = false;
}
}
==== code ends ====
QAbstractButton has a public member function "handleApplyBtn. However,
NONE of the members of the class are shown after typing the indirection.
Also, when I type "." after the name of a pointer type, Qt Creator
automatically changes it to "->" (a VERY nice feature!) But here, I have
to type "->" manually.
If I declare a pointer normally, i.e.:
AbstractDbConfig * x;
then all the members are shown normally when I type "x" and either "."
or "->".
Since this is such a tried-and-true idiom, maybe it should be looked into.
More information about the Qt-creator-old
mailing list