qt4

Qt Drag&Drop with own widgets?

I created a little widget on my own, including a QProgressBar and a QLabel in a QVBoxLayout. It has also a function which returns the text of the label (self-created). Now in my MainWindow I have two other QHBoxLayouts and I want to drag and drop my widget from one to another. It also works when I click on the little free space between t...

Debug Qt signals, slots and connections

Is there a way to see which signals are fired, and if there is a slot connected to them? Ideally, we'd like to see all signals, not just those of a particular class or method; e.g. QSignalSpy only allows us to track specific signals of specific instances. In our application, we've seen performance problems because of a signal being emi...

Customize a Qt Tree Widget

Is it possible to customize a tree widget so that the full row will be selected and also move the items a little to the left so that there will not be that much white space? I would like it to get it looking like this: Instead of the default look that is this: ...

PyQT: Rotate a QLabel so that it's positioned diagonally instead of horizontally

Hi folks, I'm working on a touch screen app where gui space is very tight. I'd like to rotate a QLabel a bit so that it's either vertical, or offset at a diagonal a bit. Any suggestions? I couldn't find anything relevant on the QLabel interface. Thanks so much! ...

How do I create a rotating cube effect in Qt?

I have a QGraphicsView and a slide show of QGraphicsScenes, at the moment when the user switches to the next slide I just change the Scene that the View is looking at and it changes instantly to reflect that. What I would like to do it create some transition effects, such as the rotating cube or the slide in/out. However looking at the...

Qt4 Designer and Ruby, what am I doing wrong?

So I've been trying to make ruby read my Qt4 design and it's not working, at all. I've created a design in Qt4 Designer and saved it as a .ui file. Then I used rbuic4 to convert it to a design_ui.rb and Qt4. My current ruby main file looks like this: require 'gui/design_ui.rb' require 'Qt4' class AppMain < Ui_MainWindow def initialize...

Why isn't QString::localeAwareCompare() working correctly

A Finnish customer tells me that the correct (locale aware) sorting for Finnish is: a-z, å, ä, ö. But QString::localeAwareCompare() returns it as: a, ä, å, b-o, ö, p-z in Qt 4.4.2 on Windows Vista. #include <qapplication.h> #include <qlocale.h> #include <iostream> #include <tchar.h> int main( int argc, char* argv[] ) { QLocale::se...

QSharedPointer Invalid Address specified to RtlFreeHeap

I have a program that makes heavy use of QShared Pointer. When I execute my program it runs fine, but when I debug it with GDB it starts throwing errors. "Invalid Address specified to RtlFreeHeap" is thrown in the following code: QSharedPointer<PersistentList> p = PersistentList::createEx(wrap("abc")).dynamicCast<PersistentList>(); QS...

Problem with adding time to QTime and QDateTime in Qt.

I can't get time adding functions to work. I'm using Qt4. Here is the code snippet, which produces two identical times instead of 100s different. void main() { QTextStream out (stdout); QTime t = QTime::currentTime(); out << t.toString("hh:mm:ss") << " -> "; t.addSecs(100); out << t.toString("hh:mm:ss"); } ...

QT, MySQL and BLOB

Hello Please! Help me with this! I have QT 2010.05 and MySQL 5.1.50 (with the corresponding sources and libs) on XP. I'm trying to insert an image into a BLOB field in a table like this: CREATE TABLE `contenido` ( `idx_contenido` int(11) NOT NULL AUTO_INCREMENT, `nombre` varchar(256) COLLATE latin1_spanish_ci DEFAULT NULL, `con...

QT Navigation and Webservice.

Hi, I am developing the apps using Nokia QT SDK. I have some doubts. Please help me. 1) In project , I have to call the webservice before UI rendering. because the UI is based on the webservice result. How to do in the QT? 2) In project , I have two screens. I want to move the screen from one to two and two to one. How to do this on...

Is input methods pervert QLineEdit from receiving KeyPressEvent?

I send this bug to Qt team: http://bugreports.qt.nokia.com/browse/QTBUG-13726 and here is the description: QLineEdit/QTextEdit doesn't receive keyPressEvent on N97 I have a custom widget which inherits from QLinedEdit, in this widget I override event(QEvent * event), keyPressEvent(QKeyEvent *event) and keyReleaseEvent(QKeyEvent *event )...

QT Interface with Slots

I made an interface and plugins by following this tutorial: http://doc.trolltech.com/4.6/plugins-howto.html and everything is working fine. But know I would like to connect a Signal to a slot of the plugins. Trying to do that I get an error, that the interface i lacking the Q_OBJECT Macro. When I Add it I get an error that now the Inte...

QT webservice _UI Rendering

Hi, How to call the webservice before UI rendering in QT? I m using QNetworkManager for calling the webservice and parsed by QJson. I would like to call the webservice before the UI dispaly on the simulator ... I am very new bee in this technoloy. Thanks a lot. Please help me. It is very urgent to me... any one help me.... :( :( ...

Change visible application name (Windows)

Hello, I am looking for a way to change my application name (that appears on right click on Windows 7 taskbar): To something more informative like: How do I do that? I am using: Qt 4.7 (MinGW), Windows I have found some info about using certificates and signing executables, but I am not sure if it is what I need. I know how to c...

Qt: How to put collection of GUI-Elements into independent SubClass (with seperate *.ui file)

Hi, I'm trying to collect an often used subset of GUI-Elements together into one Subclass, which can be "included" into the real GUIs later without rewriting the given functionality (don't ask why, I wanna learn it for later use). The Subclass should use it's own *.ui-File and should be put into an QWidget resding in the real GUI. After...

Qt and HTTP download

I am working on a class that will implement a client for a certain Instant Messaging protocol. I need to first make a HTTP request, then read the data and make another HTTP request with the processed data received from the first request and only after the second request i can open a tcp socket to the server. What is the best way(best QT ...

Signaling failure in qt slots

I have a 'producer' object, that steps through some data and emits various signals depending on what data item is next in the queue. Each of those signals are processed by at most one 'consumer' object at a time (it takes care to disconnect its slots before attaching the producer's signals to the other consumer). If the processing on t...

What is the grab-command (leftMouseButton) for QGraphicsView.ScrollHandDrag

Hi, you can enable mouse dragging by setting setDragMode(QtGui.QGraphicsView.ScrollHandDrag for QGraphicsView. Then you can drag the QGraphicsScene by holding the leftMouseButton. But I want to drag with the middleMouseButton not leftMouseButton. How can I do that? I tried setCursor(QtCore.Qt.ClosedHandCursor) but it isn't working. Ha...

Cant get a custom ItemDelegate to work

Hello there, first off, im new to python and pyqt so please bear with me. Im using a QTableView with a QSqlTableModel everything works as intended. The last column of the view contains only 0 and 1 as value which i want to display as checkbox and this column should be editable. Ive read that you should subclass QItemDelegate which i d...