I have a QPushButton and on that I have a text and and icon. I want to make the text on the button to be bold and red. Looked at other forums, googled and lost my hope. Seems there is no way to do that if the button has an icon (of course if you don't creat a new icon wich is text+former icon). Is that the only way? Anyone has a better i...
e.g. a mapping for
Mac OS 10.6.3 aka Snow Leopard => __APPLE__ && __LP64__?
Windows 7, Windows XP => __WIN32__
Linux => __LINUX__
...
I try to get the full-name of the current log-in user (Fullname, not username).
The following code C#, C++ works fine but on XP computers not connected to the Net, I get empty string as result if I run it ~20 minutes after login (It runs OK whithin the first ~20 minutes after login)
A Win32 API (GetUserNameEx) is used rather that Princi...
std::map< std::string , std::string > matrix_int;
typedef std::pair< std::string , std::string > lp_type;
BOOST_FOREACH( lp_type &row, matrix_int ){
}
this can not be complied:
error C2440: 'initializing' : cannot convert from 'std::pair<_Ty1,_Ty2>' to 'lp_type &'
when I have ',' in element type, boost doc says I can use typedef or p...
I have a struct like this:
struct db {
string name,sur;
int num;
};
And declared an array of db structs:
struct db a[10];
and every member of a[] is filled with a name, surname and a number but there can be the same number appearing multiple times.
I need to sort the numbers, and print the results, i.e. sort by the num of each s...
Hi all,
I have two questions about Google's dense_hash_map, which can be used instead of the more standard unordered_map or hash_map:
How do I use an arbitrary binary data memory segment as a key: I want a buffer+length pair, which may still contain some NUL (\0) characters. I can see how I use a NUL-terminated char * string , but tha...
n3092 (final draft) says, under 5.17/9
A braced-init-list may appear on the right-hand side of
- an assignment to a scalar [...]
- an assignment defined by a user-defined assignment operator [..]
While in GCC 4.5.1-pre9999, I can compile this (using -std=c++0x, NOT -std=gnu++0x)
#include <iostream>
int main()
{
...
I have read a lots document on NPAPI but I still do not understand:
How the NPP_NewStream of NPAPI wall called? Automatically by Browser, whenever it load a page, an image, an video,.... or manually by our plugin-request ?
...
While running the C++ code for festival,i am using multiple languages like american diaphone,italian etc. but when after playing for one language,i select another language then the terminal shows the error "SIOD:ran out of storage" and does not do anything.
Can anyone help me??
...
Hello! I have some kind of an ideological question, so:
Suppose I have some templated function
template <typename Stream>
void Foo(Stream& stream, Object& object) { ... }
which does something with this object and the stream (for example, serializes that object to the stream or something like that).
Let's say I also add some plain wr...
Hello Everyone,
I was wondering what is the best XML Library in C++ (I'm using Visual Studio), considering fast set-up is critical. Basically, I want to create a file to save annotations on various .avi files.
Thank you in advance.
...
I've been banging my head on an issue and before I continue injuring myself some more, I'd like to confirm:
Is it possible to have a GCC project that uses libraries that are compiled with and without RTTI?
So, for example, I have project A (compiled without RTTI) that uses library B (compiled with RTTI) and library C (compiled withou...
I've downloaded the source code and am wading through it --- does anybody know where the QMs for the images and the residuals are stored?
...
All,
I must have a fundamental neuron missing, but I cannot get a simple program to load a PNG file and display it in a window. I'm not sure if it is a QPixmap, a QPicture, or what. All of the samples in the QTCreator are a bit more than I need right now. Baby steps...
I can get the window to display, and the program doesn't barf whe...
Hi,
Does anyone know why is Magic++ giving me RGB values less than 1? Thanks in advance.
...
Hello,
I've been trying to solve this problem for quite sometime but I am having trouble with it.
Let's say on a trigger, you receive values.
First trigger: You get 1
Second trigger: You get 1, 2
Third trigger: You get 1, 2, 3
So, I store 1.
For 2nd trigger, I store 2 since 1 already exist.
For 3rd trigger, I store 3 since 1,2 alre...
In my application i'm declaring a string variable near the top of my code to define the name of my window class which I use in my calls to RegisterClassEx, CreateWindowEx etc.. Now, I know that an LPCTSTR is a typedef and will eventually follow down to a TCHAR (well a CHAR or WCHAR depending on whether UNICODE is defined), but I was wond...
For some reason, my project won't compile when I try to create a wstringstream:
std::wstringstream stringstream;
This causes error C2079:
'stringstream' uses undefined class
'std::basic_stringstream<_Elem,
_Traits, _Alloc> with [_Elem=wchar_t, _Traits=std::char_traits, _Alloc=std::allocator'
What am I doing wrong?
...
the following code:
/***************************************************************************/
boost::mutex m;
struct func {
func(int v):n(v) {}
void operator()() {
{ boost::mutex::scoped_lock l(m);
std::cout << "run function " << n << std::endl;
}
for ( int idx = 0; idx < 4; ++idx ) {
{ ...
If I have a wstringstream, and I want to get its .str() data as a LPCWSTR, how can I do that?
...