How to create a QTable widget which has 2 columnes, and in first column there is a QComboBox and in the second column there is a QSpinBox so that the combo box gets all the space of table and only a very small place leaves for QSpinBox (for 2-3 digits).
...
Dear reader,
I noticed that I'm often in the need of a container class. For example when working on a particle system, I create a container class Particles which has a member vector<Particle*>. Then I call: Particles* my_particles like my_particles->draw(), and in the Particles.draw() I iterator over the vector<Particle*> and call draw...
I'm using tinyxml to parse xml files, and I've found that error handling here lends itself to arrow code. Our error handling is simply reporting a message to a file.
Here is an example:
const TiXmlElement *objectType = dataRoot->FirstChildElement( "game_object" );
if ( objectType ) {
do {
const char *path = objectType->At...
Does casting a variable to another type return a temporary copy of that variable? if so then why can't you reference the temporary variable to a function.
void func(int &i) //error converting parameter 1 from int to int&
{
}
int main()
{
double d = 6.8;
func(int(d));
}
...
Does anyone know if there is a support for cell broadcast on Android?
If yes, can anyone point me to any example that shows how to use it? (e.g. receive messages on some channel)
Thank you.
...
Possible Duplicate:
Problem with Macros
Hi all
I have defined this macro:
#define SQ(a) (a*a)
and called it in this way:
std::cout << SQ(2+3) << '\n';
the output was 11. Why ?
Thanks
...
Possible Duplicates:
reduce the capacity of an stl vector
Is this normal behavior for a std::vector?
I know that std::vectors do not 'free' the memory when you call vector.clear(), but how can I do this? I want it to release all of its resources once I clear it but I don't want to destroy it.
Here is what is happening rig...
Hello,
I am facing an exception in C++/CLI while dynamically loading assembly which itself an EXE created in C++/CLI managed mode using Assembly.Load. It successfully loads a dll assembly, but fails to load EXE assembly and generates following exception:
An unhandled exception of type 'System.IO.FileLoadException' occurred in TestManag...
I have a std::vector of a class called OGLSHAPE.
each shape has a vector of SHAPECONTOUR struct which has a vector of float and a vector of vector of double. it also has a vector of an outline struct which has a vector of float in it.
Initially, my program starts up using 8.7 MB of ram. I noticed that when I started filling these these...
(Not sure if this should be CW or not, you're welcome to comment if you think it should be).
At my workplace, we have many many different file formats for all kinds of purposes. Most, if not all, of these file formats are just written in plain text, with no consistency. I'm only a student working part-time, and I have no experience with...
Is there any faster methods for improving texture quality on oblique angles than using anisotropic texture filter?
In my previous question i asked if it takes more memory than normal mip mapped textures, but apparently it doesnt, so i am hoping this could be optimized.
So is there any way to optimize the rendering speed ?
...
I have a C++/Qt QThread worker thread, which stores its current status as an ENUM (e.g. values such as Working, Finished). Only the worker thread sets the ENUM.
I need to be able to read the status of the worker thread from another thread (the GUI thread), to display on the screen whether work is being done.
Is it safe to read/write th...
hello
(I modified the original question to be more meaningful)
With respect to return statement, are Raii object destroyed before/after/between return statement?
for example
size_t advance() {
boost::lock_guard<boost::mutex> lock(mutex_);
return value_++; // is lock destroyed after increment?
}
thank you
...
Possible Duplicate:
C++ invoke explicit template constructor
Hi,
template <typename T>
class testing
{
public:
template <typename R>
testing()
{
// constructor A
}
template <typename R>
testing(const R&)
{
// constructor B
}
};
What is the syntax to invoke the constructor A?
...
How to open file\live stream with FFMPEG edit each frame with openCV and save that as encoded with FFMPEGfile\live stream?
...
Pretty simply question ... Is there any predefined function in Qt which can determine whether a string contains only a number ? .. with valid entries such as "28" and invalid entries such as " 28", "28 " and "2a8 .... ?
...
I've got a specific window with the window style WS_CHILDWINDOW. It's the child window of a window of which I've got the handle already. This window is the second-last one. How do I get it?
It's C++ by the way.
...
GCC doesn't seem to approve of instanciating templates with local classes:
template <typename T>
void f(T);
void g()
{
struct s {};
f(s()); // error: no matching function for call to 'f(g()::s)'
}
VC doesn't complain.
How should it be done?
...
Hello all,
I have an exam on C++ coming up, and I'm solving a few ones from past years. I have this question in one of them:
A function calculates the volume of a
prysm. Arguments passed are height,
depth and width. Arguments and return value are doubles
Depth is optional and
should default to 10.
Hypothesis 1:
All para...
I wanted to know if its possible to emit some specific signal through coding .. For example, I want to emit another button's clicked event without the user actually clicking that button .. can do I do this ?
...