Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 'Create Implementation' adds a 'QT_NAMESPACE::'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

XMi
Junior Member

11 Posts

Posted - Mar 25 2015 :  07:03:25 AM  Show Profile  Reply with Quote
Hi.

I am developing Qt applications in C++ using Visual Studio 2013. The 'Create Implementation' has a little problem with Qt data types.

If I declare in a class a member function that returns a Qt data type, the 'Create Implementation' command will add a QT_NAMESPACE:: specifier to the return type. For example, the implementation for member function
QLocale Preferences::getLocale() const

will be
QT_NAMESPACE::QLocale Preferences::getLocale() const
{
}

Note the the problem occurs only for the return type.
void Preferences::setLocale(QLocale const& locale);

will be implemented properly as
void Preferences::setLocale(QLocale const& locale)
{
}


My system:
Windows 8.1 Ultimate 64bit EN
Visual Studio 2013 Professional EN
Visual Assist build 2059
Qt 5.4.1

Edited by - XMi on Mar 25 2015 07:04:12 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 25 2015 :  6:14:01 PM  Show Profile  Reply with Quote
Assuming that you are using "using namespace QT_NAMESPACE;", I am seeing the same effect here:

case=85429

Are you using it directly, or it is always present, e.g. because it's included via a header file? I'm not really familiar with QT.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 25 2015 :  6:48:21 PM  Show Profile  Reply with Quote
Okay, playing around with this a little more, I see that the code doesn't compile until I remove the "QT_NAMESPACE::" part so it is definitely a problem. My default class (in a new QT project that I used for the test) itself derives from QMainWindow without qualification but that class is indeed in QT_NAMESPACE so there must be a using namespace somewhere included. Anyhow, I have added comments to the case with repro steps.

Edited by - accord on Mar 25 2015 7:02:42 PM
Go to Top of Page

XMi
Junior Member

11 Posts

Posted - Mar 26 2015 :  01:38:26 AM  Show Profile  Reply with Quote
Hi. Thanks for investigating the problem.

QT_NAMESPACE is normally not defined at all as it is a feature that is not enabled by default. You have to enable it during Qt compilation. Its aim is to help dealing with multiple Qt versions. More details here: http://wiki.qt.io/Qt_In_Namespace

Edited by - XMi on Mar 26 2015 01:42:16 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 26 2015 :  1:47:11 PM  Show Profile  Reply with Quote
Thank you for the follow-up. I have added a comment with your info to the case.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jun 18 2020 :  01:35:25 AM  Show Profile  Reply with Quote
case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000