forked from qt-creator/qt-creator
Quickfix for adding a declaration to a class from a definition.
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
#include "Overview.h"
|
||||
#include "NamePrettyPrinter.h"
|
||||
#include "TypePrettyPrinter.h"
|
||||
|
||||
#include <Control.h>
|
||||
#include <CoreTypes.h>
|
||||
#include <FullySpecifiedType.h>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
@@ -145,3 +148,23 @@ QString Overview::prettyType(const FullySpecifiedType &ty,
|
||||
TypePrettyPrinter pp(this);
|
||||
return pp(ty, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pretty-prints the given fully-specified type, but replacing the contained
|
||||
* type with the given name.
|
||||
*
|
||||
* \param type the fully-specified type to convert to string
|
||||
* \param the name for the named-type to use
|
||||
* \param the control where the name is registered
|
||||
* \return the pretty-printed name
|
||||
*/
|
||||
QString Overview::prettyTypeWithName(const FullySpecifiedType &type,
|
||||
const Name *name,
|
||||
Control *control)
|
||||
{
|
||||
NamedType *namedTy = control->namedType(name);
|
||||
FullySpecifiedType newTy = type;
|
||||
newTy.setType(namedTy);
|
||||
|
||||
return prettyType(newTy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user