Questions tagged as 'c++'

1
answer

Access attributes of a vector of objects of another class using C ++ pointers

I'm doing a job for college where I have to set up a program to manage a restaurant that only delivers the orders are made by phone and internet using object orientation and pointers in C ++. I'm doing the following: I use two files for ea...
asked by 19.09.2015 / 19:40
1
answer

Return Qt during release

When I compile my project as debug , it works normally, but when I try to compile in release the following message appears in compile Output:    cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'   make: *...
asked by 23.02.2015 / 20:04
1
answer

C ++ / Arduino Array in class

I have a problem in using an array of pointers, I need to create an array with pointers that refer to an integer value of each object of another class. Example: arrayDePonteiros[0] = objeto.int; In case this array is inside a class and a...
asked by 16.08.2014 / 22:51
1
answer

Printing TableView data with QPrinter

How can I get the data of a TableView add in layout html and print with QPrinter ? Code: QString html; html = "<div>Titulo</div>" "<div>etc</div>" "<div>etc</div...
asked by 22.03.2014 / 17:33
1
answer

How to bind a variable from a class in c ++ to lua script?

How do I access and set a variable from a class made in C ++ to Lua? // C++ #ifndef SCRIPTSTORAGE_H #define SCRIPTSTORAGE_H #include "HTest.h" #include <luajit/lua.hpp> #include <iostream> struct HObject { unsigned int id;...
asked by 29.03.2014 / 18:54
2
answers

Qmake - Independent executable

How do I compile a Qt Creator program (.pro) with "static link"? I compiled it for QT Creator, but I need to copy about 6 dlls into the executable folder, some of them are over 100mb. I read the documentation , but I did not quite understand ho...
asked by 25.12.2014 / 03:02
1
answer

Is it a good practice to use virtual functions in non-derived classes?

When I was learning C ++ in a book on the polymorphism chapter on virtual functions, that the virtual keyword served to indicate that that function was going to be overwritten in another part of the code, since then I've added virtual in all my d...
asked by 27.06.2018 / 19:13
1
answer

Definition and function of QSharedPointer

As far as I can understand, QSharedPointer is a smart pointer, that is, a pointer that offers automatic garbage collection. If possible I would like a code that would best explain this, including when to use it.     
asked by 09.06.2014 / 19:44
1
answer

Doubt in dynamic memory allocation

In the code below, releasing memory from B also frees from A? int* A = new int[4]; int *B = A; delete[] B;     
asked by 09.06.2014 / 16:47
1
answer

Is there inclusion mapping for '#include' cmylib ''?

Reading this question , we are talking about adding headers to #include <filename> , the author speaks the following:    It is common to have these names that map to other files (eg, cstring -> string.h ). Then th...
asked by 28.09.2017 / 00:36