How does a Qt GUI application runs - qt5

how does a gui application in qt5 runs, what is the ui pointers role in it. I'm new to qt pls help me,Why we will pass this in the constructor like, Ui->setup(this).Thanks in advance.

Long story short: the uic parses the xml that Qt Designer generates (from form you create into the designer) and creates C++ code from that xml, and you need to use that code into your window class, there are many ways you can use that code, see the documentation and using that ui pointer is one of those ways (actually that is a pointer to an instance of a class from the generated code) as for how setupUi actually works you can see into the generated code - short answer is: it creates the form's layouts and widgets as children of this.

Related

Intellisense - deduce right Class by its methods

I'm used to work with NetBeans and now I'm trying IntelliJ. So my question is: Does IntelliJ has a way to get right class by its methods?
For example, in NetBeans if I write:
glGenBu // Intellisense will kick in and will suggest me
to use GL15.glGenBuffers() method from GL15 class
This will automatically import the right library.
This is very handy because I'm working with LWJGL and it has a bad way to manage OpenGL methods ('GLXX' where XX is the version of OpenGL and all methods that appeared in that version are stored in that class) and I never remember the right class where my desired method is.
Thank you.
Pressing Ctrl+Space when you already see completion list will show more suggestions, with static methods from the entire project among them. See https://www.jetbrains.com/help/idea/auto-completing-code.html for more details.

Why can't i reference to a method/property? VB.NET

Please take a look at the 2 photos i attached, i wish to call the methods from one project to another. Both projects are in the same solution. I have already made the reference to the project containing the method in the project i want to call the method.
http://postimg.org/image/m42dlc28r/
http://postimg.org/image/w03gkz80r/
In your main project, go to
Project -> Add Reference
In that window, click browse and find the compiled version of your other project (Probably in the Release or Debug folder)
In your main projects window add this to the very top of your code (even above your class declaration)
Imports SecondProjectRootNamespace
That should give you enough information on how to do what your trying to do, but if anything was unclear, I am going to need all the details to provide a more precise answer.
Also, make sure your methods/functions are NOT declared as private.
Private = Method is only visible from within the same class
Friend = Method is only visible from any class within the same assembly (same .exe or .dll or etc)
Public = Method has no access restrictions
There are a few others but those are the basics
Try to find the dll file of the method that you want, then add it as reference in the properties of your application

How to decorate Objective C methods with documentation?

When I'm typing up a Cocoa object and calling a selector on that object, I sometimes can see 'documentation' or 'help' information about that method. For instance, as I type [NSArray alloc], I see two help hints. One for NSArray, and one for alloc. Both of these appear in the popup autocomplete suggestions listbox as I type the code.
How do I produce similar method/class decorated help hints which will appear when I type? I want to see my comments as I type my custom class name and custom methods. How can I do this?
For instance, C# provides this feature through XML documentation which can be placed before any method, class, or interface/protocol declaration.
You have to create a “docset”. There are tools like appledoc for creating docsets from your comments. You could set up a build phase that runs appledoc on your code.
The problem is that there's no way to make Xcode 4 reload a docset except by restarting Xcode. So even if you run appledoc automatically as part of your build, you will have to restart Xcode to make it see the changes to your docset.

Test automation - Win32 app - White/UI automation - problem with recognizing objects

I’m looking for alternative for existing tests written in QTP for my Win32 application written in Borland C++.
My candidate is White which based on UI Automation because it’s native solution,
I can create my tests using .NET/C# and easily integrate it with nUnit and Hudson.
White
http://white.codeplex.com
MS UI Automation
http://msdn.microsoft.com/en-us/library/ms747327.aspx
UI Verify
http://uiautomationverify.codeplex.com
I use UI Verify as a spy to identify properties of objects I want to find in my tests.
More or less when I can see something in the spy, I can find it using UI Automation/White.
Generally I don't have much problems with recognizing objects
but when I try to search some content inside the tab contained in Tab Panel
or try to see MenuItems of Menu bar then the problem appears.
UI Automation/UI Verify works wired. When I run UI Verify (1.0 version) I see that objects can be registered properly only then
when I set 'Focus tracking' option and click on target objects or change the keyboard cursor on them. Otherwise it's impossible to find them.
UI Verifier can show me children of my 'tab' panel then. But I can’t find them using UI Automation/White. This is example code:
Tab tab = window.Get();
ITabPage tabPage = tab.SelectedTab;
AutomationElementCollection newCol = tabPage.AutomationElement.FindAll(TreeScope.Descendants, Condition.TrueCondition);
window.Get("buttonName");
the collection is empty even though spy see the children.
Does any of you have some experience with White/UI Automation library that he/she would like to share with me?
I want to implement the tracking feature from the spy to my tests. Can you help me with that? I'm trying to study the code of UIA Verify spy. I think that there are two classes responsible for catching the objects: FocusChangeListener and FocusTracer - this is the code:
http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214260
http://uiautomationverify.codeplex.com/SourceControl/changeset/view/9992#214192
Requirements:
1. Windows SDK
2. .NET 3.5
3. White
4. UIA Verify code
Do you have any better alternative for White/UI Automation?
R.
Could you, the R or YoYo, put your form compiled or in source codes (preferable without the internal logic) somewhere on a file share?
I've never seen a control that'd be not caught using UI Automation if UIAVerify sees it. I saw such windows, which could be only caught with the Focus Tracking feature of UIAVerify. This case, such a window is untouchable by UI Automation search.
Regarding a control, are you sure that the controls you struggling with have the Name property? Maybe, this is a value available only by means of ValuePattern, not the Name?

Methods best practice - VB.NET

I have a program that is getting pretty big and it is a pain to find everything through all the functions and classes.
I am trying to break it up into other files based on their method.
Some of these functions have calls to others in the main class. I changed most my functions from private to public to access this. I had problems calling certain code created windows so importing mainwindow helped that.
My last problem is editing the mainwindow ui from one of the module files. I want to make sure im on the right page before i continue breaking it up. My only guess is that anything they updates the ui should be left on the main class.
Thanks
The only code in your form class should be code that talks to other classes and updates the UI based on data from other classes.
Depending on your application, the form class might handle change events from other classes to update the UI or pass user input to other classes in Change or Click events.
A couple options:
Use callbacks into the your main window.
Create events for when you need the form updated. Your program logic raises the events, and your main window class can consume them.