[Qt-creator] Use of namespaces in Qt Creator's own code
Konstantin Tokarev
annulen at yandex.ru
Tue Jul 9 15:53:30 CEST 2013
09.07.2013, 15:35, "Oswald Buddenhagen" <oswald.buddenhagen at digia.com>:
> On Tue, Jul 09, 2013 at 12:51:51PM +0200, Ziller Eike wrote:
>
>> On 09.07.2013, at 11:11, Oswald Buddenhagen <oswald.buddenhagen at digia.com> wrote:
>>> On Mon, Jul 08, 2013 at 09:01:56PM +0200, André Pönitz wrote:
>>>> (b) Lower case outermost namespace
>>>> Contra:
>>>> - It works as it is.
>>> - it's non-qt
>> I don't see the point, Qt doesn't use namespaces at all. So going the Qt way would be to remove all namespacing...
>
> orly?
> namespace Ui (any uic-generated file)
> namespace QtPrivate (lots of internals, obviously)
> namespace QDBus
> namespace QTest
> namespace QtConcurrent
> namespace QPatternist
>
> i got bored at this point ...
>
>>> to solve the clash problem, there are two approaches:
>>> - use an additional convention (ugly)
>>> - FooNames::Foo
>>> - Foo::FooClass
>>> - remove the redundancy
>>> - Foo::Plugin
>> The clash is with things like CppEditor::CppEditor.
>
> maybe the problem is the namespace name then?
> the vcs plugins don't have any suffix. maybe the same should be done for
> the laguage plugins.
> or, because the namespace belongs to the plugin, name it
> CppEditorPlugin. of course this would then produce
> CppEditorPlugin::Plugin ...
> yet another option would be "big endian" notation for the plugin names:
> EditorCpp, VcsGit, ProjectManagerQmake, etc. a bit unnatural, but sorts
> nicely (easier to catch omissions during refactoring), and is profoundly
> distinct from the class naming convention.
Actually, what you describe is "little endian"
--
Regards,
Konstantin
More information about the Qt-creator
mailing list