Questions tagged [qt4]

Questions specifically relating to the deprecated version 4.x.x of the Qt C++ GUI library. If your question applies to the current major version of Qt, use the tag [qt].

Qt 4.x is a specific series of releases of the Qt GUI library. Use this tag if your question only applies to Qt 4.x, and not to Qt 3.x or Qt 5.x. If your question applies to Qt in general, use the tag .

Trolltech released Qt 4.0 on June 28, 2005 and introduced five new technologies in the framework:

  • Tulip: A set of template container classes.
  • Interview: A model/view architecture for item views.
  • Arthur: A 2D painting framework.
  • Scribe: A Unicode text renderer with a public API for performing low-level text layout.
  • MainWindow: A modern action-based main window, toolbar, menu, and docking architecture.

The latest official 4.x release is 4.8.6 (April 24, 2014). The major version indicates API compatibility.

It has been noted that, Qt 4.8 is officially supported till "19.12.2015", In order to get official support it is better to port to Qt5

A list of the supported platforms for version 4.8 can be found here

5315 questions
35
votes
2 answers

What is the signal for when a widget loses focus?

In a dialog, when the tab key is pressed, the focus changes to another widget. In Qt, is there any signal for when a widget loses its focus? Can I use it to check if the input is valid or not? If not, can I set the focus back and ask the user to…
user1899020
  • 13,167
  • 21
  • 79
  • 154
34
votes
3 answers

Is it possible to connect a signal to a static slot without a receiver instance?

Is it possible to connect a signal to static slot without receiver instance? Like this: connect(&object, SIGNAL(some()), STATIC_SLOT(staticFooMember())); There is a QApplication::closeAllWindows() function with [static slot] attribute in Qt…
bartolo-otrit
  • 2,396
  • 3
  • 32
  • 50
34
votes
5 answers

How to copy Qt runtime DLLs to project output

I have a simple project created in Qt Creator (installed using Qt SDK 1.1.4). It runs just fine from within Qt Creator, but if I then browse to the output directory in Windows and double-click the EXE, I'll get an error like: The program can't…
James Johnston
  • 9,264
  • 9
  • 48
  • 76
34
votes
1 answer

QSlider Value Changed Signal

I'm using a QSlider (v4.6) for input as well as to provide feedback to the user. For the feedback I will be calling the setValue method. I'm trying to find a signal that will fire only if the user modified the value. The valueChanged signal fires…
David Alvares
  • 343
  • 1
  • 3
  • 4
33
votes
3 answers

How can I add a checkbox/radio button to QTableWidget

How can I add a checkbox/radiobutton/combobox to a QTableWidget or a QListWidget?
user664305
33
votes
6 answers

easiest way to parse JSON in Qt 4.7

I need to parse JSON object through Qt. What is the easiest/fastest way to do it?
wael34218
  • 4,860
  • 8
  • 44
  • 62
33
votes
6 answers

Qt: How to organize Unit Test with more than one class?

I have a Qt Unit test (sub)project, which generates me one class (with the main generated by QTEST_APPLESS_MAIN).I can start this from within Qt Creator as console app. Q: How would I add additional classes as test cases to this particular…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
33
votes
6 answers

How to insert BLOB and CLOB files in MySQL?

I want to store images and .docx/.doc, .pptx/.ppt, .pdf files using the front end of my software. I don't understand how to implement this and how to insert the BLOB and CLOB files into the table. Please help. I am using Kubuntu 11.04, MySQL5, Qt…
user1411472
  • 1,639
  • 3
  • 14
  • 8
32
votes
6 answers

QWidget resize signal?

I want to take an action when a widget was resized. Is there a way to catch that without installing an event filter on that widget (and, obviously, without subclassing it)? AFAIK, QWidget does not have a resized signal.
warvariuc
  • 57,116
  • 41
  • 173
  • 227
32
votes
2 answers

Removing a non empty folder in Qt

How to remove a non-empty folder in Qt.
Viku
  • 2,845
  • 4
  • 35
  • 63
31
votes
3 answers

What is the correct way of QSqlDatabase & QSqlQuery?

I got confused with the manual , should i work like this: { QSqlDatabase db = QSqlDatabase::addDatabase (...); QSqlQuery query (db); query.exec (...); } QSqlDatabase::removeDatabase (...); As the document points out, query or db will be…
daisy
  • 22,498
  • 29
  • 129
  • 265
30
votes
10 answers

how to restart my own qt application?

i just asking myself how to restart my own qt application? Can somebody please show me an example?
Klaus
  • 301
  • 1
  • 3
  • 3
30
votes
3 answers

How to set text alignment on a column of QTableView programmatically?

So far the only solution I have found is to subclass QItemDelegate and implement my alignment rule in the paint() function. Is it really the simplest way? I am using the C++ API.
Ali
  • 56,466
  • 29
  • 168
  • 265
30
votes
2 answers

How can I create a HTTP POST request with Qt 4.6.1?

How can I create a HTTP POST request with some URL encoded parameters using Qt 4.6.1? I figured out that I can create a QNetworkRequest, set all the parameters there and send it via QNetworkAccessManagers post method. But how can I add some…
Tobias Langner
  • 10,634
  • 6
  • 46
  • 76
30
votes
4 answers

Qt QHBoxLayout percentage size

How can I maintain an aspect ratio between two QHBoxLayouts? For instance I want a QHBoxLayout to be one third of the entire window width and the other to be two thirds of the entire window width: How can I achieve this? I tried messing with the…
Johnny Pauling
  • 12,701
  • 18
  • 65
  • 108