Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
QChart* chart = chartView().chart();

What I have tried:

I tried looking at it. I am having a hard time figuring out what this is.
Posted
Updated 5-Nov-20 20:12pm

You need to learn the basics, not just ask questions about random parts of them: you aren't going to get far unless you do understand what it going on.

And "the dot here" is very, very definitely C++ basics!

:sigh:
Have a look here: What is the difference between the dot (.) operator and -> in C++?[^] but unless you understand quite a bit more than I suspect you do, even that isn't going to make a lot of sense ...
 
Share this answer
 
The dot, roughly speaking, it is the 'member access operator', it allows your code to access an object member (a public variable or a method).
Quote:
QChart* chart = chartView().chart();
The above code looks 'strange' to the novice because the dot is chained to a function call. The interpretation however is rather simple: the chartView() call returns an object, then the method chart() of the object itself is called, eventually the result of the method call is assigned to the chart pointer variable.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900