qt

How to handle proxies when using QNetworkAccessManager

Hey everyone, I'm facing some trouble when using the class QNetworkAccessManager. I use it to download a simple file from an url like "http://www.foo.com/bar/foobar.txt". When I start a download I use : m_pNetworkReply = m_pNetworkAccessManager->get(QNetworkRequest(m_CurrentFileToDownload)); Then I connect a few slots to receive, f...

QPainter and QTimer

Hi How to use QPainter and QTimer to draw a real time sinusoid like sinus(2*w*t+ phi). thanks. ...

Tab-Key blocks Circumflex (^)

Hi, i have a little Application where i can choose items by pressing ^, 1, 2, ... The problem is, when i press tab the ^-key (Qt::Key_AsciiCircum) doesn't work anymore until i press the tab-key again. Anyway the numbers are still working and are handled in the same keyPressEvent(...) ! I tried to also handle the tab-key but it seems it...

QPlainTextEdit for single line of input

I'm using Qt to write a database type program where the majority of inputs will be single lines, not documents of arbitrary length. Do I understand correctly that QPlainTextEdit is the most appropriate widget for this kind of input? If so, how do you set parameters for this kind of input? In particular: Height to the right value to co...

How to implement a video widget in Qt that builds upon GStreamer?

I want to use Qt to create a simple GUI application that can play a local video file. I could use Phonon which does all the work behind the scenes, but I need to have a little more control. I have already succeeded in implementing an GStreamer pipeline using the decodebin and autovideosink elements. Now I want to use a Qt widget to chann...

Hiding Qt widget and keeping widget space

In a simple form I made a few buttons and put a horizontal layout. When mouse leaves the area one of the buttons, the last one, should be hided. Using button->hide() it works, but all the buttons are rearranged by the layout manager. What I want is that all other buttons continue in their positions. I tried replacing the widget with a wi...

How to implement collision effects in a game ?

I building a game with QT. Every objects on my GraphicsScene inherits from GraphicsPixmapItem (Player, Obstacles, bombs...). I would like to implment collision effects. For example when the player gets hover a bonus he can pick it. With the QT framework I can get the collidings items but I don't know which type they are as there isn't i...

How to handle multiple collision type in c++ ?

I'm building a game in c++ using Qt. I got the collision detection right using GraphicsItem methods the thing is that I don't know how to deal with every different collision type as there is different objects with different behaviour. ...

whats up with QLayout->setParent

When I try to change the location of a layout with setParent the result is non-functional or odd. the following works: ui.txDiag_1->setParent(ui.tab_2); movingHlayout = new QVBoxLayout(ui.tab_2); movingHlayout->setSpacing(3); movingHlayout->setMargin(3); movingHlayout->setObjectName(QString::fromUtf8("movingHlayout")); movingHlayout->a...

What signal can be connected to an initial dialog display in pyqt4 (qt)

I have an application in which I would like to connect whatever signal is emitted when a pyqt4 dialog is displayed in order to do execute an initial method. I don't want the method to be called in the __init__ method for a number of reasons. I've spent quite some time searching but I have yet to find an answer. I'm sure there is a simple...

QWebPage triggers loadFinished() several times

I'm loading content into QWebPage, using load() method. But my loadStarted(), loadFinished() and loadProgress() handlers are calling several times. How can I detect that page is loaded completely with all it's content? ...

help needed for using qt designer files in python(silly noob question)...

Hello all, I'm new to PyQt though i know python a bit.. I wanted to Qt designer for GUI programming since it'll make my job easier. I've taken a simple dialog in Qt designer and converted using pyuic4. from PyQt4 import QtCore, QtGui class Ui_Form1(object): def setupUi(self, Form1): Form1.setObjectName("Form1") ...

Updating a QProgressDialog with a QFuture

What's the proper way for the main GUI thread to update a QProgressDialog while waiting for a QFuture. Specifically, what goes in this loop: QProgressDialog pd(...); QFuture f = ...; while (!f.isFinished()) { pd.setValue(f.progressValue()); // what goes here? } Right now I have a sleep() like call there, but that's not optimal (...

QSignalMapper and original Sender()

I have a bunch of qComboboxes in a table. So that I know which one was triggered I remap the signal to encode the table cell location (as described in http://stackoverflow.com/questions/1332110/selecting-qcombobox-in-qtablewidget) (Why Qt doesn't just send the cell activated signal first so you can use the same currentRow/COlumn mechani...

Does the use of styleSheets in a dynamic manner add alot of computation

I have about 40 buttons that are also indicators (On or Off) and once a second I refresh the color of these indicators depending on the state. I do this by changing the stylesheet. Is it over kill to do this and if so should I only set a new stylesheet when it the indicator has changed state or should I use something like QBrush? ...

Contents of PyString in Qt Creator debugger?

I've got a PyString* object that I would like to see the contents of. Is there any way to see the text of the PyString using Qt Creator's debugger? PyObject *import_str = PyString_InternFromString("__import__"); If it makes a difference, Qt Creator is a front end to GDB. ...

Receive data from dbus

Hi there. I need a hint on handling data structures send via DBus. The running service returns an Array of 2-Tuples containing two ints. In Python a(ii). Calling the method from the Qt app returns me: QDBusMessage answer = dbus_iface.call("hello", 'blaaa', 3, 4); QList data = answer.arguments(); qDebug() << answer: QDBusMessage(type=...

How to save an array of unsigned char to MySQL

Any idea on how to save an array of unsigned char to a field in MySQL database ? I'm considering BLOB, but how can I convert it to QByteArray and convert it back to an array of unsigned char when I want to ? BTW, I'm trying to save fingerprint data. ...

QAbstractSocket::UnknownSocketError

What could be cause of QAbstractSocket::UnknownSocketError when using QTcpSocket? CODE I'm getting this error code with the following code: this->connect(socket, SIGNAL(socketError(QAbstractSocket::SocketError)), SLOT(handleSocketError(QAbstractSocket::SocketError))); ... void MyClass::handleSocketError(QAbstractSocket::SocketError ...

What should I choose: GTK+ or Qt?

Can someone suggest what's the best uses for those libraries today? Is it just GUI, or do they have database, XML, networking, threading, etc support too? I was reading about them, and considered starting to learning/using one of them. What is the most common one? What's the difference between them? Why would you choose one over the ot...