Run linux command line commands from Qt4
...and of course obtaining the output in some way I can use it. I'd use it for an ls | grep, but it's good to know for any future issues. Thanks in advance. ...
...and of course obtaining the output in some way I can use it. I'd use it for an ls | grep, but it's good to know for any future issues. Thanks in advance. ...
I am new in thread syncronization. I was reading many implementations of conditional variables, like boost::threads and pthread for win32. I just implemented this quite simple monitor with wait/notify/noifyall, and i guess that there are many hidden problems with it, that I would like to discover from more experienced people. Any suggest...
Using Windows Detours in C++, I've seen that it is possible to trampoline function calls so that you may intercept windows base functionality and return custom resultsets, without modifying the original function call. I was wondering if there is any way to override a Java Randomization call so that I may implement my own result set. ...
In C++ I have a char[256] variable that is populated by a call to an external DLL which fills it with data. From there I would like to add the char[] as a ComboBox item. char name[256]; name[0] = "76"; comboBox1->Items->Add(name); This creates a build error because char[] is not a type of System::Object. Any ideas on converting the ch...
The following line of code compiles just fine and behaves: list<const int *> int_pointers; // (1) The following two lines do not: typedef int * IntPtr; list<const IntPtr> int_pointers; // (2) I get the exact same compile errors for list<int * const> int_pointers; // (3) I'm well aware that the last line is not legal since the...
So I may have a rather unique use case here, but I'm thinking it should work- But it's not working correctly. Basically, I have a class that uses a static factory method ( create ) that returns a shared_ptr to the newly created instance of the class. This class also has a virtual function that I'd like to override from python and call f...
Hi Currently for each call in library,I am doing multiple iteration , Measuring time taken for each call and then calculating : Average time taken for each call Min time take Max time taken Standard Deviation But it seems its not a good method . As these time depends upon state of machine ,As if CPU is busy with other process res...
So I have a couple classes defined thusly: class StatLogger { public: StatLogger(); ~StatLogger(); bool open(<parameters>); private: <minutiae> }; And a child class that descends from it to implement a null object pattern (unopened it's its own null object) class NullStatLogger : public StatLogger { public: NullStatLogger...
I'm trying to use forward declarations and d-pointers to eliminate some include dependencies. Everything is working well, except that I have used XList typedefs for readability in many places (e.g: typedef QList<X> XList). The workaround for the typedef forward declaration issue is to use inheritance: class XList : public QList<X>{};. ...
In C++, is it safe to use an std::map or std::vector concurrently in different threads if you are NOT inserting, just doing .find() operations on it? ...
Hi, I am learning C++, but I am confused about abstract class and concrete class. Some real world examples would be appreciated. ...
Hello, I was able to build Qt 4.5 for Windows CE (ARM4VI) using MS VisualC++ compiler. Now, I am trying to compile Qt 4.5 for Windows CE 5.0 using Marvel C++ compiler v 2.2 (former Intel C++ compiler for XScale architecture) for achieving some performance benefit. It seems, that this compiler not officially supported for building Qt by ...
I am writing a program that will read lines from an infile using getline into strings, convert the strings to c-strings containing the first m nonwhitespace characters of the string, then concatenate the c-strings into a single char array. A sample file might look something like this: 5 //number of rows and columns in a grid 2 //...
Am working on a small problem and have spent quite a few hours trying to figure out what I did wrong. Using Dev++ compiler which at times has some cryptic error messages. I tried to make the Volume calculation a function and got it to work but I have 2 small nits. Will work on error checking after I resolve this. With the function ad...
I was wondering if something like this is safe... // Iterating through a <list> while ( iter != seq.end()) { if ( test ) { iter = seq.erase( iter ); } else { ++iter; } I know that iterating through a vector in this way would invalidate the iterator, but would the same thing occur in a list? I assume not since a list is se...
I work on a huge legacy project. There are a number of classes that are created basically only once (they should be singletons, but oh well) and then passed around to almost every other class in the program. So there is lots of code like this where the class has a nearly endless list of pointers in its constructor Foo(A* a, B * b, C * ...
I have a class that is defined as the following: template <class WidgetType> class CometWidget : public WidgetType; Inside a function I am doing this: dynamic_cast<CometWidget *>(iter2->second.second)->changesCommited_(); and it resolves the CometWidget type, complies and run correctly. The code runs inside the CometWidget class....
How can I read a Matlab cell array stored as a .mat file and having 3*3*2 multidimensional double data into a c/c++ array ? ...
Hello! I'm developing a QT application with QTCreator (and QT 4.5.3) on Arch Linux. I'm using KDE 4.3 The project is basically a GUI that let you insert a url and make some web requests to give the user some data back. The web requests are asynchronous. I've encountered a weird problem. If I start the application the first time and cli...
Hi, I'm developing an application in C++ on Windows XP, using Eclipse as my IDE, and a Makefile-based build system (with custom tools to generate the Makefiles). In addition, I'm using LZZ, which allows me to write a single file, which then gets split into a header and an implementation file. I'm using TDM's port of GCC 4. What tools o...