unknown class name 'MyCentralGraphicsItem'; did you mean 'MyCentralRectItem'? - c++

I have a bug that I have been trying to fix for hours, it is not a big deal but I really don't know what to do here. I am using Qt, but there is no need to know Qt, just C++ and OOP.
This is the repository in which I am pushing all the project. Don't worry about all the files, the ones that I am having problem with are MyCentralGraphicsItem and MyCentralRectItem. QAbstractGraphicsShapeItem is an abstract class provided by Qt. I inherited from it to create my custom Items.
You can find the output error in the bug file in the repository.
Thank you for your help!

Related

Basic visual studio c++ 2015 help mfc classes?

I'm trying to get started with visual c++ by looking at some open source code and following some tutorials. I'm looking at the code and trying to figure out where parts are that I could modify but it's all just a bunch of confusing mess to me at this point for some very large open source and tutorial programs I'm looking at. I can't find the code that contains information about a specific variable or input for instance that I would like to try to understand better.
One of the things you see in beginner tutorials is that you can bring up the resource visual part of the application. Most tutorials start with drawing out the gui interface. The thing that they do to bring them to the coding area is just double clicking on the element. When I do this with my example source files though it just brings up the MFC add Class wizard, it doesn't take me to the code? I've tried researching what that is and gotten nowhere. Can someone explain to me why it doesn't take me to the relevant code what the mfc class wizard is, and how to find the parts of code that spcifically having to do with the particular input box/slider/dropdown ect easily?
Thanks for any help!

C++ Class functions differently based on whether used in a QTConsole Application or QTWidget

I have a class , which creates a graph like structure on the heap and updates the nodes in the graph using a recursive function. When I use this class in a QT Widget Application , it behaves in a particular way , but when I use it as a console application , or when I compile it directly on linux it behaves in a different manner.
In both the QTApplication and Console I use the class in the same exact manner. And I have spend the entire day trying to find some reason for this, but no luck.
Does any one have a vague idea about why the program might behave differently [Generally] ? If you could give me some idea about what might be causing this , it would help me greatly.
PS. I apologize for not giving details , but the class is about 500+ lines and the makefiles are very large too , so I don't really know what would be relevant.

Can I create a new class in Sublime text 2?

I have a question. I am learning C++ with Bucky's C++ Programming Tutorials on youtube. I am on the 15th video, and in that video he uses CodeBlocks to place his classes in a separate folder by going to "File/New/Class" a popup menu appears and it automatically creates a .h and a .cpp file setup with the class you want.
I want to know if I can create a new class just like that in sublime text 2. Or if there is a plugin for doing so.
Im very sorry if the title is misleading at all, but that was really the only way I could think of to word it.
Any help would be greatly appreciated!
Also: My operating system is OSX Mavericks.
I don't think Sublime has this option as it is not a a IDE but rather a fancy text editor, even though I guess some people use it as an IDE.
I would recommend using qtcreator or code::blocks.
However if you are new to programming it is a good exercise to learn how to link your classes from scratch, and not have them linked and compiled for you with 2 mouse clicks.
Sublime Text Editor doesn't provide this facility. Classes can be separated only in IDEs like MS VisualStudios and CodeBlocks.
In further videos, Bucky will use the separation of classes, but that stuff can also be done without separating the class.
If you still looking for a sublime text plugin for creating classes.. I’ve written a plugin for that a few months ago.
You can install it via package control -> https://packagecontrol.io/packages/C%2B%2B%20Classhelper
But it only creates classes (header file, source file) but it is not adding the targets to a makefile.

MFC Container based application

I have a Doc-View architecture based project completely ready. But now i want to convert it in container based application to provide OLE support to existing project.
if anyone know how to convert, please reply as soon as possible. i just need a way without copy paste of existing code to new container based application- i tried - not worked even after settings change.
There is a good worked example of this here. Basically all your CDocument derived classes must be now be derived from COLEDocument, and you need some extra code in your WinApp.InitInstance.
If you post the code that you tried, you may get a more detailed response as to what is going wrong.

CMFCToolTipCtrl or CTooltipManager examples?

Has anyone tried using these new VS2008 MFC classes yet? I can't seem to find any examples anywhere. Even the VS2008 samples(1) don't mention these classes. (They use CToolTip.)
(1) Update: My mistake. I had downloaded the non-SP1 samples. I see that the SP1 samples have samples specifically for the 2008 Feature Pack, including the DlgToolTips and ToolTipDemo projects mentioned in an answer. Unfortunately, they don't address doc/view or CTooltipManager.
Specifically, I'm trying to display tooltips in a standard MFC view/document application where there are two side-by-side views whose parent is CSplitterWnd. I had this working pre-SP1, and I thought this'd be a good time to try the new Feature Pack tooltip classes.
Is there any way to make these things work without overriding PreTranslateMessage() and manually calling RelayEvent()? (I don't think I've seen anything in MFC as poorly designed as tooltips.)
It doesn't seem as simple as merely calling CTooltipManager::CreateToolTip() and then AddTool() on the created tip.
In case you haven't seen it, there is a very brief example here
Have you looked at the DlgToolTips and ToolTipDemo sample applications? These both use classes which inherit CMFCToolTipCtrl. DlgToolTips includes code that calls RelayEvent from PreTranslateMessage, but ToolTipDemo doesn't.