qt

Using a QNetworkAccessManager.get, how can I decide to abort?

I am attempting to use the QT QNetworkAccessManager class to manage some downloads in a multi-threaded C++/QT application. On worker thread (edit: the thread is seperate for other reasons aside from doing the download), I'm would like to do a get to an external server and be ready to receive the results with the code: ... m_nam = new ...

How to test proximity to the outline of a QGraphicsPathItem?

I'm trying to test whether a given point (x, y) is located on or close to the outline of a QGraphicsPathItem. Using QGraphicsItem.contains() or .collidesWithItem() / Path() will not do: those also return True if the point is contained within the area on the interior of the path, while I want to test only for points on the outline. How ...

PyQt, Qt, one event handler working with many items

Hello, I have a couple of checkboxes on my form, and I don't want to write separate event handler for each, because they all will implement the same logic. Instead I want to write just one event handler that will know about what checkbox has been clicked. E.g. in Delphi I can use it this way: function click_handler(sender): begin ...

Qt, non-modal dialog doesn't close itself

I have one main Window and one non-modal Dialog. I suppose non-modal dialog should close itself when I close main window. Instead if I open non-modal dialog, I should close manually both of them - if I close main window, non-modal dialog will remain, and I need to close it manually. # App and main window app = QtGui.QApplication(sys.arg...

Simple cross-platform free audio library for raw PCM?

Hi. I'm writing a cross-platform Qt-based program that from time to time needs to play back audio supplied externally (outside my control) as raw PCM. The exact format is 16 bit little-endian PCM at various common sample rates. My first obvious idea was to use Qt's own Phonon for audio playback, but there are two problems with this appr...

C++ Pac-Man : SDL or Qt ?

Hi everyone, I have to code a Pac-Man clone in C++ for a school project, and I'm hesitating between SDL and Qt for the graphical implementation. I have already a little experience with SDL, but I wanted to give Qt a try. I was asking myself if it is "technically" realisable and if Qt is a good choice for that. I know that it have an an...

os.path.join() in Qt?

I'm looking for an easy, cross platform way to join path, directory and file names into a complete path in C++. I know python has os.path.join() and matlab has fullfile(). Does Qt has something similar? QFileInfo doesn't seem to be able to do this. ...

file selector in a qtablewidget

I'm trying to get one cell in a QTableWidget to be a box with button at end"..." with file selector, but don't know how to change what kind of widget the cell is. ...

Can I use QwaitCondition.wait() in a slot called by the main thread?

if the maximum wait time is 10 ms can i use qwaitcondition in Qt's main thread? ...

Loading images from various sources in QTWebKit

Hi I am trying to create a "smart" web browser to load local images. Basically it works as a GUI for an application. I am using QTWebKit to power the browser, the problem is that the images of a given page can be found in different places, some are local files, others are in different resource files. For example: an HTML node to load i...

Qt - emitting slots instead of signals

Suppose I have a QPushButton widget that is connected to a slot by its clicked() signal. This first slot in turn calls another slot by the emit keyword. The second slot takes an argument from the first slot and do something with it. It worked, but from what I understand of the signals-slots pattern, it only makes sense to emit a signal. ...

Game development with Qt: where to look first?

Hi there, So, I'm going to develop my Pac-Man clone with Qt. The problem is that I do not really know where to start. I quickly take a look at the documentation and some demo. I also downloaded some game sources on qt-apps.org. And it seems that there is a lot of ways to develop a game with Qt! In your experience, which part of Qt sho...

converting xsd:datetime to QDateTime

Hi, I need to convert dateTime field(xsd:datetime) which is extracted from rss/atom into QDateTime, but QDateTime does not have support for time zone, any idea on how can we achieve this? Ex: QString("Tue, 09 Feb 2010 00:01:00 GMT") ==> QDateTime() QString("1985-04-12T23:20:50.52Z") ==>QDateTime ? QString("1937-01-01T12:00:27.87+00:...

opencv in QT creator

Hi, Since I am very UNHAPPY with Visual Studio (It's just Junk!) I am trying to use QT creator, which seems to be the solution for my c++ projects to get easily run in my Mac also. But I am using OpenCV. So, How do I set libraries in QT? (include folder and maybe some libs) I am trying with this app: http://www.qt-apps.org/content/show...

Does Qt support OpenMP?

Hi, I am using OpenMP in my Visual Studio projects and currently thinking very seriously in changing to QT creator. (Doesn't Visual Studio suck?,I expect much more from Microsoft) But anyway... Does QT creator support OpenMP? In case of that, what should I do to enable it? Or maybe is enabled by default? Do I need to do something speci...

Signals don't get emitted

I have a simple class Networking with a: private: QNetworkAccessManager *httpclient; I create an object in the constructor and connect signal and slot: httpclient = new QNetworkAccessManager(this); connect(httpclient, SIGNAL(finished(QNetworkReply*)), this, SLOT(httpRequestFinished(QNetworkReply*))); Now I am going to call th...

Insert Images to list

Hi.. i am new to QT, i am facing some problems in inserting images to list view. can you please figure what is the problem in code snippet int main(int argc, char *argv[]) { QApplication a(argc, argv); QListWidget* list=new QListWidget(); QListWidgetItem *item1=new QListWidgetItem(QIcon(":\temp\boat.png"),"BlueHills",list); ...

QCompleter forces double enter

Hello, I have a QCompleter that is forcing my users to hit enter twice when the popup is visible but is not used to select an item. The model for the QComboBox associated to the completed is used as the model for the completer. QCompleter *completer = new QCompleter(this); completer->setCaseSensitivity(Qt::CaseInsensitive); comple...

Pointer to QList - at() vs. [] operator

I'm having problem with understanding some of QList behavior. #include <QList> #include <iostream> using namespace std; int main() { QList<double> *myList; myList = new QList<double>; double myNumber; double ABC; for (int i=0; i<1000000; i++) { myNumber = i; myList->append(myNumber); AB...

dynamic memory in QList

I don't have much experience with QT and this problem came out today. QList<int> memList; const int large = 100000; getchar(); for (int i=0; i<large; i++) { memList.append(i); } cout << memList.size() << endl; getchar(); for (int i=0; i<large; i++) { memList.removeLast(); } cout << memList.size() << endl; getchar(); After ...