You are not logged in.

Search results

Search results 1-20 of 60.

Wednesday, December 26th 2012, 1:14pm

Author: mercodus

Not able to compile a Astrisk c++ program

It looks like the problem is the include path, the compiler cannot find the header file (..\AstCTIClient\/cticlientapplication.h:56:31: error: QtSingleApplication: No such file or directory, the other errors are sympathetic to that failure. If you are using qmake then simply add INCLUDEPATH += <path to QT header files> to your .pro file (it'll be in your source code directory) Hope this helps

Wednesday, December 26th 2012, 12:04am

Author: mercodus

how to get hwnd with qt5.0?

I'm not 100% certain because I haven't tried it, but the response in this link may be what you want; http://comments.gmane.org/gmane.comp.lib.qt.user/4895

Monday, December 24th 2012, 10:37am

Author: mercodus

QTcpServer question

Is the port being blocked by a firewall at the server end? You might want to port scan the machine that has the server to make sure that the port is open. use a tool like nmap to scan the servers ports states. I assume you are using Windows as you use ipconfig rather than ifconfig. If so, you will need to install pcap as well.

Monday, December 24th 2012, 12:19am

Author: mercodus

Introduction - Choosing first book

A bit of a late reply but I would recommend; C++ GUI Programming with Qt 4 Jasmin Blanchette, Mark Summerfield ISBN 0-13-187249-4 I think that this is a great book for the beginner as it goes into some good detail. (I still refer to my copy on occasions)

Sunday, December 23rd 2012, 11:37pm

Author: mercodus

QtConcurrent::run executes function in the calling thread

Oh, the joy of multithreading... You need to use mutex locks around your unsafe function. Check out QMutex and its associated functions, these can be used to lock a critical section while your thread unsafe function runs, you then unlock it and the next waiting thread can gain access to it. There are, of course, the issues of any global variables that the unsafe function might use and which maybe accessed elsewhere by another thread. To be honest, it would probably be safer and more productive t...

Sunday, December 23rd 2012, 11:18pm

Author: mercodus

I can't print a text message in qt prompt

Hi, I have tried building and running this and came across an interesting couple of issues; When I ran the code having fixed the typo, a missing " on the line with Hi, I found that not all of the text appeared and what did show was not in the correct order. The output I got was; Test Hi rather than the expected; 1Test Hi ola I figured that this was an output buffer issue, so I added fflush(stdout) after the printf line like so; Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #i...

Sunday, August 19th 2012, 5:28pm

Author: mercodus

sending the string in inputted in line edit to terminal

Theh problem you have is that a QString is not a std::string and they are not directly compatible. There are two things that you could use; 1. std::cout << value.toStdString(); 2. qDebug() << value; qDebug() is useful for writing to the terminal if you are looking at debug output.

Saturday, August 18th 2012, 4:31pm

Author: mercodus

Comparing 2 char arrays?

You can also use std::memcmp() which is part of the cstring include file. Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include <iostream> #include <cstring> int main(int argc, char* argv[]) { const int arrLen = 8; char arr1[arrLen] = {'\x00','\x00','\x00','\x00','\x00','\x00','\xff','\xff'}; char arr2[arrLen] = {'\x00','\x22','\x33','\x55','\x40','\x88','\x15','\x3a'}; if (std::memcmp(arr1, arr2, arrLen)) { std::cout << "Arrays do not match" << std::endl; } else { std::cout << "Arra...

Saturday, August 18th 2012, 4:10pm

Author: mercodus

GPS Tracking in Qt Window Application

I am assuming that you have already aquired the GPS data record from some source and now have a latitude and longitude position in decimal format. You will need a method of converting the decimal Lat/Long to a position within the window in order to tie the GPS position to a map position; I also assume that you are plotting against a map. You may want to investigate mercator projection for this. QGraphicsScene, QGraphicsItem, etc will give you the tools to draw the map and plot your GPS position.

Saturday, April 21st 2012, 7:16pm

Author: mercodus

client problem

The compiler will use the best matching connect() function that it can find within scope, starting in your class and working backwards. To specify which function to use you can force scope using ::, for example myBaseClass::func() will ensure that the base class version of func is used, regardless of the subclass (of myBaseClass) I am in. You are wanting the connect() from the global scope, so you need to use; Source code 1 ::connect(mySocket, (sockaddr *)&serverSock, sizeof(serverSock)); for ex...

Sunday, March 4th 2012, 3:32pm

Author: mercodus

dynamic UI

yes, this is possible in Qt. In fact it is fairly straight forward.

Sunday, March 4th 2012, 12:38pm

Author: mercodus

[SOLVED] IPC through QLocalSocket and QLocalServer problem

The error seems to be caused in the server code by you resetting the device position to 0. I found that if I store the reply and then send the size and reply it works fine. Your code: Source code 1 2 3 4 5 6 7 8 9 QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_0); out << (quint16)0; out << "message you sent me: " << message; qDebug() << (quint16)(block.size() - sizeof(quint16)); out.device()->seek(0); out << (quint16)(block.size() - sizeof(quint...

Saturday, March 3rd 2012, 5:45pm

Author: mercodus

Not compiling

cl.exe is the C++ compiler that comes with MS Visual Studio, do you have it installed or are you using Mingw? (I assume that Mingw uses gcc/g++ rather than cl. I haven't used Mingw and am not a Windows user, so I can't install it to have a look)

Saturday, March 3rd 2012, 5:30pm

Author: mercodus

How to conf for Qt Gui App?

Does the application try to start on the PC and the abort? (ie, do you see a window which then disappears) Do you get a specific error message? Have you installed all of the necessary Qt dll files and can the application see them (ie, are they on the %PATH%, in the applications directory, or in a place where the application can access them)? Is it a databases application, if yes then does it have the Qt drivers installed correctly?

Sunday, August 28th 2011, 5:21pm

Author: mercodus

/usr/bin/ld: cannot find -lXrender

As far as Linux is concerned, you do not have libXrender.so (even though you have libXrender.so.1 and libXrender.so.1.3.0). This is easy to fix though. All you need is a symbolic link to the latest version. su to root (or use sudo if you prefer) and then ln -s /usr/lib/libXrender.so.1.3.0 /usr/lib/libXrender.so

Saturday, August 20th 2011, 2:39pm

Author: mercodus

QFileDialog error (again)

Hard to say without seeing any code. Looks like a pointer error though. Can you post the code that has the problem?

Saturday, August 20th 2011, 2:33pm

Author: mercodus

QFileDialog::exec terminates after selection

Have you tried using QFileDialog::getOpenFileNames() instead? It is a convenience static function that will allow you to select multiple file names.

Thursday, August 18th 2011, 11:41pm

Author: mercodus

Signal between threads.

I doubt that it is safe to pass a address reference between threads, it is asking for trouble. Do you really need to do that?

Thursday, August 18th 2011, 11:22pm

Author: mercodus

Problem with printing two pages

What OS are you using? Different OSes handle printing differently. Speaking generally, the executable will pass and document to be printed by a physical printer to the print manager, which is then responsible for sending the document to the printer. As far as your program is concerned, once the print manager has the document then it is printed. You can get the state of the "printer" using PrinterState(), which will return an enum of the printers current state. You could have a loop which sleeps ...

Thursday, August 18th 2011, 11:02pm

Author: mercodus

using 2 threads[SOLVED]

I'm not exactly sure what is causing your problem but would it not make more sense to have two distinct thread classes? For example, SineWaveThread and SquareWaveThread. Perhaps have a Wave base class which is derived from the thread class. The sine and square wave classes can then derive from the base wave class and add any additional code. Remember that all GUI actions have to be in the main thread.