qt4

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...

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...

How can I programmatically send events to Qt's webkit?

I would like to create a specialized browser that can enter certain information semi-automatically into pages that are browsed. I am using for this Qt Webkit (in particular the python bindings). How can I do this? ...

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 QPixmap::grabWidget on ActiveX widget

I have a Qt app which embeds a Flash Player ActiveX control. I put a button over the flashplayer and I need to set some parts of it transparent. Since the AX control is not part of the Qt rendering pipe, it's needed to fake the transparency. For this purpose I grab the contents of the AX control from under the button, and use it when ren...

How can I load session information into qtwebkit?

I am building a specialized browser based on Qtwebkit. I would like to save the session information when logging into authenticated websites and load this information again when I restart the browser. How can I do this? ...

BitBlt in Qt4 ?

What is the recommended method of copying one QImage into another at a particular position in Qt4? QImage::bitblt was removed in Qt4. Does the QImage now need to be converted to a PixMap and back? ...

GUI in Qt OR GUI in Android

Embedded Application (GUI) written in QT and communicating (Via IPC, SPI some other mechanism) with an Android based application (the primary application). Would like to know 1. The overall pros and cons of such design 2. Re usability of the GUI (would it be better to write your GUI on Android?) 3. Consider the two apps will be running...

Can I map lists in QT?

This is already fairly concise, but it would be awesome if I could map the list a la Ruby. Say I have a QStringList, myStringList, which contains things like "12.3", "-213.0", "9.24". I want to simply map the whole thing using toDouble without having to iterate. Does QT have a method for this? // i.e. I would love a one-liner for the fo...

Restrictions in creating a plugin

Recently tried the plugin example of Qt. It didn't work at all and I was confused as to the reason. Then found the solution on one of the forums. Qt, Application and plugin all three have to be built with the same configuration (Release/Debug) This works for me as I can build all three in Debug/Release mode. But if I want users to ex...

how to drag and drop from another widget on to a QGraphicsScene

I need to drag from a QListWidget or something similar and drop on a QGraphicsScene, and create a subclass of QGraphicsItem at the drop location. Anyone have any ideas? I'm using Qt 4.6.3. ...

Where to control the QWizard button?

Hi: I'm using Qt, and I use a QWizard object which contains several pages. when it comes to a specific page, I want to hide the "Next" button first, and shows it after the user do something (such as clicking on a radiobutton...) I want to do some customize control of the wizard when this specific page shows up. the question is, I know ...

How to write graphical programs

Hi, I have learned C++ and Qt4. I wrote one graphical program with 3000 rows and I found out that there is really complicated to keep code simple, transparent and well-structured. I like design patterns etc. because they are really effective and helps to keep code simpler and more transparent. Now I am going to write another "bigger" ap...

How do I inherit from and extend QCalendarWidget using C++

At present the QCalendarWidget only supports SingleSelection or NoSelection. I'd like to be able to write a widget that inherits from QCalendarWidget in Qt 4.6.2 and adds the ability for the user to select any day in a week and have that custom week selected. e.g. Click on Thu 5 August 2010 and all days from Saturday 31 July to Friday ...

Why don't I receive signal and status for WiFi using QSystemNetworkInformation

Hello! I wrote a piece of software which does nothing else than reading network status and signal strength for each network mode (gsm, wlan (wifi), bluetooth, ...) on my device (Nokia E51) and printing it out. My test device is connected to bluetooth, wlan (wifi) and 3G (wcdma), but it's only able to give me the signal strength of 3G (...

QNetworkAccessManager doesn't recover once the ftp upload gets interrupted

My application mostly works. I'm using QNetworkAccessManager to send a screencapture to a remote FTP server. If during the middle of the transfer, I unplug my laptop from the internet, the transfer stops. Duh. Of course, it must. But my problem is that it does NOT send an error anywhere that I can find. And when I reconnect the int...

how to center a Qt mainform on the screen?

I've tried these in my mainform's constructor: QRect desktopRect = QApplication::desktop()->availableGeometry(this); move(desktopRect.center() - frameGeometry().center()); QRect desktopRect = QApplication::desktop()->availableGeometry(this); move(desktopRect.center() - rect().center()); but both put the bottom right corner of the for...

HowTo combine QAbstractTableModel and QItemDelegate to one working source?

Hi there! I have a QTableView defines in UI file. Here is the figure: I'd like to make month change (where the red array points) with QComboBox widget, dealing with delegates, but for me, for my custom delegate and model it's a too complex problem, and I can't figure out what is wrong?! Problem: on my opinion, QAbstractTableModel ca...

[Qt4] Prevent focus from leaving field if value is invalid

Hi, I've got an issue with Qt4 focus handling. Since QDateEdit does not support NULL values, I've tried to emulate such a widget by using a QLineEdit with an inputMask. But event with the inputMask the user is still able to enter an invalid date (e.g. 44/44/4444). In that case I want to display an error messagebox when the user leaves t...

How to avoid console window in Qt application, even after Including "testlib" package (for qWait()) in my .pro file ?

Hallo everyone, I have gone through various threads on this topic but, nothing seems to solve my particular problem. Including testlib, makes the console window appear and there I didnot find any option to suppress this behaviour. But my application still demands testlib to be present (because i badly wanted to use QTest::qWait() metho...