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
 How to setup VAX for QT4 support?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 24 2012 :  3:28:11 PM  Show Profile  Reply with Quote
Hello, what should I do to have working intellisense for QT classes? I have some working and some not.
Is there any tutorial how to setup VAX to get it working?

Thanks.

Edited by - Dusan on May 24 2012 3:28:49 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 24 2012 :  5:26:45 PM  Show Profile  Reply with Quote
This should help a little bit:
http://blog.wholetomato.com/2008/11/20/using-qt-44-with-visual-assist-x/
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 25 2012 :  02:38:05 AM  Show Profile  Reply with Quote
Thanks, but I have some problems with it. Once I set platform to Win32, I am not able to add any include directories.
After I added all directories, it did not help and still, QT classes are not recognized. I have been looking on status bar while VAX parsing and never seen QT directories to be parsed. It always stops on some TLH file.

Can I somewhere look for any LOG file to see what has been parsed

[edit] To get it working I had to set QTDIR in system environment, but I think that it is somehow set in QT Options of QT Addin, so MSVC is able to compile even includes contain $(QTDIR) definitions without QTDIR defined in system environment.

Edited by - Dusan on May 25 2012 05:30:21 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - May 25 2012 :  12:26:26 PM  Show Profile  Reply with Quote
Apologies for the confusion. This page may help you when setting up your VA directories:

http://www.wholetomato.com/products/features/directories.asp

To add the Qt directories to this list in the VA options dialog you need to set the Platform to "Custom". If the platform is set to Win32 then VA picks up the directory list from the IDE settings instead.

After setting the QTDIR environment variable you often have to reboot before this variable is passed to VA when you load the IDE. Does rebooting make any difference to this environment variable being picked up?

zen is the art of being at one with the two'ness
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 26 2012 :  10:26:52 AM  Show Profile  Reply with Quote
As I wrote in [EDIT] paragraph, now all works like a charm and I am happy to use such great tool as VAX really is. There are still many possible enhancements (for example not correct C# interface implementations, missing possibility to sort functions in source files and so on, but it is qreat tool)
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 26 2012 :  11:52:25 AM  Show Profile  Reply with Quote
I'm glad it worked out.

Anyway, we are considering adding sort functionality to VA outline for selected items:

case=20370

You can already do it manually with VA Outline using drag and drop over the items.

What do you mean by not correct C# interface implementations?
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 28 2012 :  02:29:49 AM  Show Profile  Reply with Quote
By not correct C# interface implementations I mean the way how Implement Interface works in C# and in C++/CLI.
In both VAX sometimes just fails to find methods to implement:

C#:
class foo : IAppDomainSetup 
{
 
}


C++/CLI:
ref class foo : public IAppDomainSetup 
{
 
};


Result: No methods to implement were identified.

Then in C++/CLI VAX does not add access modifiers:

Following is not compilable:
ref class foo : public IFormatProvider
{
  virtual System::Object^ GetFormat( System::Type^ formatType ) 
  {
    return nullptr;
  }
};


It should be:
ref class foo : public IFormatProvider
{
  public:
  virtual System::Object^ GetFormat( System::Type^ formatType ) 
  {
    return nullptr;
  }
};


Other wrong is that VAX does not use "using" section, so all types are defined by full name (full name should be used only in case when there is name duplicity in more namespaces).

And in C# it could instead System.String use just string, instead System.Int use just int, instead System.Object use just object and so on.

Dusan





Edited by - Dusan on May 28 2012 02:36:33 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 28 2012 :  4:37:26 PM  Show Profile  Reply with Quote
quote:
VAX sometimes just fails to find methods to implement

Is it possible that you miss a method from a more than one level deep class in the hierarchy? Implement Interface currently only finds methods from the parent which your class is directly inherited from.

quote:
Then in C++/CLI VAX does not add access modifiers

Do you think that if Visual Assist respected (re-created) the visibility that your method has in the base class would be a solution for your problem?

quote:
Other wrong is that VAX does not use "using" section, so all types are defined by full name.


We are considering doing this for some refactoring, so I've added a comment to the case to consider Implement Interface as well:

case=20637

quote:
And in C# it could instead System.String use just string, instead System.Int use just int, instead System.Object use just object and so on.

Can you please elaborate this a little bit? What do you mean by "use"? Are you talking about a refactoring or about suggestion listboxes?
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 29 2012 :  07:47:13 AM  Show Profile  Reply with Quote
quote:
Is it possible that you miss a method from a more than one level deep class in the hierarchy? Implement Interface currently only finds methods from the parent which your class is directly inherited from.


No, look on previously posted example.

quote:

Do you think that if Visual Assist respected (re-created) the visibility that your method has in the base class would be a solution for your problem?


It could use the same modifier as is used for C# refactoring.
quote:

Can you please elaborate this a little bit? What do you mean by "use"? Are you talking about a refactoring or about suggestion listboxes?

Apologize, I mean refactoring in C#. I think all C# users use 'int' insted of 'System.Int32' or 'Int32' to define integer. In the same way works refactor from MicroSoft in visual studio. Only problem what I see is that I must use builtin refactor to get expected results, so if I my mistake use VAX for this, I need to use undo and refactor again with another tool.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 29 2012 :  7:32:43 PM  Show Profile  Reply with Quote
*ah* My mistake. IAppDomainSetup is a system interface. I tried to declare my own interface for the test first, so VA worked there Now I am seeing the same effect here and I have put in a bug report for this:

case=66932

Are you aware of any other interface where you don't get the methods you need to implement?

quote:
It could use the same modifier as is used for C# refactoring.

I don't get it. What do you mean by "C# refactoring."?

Regarding Int32: which refactoring are we talking about? I tried to use "Create from usage" over

Apple = 5;

in a private method and I got

private int apple;

Also, I got the correct result with Extract Method, using VA 1906.

Edited by - accord on May 29 2012 7:34:00 PM
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 30 2012 :  02:50:38 AM  Show Profile  Reply with Quote
quote:
Are you aware of any other interface where you don't get the methods you need to implement?

There are many, but I do not remember all. Follows what I found in few minutes:
IEnumerator<>
IAsyncResult


quote:
I don't get it. What do you mean by "C# refactoring."?

I mean that in C++/CLI project, method implementation should have the same modifier as method implementation in C# project.

In C# modifiers work:
class foo : IFormatProvider
  {
    // modifier 'public' is correct
    public System.Object GetFormat(System.Type formatType)
    {
      throw new Exception("The method or operation is not implemented.");
    }
  }


In C++/CLI do not:
BTW, std::exception in C++/CLI
ref class foo : public IFormatProvider
{
  // MODIFIER IS MISSING HERE
  virtual System::Object^ GetFormat( System::Type^ formatType ) 
  {
    throw std::exception("The method or operation is not implemented.");
  }
};

quote:

Regarding Int32: which refactoring are we talking about? I tried to use "Create from usage" over

Apple = 5;

in a private method and I got

private int apple;

Also, I got the correct result with Extract Method, using VA 1906.


We are talking about iterface (or abstract class) implementation.

This is result from VAX:
class foo : IFormatProvider
  {
    public System.Object GetFormat(System.Type formatType)
    {
      throw new Exception("The method or operation is not implemented.");
    }
  }


And result from MS refactoring follows:

class foo : IFormatProvider
  {
    #region IFormatProvider Members

    public object GetFormat(Type formatType)
    {
      throw new Exception("The method or operation is not implemented.");
    }

    #endregion
  }


As you can see, C# refactor (may be it is not considered as refactoring by you ) from MicroSoft uses 'public object' instead of 'public System.Object' and adds also regions. May be it is due to needs of other languages like VB.NET and C++/CLI where it must be 'System.Object' and while it is not error even in C#, it is the same. This 'Implement interface' was my suggestion for VAX because it is missing in tools for C++/CLI from MicroSoft. But now, even it is implemented, many virtual methods need to be implemented manually. There are also problems with list of virtual methods in unmanaged code, when some methods are available to implement even they are implemented already, but I must first figure out, what is it caused by.


Edited by - Dusan on May 30 2012 03:01:27 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 30 2012 :  6:55:42 PM  Show Profile  Reply with Quote
Thank you for the additional interface names, I have added them to the case and indicated that the list is not complete.

Refactoring: *ah* now I get it, thank you for the explanation. The C# and C++ version are indeed a little bit inconsistent.

I've added a comment with your observations to

case=55728

which is about improving the visibility basically considering the visibility of the base class and maybe by taking into account the inheritance type.

std::exception: we need separate snippets for some C++/CLI refactorings:

case=48591

About your last comment, it is covered by

case=20637

since it "System." should not be used when "using System" is already there. Can you please give me an example interface name where System.Int32 is used in a method parameter that must be implemented? Thanks.
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - May 31 2012 :  12:24:49 PM  Show Profile  Reply with Quote
I do not remember now any Int32 containig interface, but it is easy task for VAX. All it should do is to use following table:

Complete buit-in types table for C#:
http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx

bool System.Boolean
byte System.Byte
sbyte System.SByte
char System.Char
decimal System.Decimal
double System.Double
float System.Single
int System.Int32
uint System.UInt32
long System.Int64
ulong System.UInt64
object System.Object
short System.Int16
ushort System.UInt16
string System.String


BTW, I have forget about another issue.
System::Windows::Forms::ProfessionalColorTable is class full of virtual methods, but VAX knows nothing about it.

using namespace System::Windows::Forms;

ref class foo : public ProfessionalColorTable
{

};

Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 31 2012 :  7:59:23 PM  Show Profile  Reply with Quote
Thank you for the table. I have put in an enhancement request for this:

case=66979

What do you mean by "VAX knows nothing about it"? You get no member listboxes at all? Can you please try turning on

VAssistX -> Advanced -> Listboxes -> Get content from default intellisense

to see if it makes any difference?
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Jun 01 2012 :  07:35:22 AM  Show Profile  Reply with Quote
I mean that I can not implement any of it using VAX. Implement interface option does not work for it. Probably it does not work for non-interface classes? But implement virtual method option should, right? If so, it does not...
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 02 2012 :  8:21:37 PM  Show Profile  Reply with Quote
*ah* Thanks

I am seeing the same effect here. I have put in a bug report for this:

case=67012

I have checked a few random classes and am seeing the same effect with them. Do you remember for classes when it works? Just for reference.

Edited by - accord on Jun 02 2012 8:22:23 PM
Go to Top of Page

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Jun 03 2012 :  09:04:52 AM  Show Profile  Reply with Quote
It could be considered usage of built-in types also for C++/CLI:

http://msdn.microsoft.com/en-us/library/0wf2yk2k.aspx

Perhaps it could be optional, so user would have an refactoring setting to choose whether use .NET Framework types or language built-in types?

Edited by - Dusan on Jun 03 2012 09:05:57 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 04 2012 :  5:27:23 PM  Show Profile  Reply with Quote
The link has been added to the case, thank you.

Edited by - accord on Jun 04 2012 5:27:40 PM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 09 2012 :  02:02:39 AM  Show Profile  Reply with Quote
case=67012 is fixed in build 1912

Whole Tomato Software, Inc.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 17 2012 :  11:33:37 PM  Show Profile  Reply with Quote
case=66979 (use built-in types like int instead of System.Int32) is implemented in build 1925
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Mar 16 2016 :  12:05:02 AM  Show Profile  Reply with Quote
case=55728 is fixed in build 2093
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jun 18 2020 :  01:35:41 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