qt

QtSql: QSqlRecord doesn't keep the table prefixes

I'm working on a small application in Qt and I'm using the SQL library together with SQLite as the database. So far this has worked out well. The QSqlQuery class only provides a method for getting column values by index instead of field name. However, using the record() function the current row on the query can be turned into a QSqlRecor...

Layout direction for Arabic is not determined based on the locale (Mac and Linux)

Has anyone managed to have the correct layout direction (left-to-right and right-to-left) be inferred from the user’s language settings? I am having trouble localizing my application to the Arabic (Saudi Arabia) locale. Detection of the current locale, and loading and installing the appropriate QTranslators both work fine. (The text loo...

Passing QApplication object from main exe to DLL

I have a QT GUI application loading a non GUI QT dll. I need to be able to access the QApplication object inside the DLL. How can i do this? I tried QCoreApplication::instance(), but this returns null. Without having the object from the main GUI, i am not able to process events in the DLL. Any help? ...

a C++ learning book around the Qt Framework

Hello, i wish to migrate to C++ , having a more or less concrete C# & .NET Background. I Want to escape from the shackles of the .NET Environment [THE FRAMEWORKS] but don't feel like starting the learning process from scratch (the OO P introductions, types etc...) so I'm looking for a book that skips some of that and is centered around Q...

How to upload file with form-post using c++ Qt-WebKit?

So, when i was dealing with forms before what i would do is find web element that is part of the form input, set value of that form input by element.setattribute("value", "infoi want to add") then simply when i set value of form elements i click submit button of form. Is this possible to do with web-form input type="file" and how can i...

How do I tell on Mac OS X if I have the Carbon or Cocoa version of Qt installed?

I installed the QtSDK, but I can't find any documentation anywhere that specifies whether it uses the Cocoa or Carbon version. Can I find out which got installed? If not, is it safe to install the Cocoa version from the Library only dmg? Qt version is 4.6.3, system version is 10.6.4. ...

On OS X, what is the proper setting for $QTDIR?

I'm trying to install QtROOT, and as part of the installation (specifically, the readme file in the QtROOT tarball at http://root.bnl.gov/QtRoot/downloads/qtFullRoot.tar.gz), it mentions to make sure that QTDIR is set. I've installed from the Qt 4.6.3 SDK installation for Mac OS X, and I have no such environment variable set. I've trie...

Is there a way to get an errorlevel from FileProtocolHandler or url.dll?

In one of my programs I am using rundll32.exe url.dll,FileProtocolHandler c:\path\to\a.file to open files. I would like to handle errors in case this file could not be opened but I can't figure out how to find out if there was an error or not. That's my code: QProcess::startDetached( QString( "rundll32.exe url.dll,FileProtocolHandler " ...

How do I append the value into url in C++?

int randomValue = qrand() % 100; view = new QWebView(this) ; view->load(QUrl("http://blogsearch.google.com/blogsearch?q=C&start="+randomValue+"&num=1&output=rss")); There was an error occured: error: invalid operands of types 'const char*' and 'const char [18]' to binary 'operator+' So, I want to append the randomValue in Url code...

Changing the screen resolution from Qt?

I'd like to change the screen resolution and then go fullscreen with one activex control (a flash player). Obviously, a windows-only solution is fine :). Is there a Qt api for that, or do I need to dig into winapi? If so, where do I look (keywords)? Thanks for the help. ...

What are these OSX buttons called, and how to make/use them in Qt

I have not done any work with Carbon/Cocoa, only Qt. I know Qt has excellent integration with various OS's, especially Mac in the last version (adding sheets, drawers, support for files attached to windows, and more), so I suspect it can do this, too. Here's the picture: If you can't see it, there are four buttons on a bar at the bott...

Qt Eclipse Integration and Custom Widget PlugIn

Does anyone know the correct procedure to compile a Custom Widget to be used under Eclipse Integration Plugin under Windows with MinGW? I tried the following steps, but I cannot see the widget in Widget Bar: Installed Qt 4.6.1 for Win32 (with MinGW) Installed Eclipse Helios 32bit (tried with Galileo too) Installed Qt Eclipse Integrato...

Using QtMobility in QtCreator: Setup??

I am trying to set up a development environment to play around with developing Qt apps for Symbian devices. I have succesfully set up the environment and am able to create simple apps such as HelloWorld and get them to run on my device. I would now like to try using the QtMobility package, but I am struggling to get it to work in QtCre...

QTimer in a thread - events not processing?

I have an object that is derived from QThread and the class definition includes the Q_OBJECT macro. I created a timer within the thread so I can do some occasional checks while the thread is running; however, the timeout event is never occurring. I've tried making the timer a singleshot as well, but no events are emitted. Are events p...

Qt - how to detect whether the application is running on GNOME or KDE?

I was wondering how I could do something like this (source) using Qt. I looked through the documentation but couldn't find any method to check if an external process is running. if [ "$(pidof ksmserver)" ]; then echo "KDE running." # KDE-specific stuff here elif [ "$(pidof gnome-session)" ]; then echo "GNOME running." # GNOM...

how to change the color of a QGraphicsTextItem

hello i have a scene with a multiple (QGraphicsTextItem)s, and i need to have control over their colors , so how to change a color of a QGraphicsTextItem ? is it possible anyway? i've been trying for 3 days until now . please help thanks in advance ...

Qt signals inheritance?

EDIT: I provided an answer but I'd be happy to accept another one that provides an explanation. I subclassed QPushButton to add some functionality, but after connection the clicked signal to a slot, it doesn't get called. If I use a vanilla QPushButton, and don't change anything else, it works. Here's the code: /// --- imagebutton.h #...

How show/draw a image in the desktop pyqt?

Thats the question, how show images in the desktop, no images in a windows, something like screenlets, but I don wan't to use plasma, i'm using linux. Yes, I want to do a simple widget engine, with pyqt and svg. ...

how to create a new QImage from an array of floats

Hi all, I have an array of floats that represents an Image.(column first). I want to show the image on a QGraphicsSecene as a QPixmap. In order to do that I tried to create anew image from my array with the QImage constructor - QImage ( const uchar * data, int width, int height, Format format ). I first created a new unsigned char and ca...

What are good NoSQL and non-relational database solutions to be used in Qt environment?

As Qt is used for small, medium and large sized application/service development, it is very likely that NoSQL trend will not skip Qt developers. Although most NoSQL projects have background of web app development and dynamic languages, some of the current NoSQL libraries have been written in C or C++, so integration would be possible. E...