Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 How to setup VAX for QT4 support?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Dusan Posted - May 24 2012 : 3:28:11 PM
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.
21   L A T E S T    R E P L I E S    (Newest First)
ChrisG Posted - Jun 18 2020 : 01:35:41 AM
case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380
sean Posted - Mar 16 2016 : 12:05:02 AM
case=55728 is fixed in build 2093
support Posted - Dec 17 2012 : 11:33:37 PM
case=66979 (use built-in types like int instead of System.Int32) is implemented in build 1925
support Posted - Aug 09 2012 : 02:02:39 AM
case=67012 is fixed in build 1912
accord Posted - Jun 04 2012 : 5:27:23 PM
The link has been added to the case, thank you.
Dusan Posted - Jun 03 2012 : 09:04:52 AM
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?
accord Posted - Jun 02 2012 : 8:21:37 PM
*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.
Dusan Posted - Jun 01 2012 : 07:35:22 AM
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...
accord Posted - May 31 2012 : 7:59:23 PM
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?
Dusan Posted - May 31 2012 : 12:24:49 PM
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
{

};

accord Posted - May 30 2012 : 6:55:42 PM
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.
Dusan Posted - May 30 2012 : 02:50:38 AM
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.

accord Posted - May 29 2012 : 7:32:43 PM
*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.
Dusan Posted - May 29 2012 : 07:47:13 AM
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.
accord Posted - May 28 2012 : 4:37:26 PM
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?
Dusan Posted - May 28 2012 : 02:29:49 AM
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




accord Posted - May 26 2012 : 11:52:25 AM
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?
Dusan Posted - May 26 2012 : 10:26:52 AM
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)
feline Posted - May 25 2012 : 12:26:26 PM
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?
Dusan Posted - May 25 2012 : 02:38:05 AM
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.
accord Posted - May 24 2012 : 5:26:45 PM
This should help a little bit:
http://blog.wholetomato.com/2008/11/20/using-qt-44-with-visual-assist-x/

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000