qt

Qt RTTI trouble

In a quest for handling events (like mouse moves and clicks) not by subclassing, one has to use installEventFilter and provide an event handler. While doing so, I've encountered a problem with RTTI support, meaning that typeid().name() gives QObject * all the time, no matter on which object event was triggered. There is, of course, anoth...

Calling a function in child thread in Qt?

I have a main thread that invokes a child thread function at different times but I am not sure whether that is right way of doing it in Qt.What is wrong with the below code and looking for better alternative There is a main thread running infinitly when ever main thread releases the lock child does a piece of work. #include <QtCore/QC...

QtCreator - Debugging as superuser on Mac OS

Hi, I'd like to debug an application in QtCreator on Mac OS which reads directly from hard disk (/dev/rdisk0). If I run this app from Terminal using sudo ./MyApp, it's working, however when I debugging it under QtCreator, it fails due to lack of permissions. I tried to launch QtCreator itself from terminal using "sudo open QtCreator.ap...

Cocoa Textured Window in QT

I am using Qt to develop a cross platform application. I am trying to replicate the look and feel of the left two windows (A HUD window and a textured window) but so far I can't see how to get any kind of window except for the right most window. Does anybody have any idea how to replicate those type windows? ...

Automatic increment of build number in QT Creator

I would like to have a variable (or #define) in C++ source that will increment each time I use QT Creator to build source code. Is there any way I can do this, perhaps some QT Creator plugin or similar? If there is a way to do it if I use "make" on command line to build? ...

How to use QMake's subdirs template?

Hi, I'm starting to learn Qt. I'm moving from the Visual Studio world and I am looking for a way to organize my project's structure using QMake. I've found the 'subdirs' template but I have quite a hard time understanding it. My project structure looks like this: project_dir/ main.cpp project.pro logic/ logic.pro ...

Qt QPushbutton Icon above Text

When I create a QPushButton with an Icon it by default displays the text to the right of the icon. Is there a way to have the text display underneath the icon? ...

Reading/writing QObjects

I think I can write a QObject like this by taking advantage of the Q_PROPERTYs: QDataStream &operator<<(QDataStream &ds, const Object &obj) { for(int i=0; i<obj.metaObject()->propertyCount(); ++i) { if(obj.metaObject()->property(i).isStored(&obj)) { ds << obj.metaObject()->property(i).read(&obj); } } ...

Stored Function Call via QOCI

Hi all, I need to call database function within in qt application. But, it fails with below error; QOCIResult::exec: unable to execute statement: ORA-06576: not a valid function or procedure name DB: Oracle Driver: QOCI The Function returns record table. C++ code: QString qs = "CALL func()"; QSqlQuery query; query.exec(qs); // thi...

How to deploy a Phonon-dependant Qt4/PyQt4/python application on Mac OS X?

I have written a crossplatform Qt4/PyQt4/python application, namely MyGreatApp, whose last version requires the Phonon module. MyGreatApp runs just fine on my own machine under Mac OS X 10.6 Snow Leopard, and more generally on any mac where Qt4.4 happens to be installed. However, innocent machines miserably fail to load Phonon: WARNING:...

QSqlQuery with International chars does not return a result

I have a Sqlite database that has ClipArt tags in, we are translating that database to Swedish however my database query now does not return a result if the characters are non-English British. For example, fisk == fish and that works perfectly, however öst == east but that fails. I am constructing the query in a QString from a QLineEdi...

Does the isSelect-method of QSqlQuery return true when a stored procedure is executed?

Will the isSelect-method of QSqlQuery return true when a stored procedure containing a SELECT-statment is executed on sqlserver? ...

Qt Creator: “XYZ does not name a type”

This is a very frustrating error message in Qt Creator: ’XYZ’ does not name a type. This usually means that there is an error in the class XYZ that prevents the compiler from generating the type, but there are no additional hints as to what went wrong. Any suggestions? ...

Qt Creator: “inline function used but never defined” – why?

Why am I getting this warning in Qt Creator: ` inline function ‘bool Lion::growl ()’ used but never defined? I double-checked my code, and have a declaration inline bool growl () in Lion (lion.h) and the corresponding implementation in lion.cpp: inline bool Lion::growl () What’s going on? EDIT: My assumption has been that it is l...

Waiting for a DBus service to be available in Qt

With a Qt DBus proxy built on QDbusAbstractInterface (via qdbusxml2cpp), what's the best way to handle the service/object you want to interface to not being available when you start? Note: I'm not interested in simply knowing it (you can use BlahService.isValid() to find that out); I want to be able to know if it's valid, and know when ...

Qt with C#/.NET in Visual Studio v.09?

Do any of you have any experience working with Qt and C# in Visual Studio? Is it at all possible/easy to use together? I've searched for C# bindings for Qt, but all projects seem to have been abandoned. I'm doing an application which must be coded in C#, which also needs to be able to run on Ubuntu (with Mono). So, Qt was the first thin...

Debug Qt application among dlls

I have Qt project with multiple children projects, most of them are dll's. And exactly one is Qt application. How to launch debugging of application? Can it be done in some config file to allow other users of versioning system to use same settings all over the team. Of course I know the way to "attach" to already existing process. But s...

Keep QPixmap copy of screen contents using X11, XDamage, XRender, and other tricks.

Hi, I'm attempting to solve what I thought would be a very simple problem. I want to keep a QPixmap updated with the entire screen contents. You can get such a pixmap by doing this: QDesktopWidget *w = QApplication::desktop(); if (w) { QRect r = w->screenGeometry(); QPixmap p = QPixmap::grabWindow(w->winId(), 0, 0, r.width(), r...

Qt and Sqlite examples

I am looking for some example code using Qt and it's SQL module with Sqlite driver. Main reason I need examples for is that I've prior experience with Qt's database interface and Sqlite has some weird behavior with field types (types are stored per-field, not per-column). ...

Is qt-embedded-linux drawing library fixed point ?

Hi Friends, I am working on embedded device which does not have Floating Point Unit, I want to port QT-embedded-linux to it. So Please tell me that whether drawing library of qt has fixed-point or not? Thanks, Sunny. ...