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
26
votes
3 answers

How to detect if a QString is made up of all numeric characters?

What is the best way to tell if a QString is made up of just numbers? There doesn't appear to be a convenience function in the QString library. Do I have to iterate over every character, one at a time, or is there a more elegant way that I haven't…
Wes
  • 4,781
  • 7
  • 44
  • 53
26
votes
8 answers

Qt HTTP Server?

I'd like to write a small HTTP server application that receives HTTP GET requests, processes them and sends out a reply. Because of the history of the application I'd favor using Qt for this, but all I can find is the other (more common) direction:…
grefab
  • 1,997
  • 2
  • 22
  • 32
26
votes
10 answers

Copy directory using Qt

I want to copy a directory from one drive to another drive. My selected directory contains many sub directories and files. How can I implement the same using Qt?
Sijith
  • 3,740
  • 17
  • 61
  • 101
26
votes
1 answer

Why does FlowLayout behave differently in Qt 5.2, compared to Qt 4.8?

I've just ported my application from Qt 4.8.4 to Qt 5.2.1. I have an issue with the FlowLayout class as provided in the FlowLayout example code in the Qt docs. I have a QMainWindow with a QDockWidget docked at the bottom of the central widget. The…
c_k
  • 1,746
  • 1
  • 20
  • 35
26
votes
2 answers

Unit and functional testing a PySide-based application?

I'm building a PySide 1.1.0-based application, and have been looking for good examples to look at for unit and functional testing my application. I want to be able to do functional testing of the UI (simulating clicks, key presses, etc), unit…
Kris Hardy
  • 548
  • 4
  • 12
25
votes
1 answer

Qt interfaces or abstract classes and qobject_cast()

I have a fairly complex set of C++ classes that are re-written from Java. So each class has a single inherited class, and then it also implements one or more abstract classes (or interfaces). Is it possible to use qobject_cast() to convert from a…
Timothy Baldridge
  • 10,455
  • 1
  • 44
  • 80
25
votes
7 answers

Create a random string or number in Qt4

Is there any function or something like that by which I can create totally random strings or numbers?
defiant
  • 3,161
  • 11
  • 41
  • 65
25
votes
3 answers

PyQt4 File select widget

I want to make a QT4 (using QT designer) dialog, that contains a part where a file has to be selected. Now, I know QFileDialog exists, and I can program something that does what I want. But can I also just do it in QT designer? Is there some way to…
Nathan
  • 515
  • 2
  • 7
  • 14
25
votes
2 answers

Qt resources files with CMake and AUTORCC

Solution: Add resource files in the add_executable() statement Problem (not in the add_library()) Fail to set main window icon. Notes: When I don't use AUTORCC I run into some compilation problems: QtCore/qglobal.h: no such file or directory. But,…
Dimitris Dakopoulos
  • 683
  • 1
  • 6
  • 18
25
votes
3 answers

Qt event loop and unit testing?

I'we started experimenting with unit testing in Qt and would like to hear comments on a scenario that involves unit testing signals and slots. Here is an example: The code i would like to test is (m_socket is a pointer to QTcpSocket): void…
TheMeaningfulEngineer
  • 15,679
  • 27
  • 85
  • 143
24
votes
11 answers

Command line parser for Qt4

I am looking for a command line parser for Qt4. I did a small google search, and found this: http://www.froglogic.com/pg?id=PublicationsFreeware&category=getopt however it lacks support for "--enable-foo" and "--disable-foo" switches. Besides that,…
elcuco
  • 8,948
  • 9
  • 47
  • 69
24
votes
4 answers

ComboBox of CheckBoxes?

I am trying to make the items in a ComboBox checkable. I tried this: http://programmingexamples.net/wiki/Qt/ModelView/ComboBoxOfCheckBoxes where I subclassed QStandardItemModel and re-implemented the flags() function to make the items checkable.…
David Doria
  • 9,873
  • 17
  • 85
  • 147
24
votes
1 answer

How can I get Qt4 running with ruby 1.9.2 on Windows 7?

Summary I'm writing a Ruby 1.9.2 app using Qt4 for its GUI which I want to distribute on Linux, OS X and Windows. I have the app running fine on everything except my Windows 7 64-bit box. There are working examples of Win7 + Qt4 + 1.8.7, but…
Max Cantor
  • 8,229
  • 7
  • 45
  • 59
24
votes
8 answers

QCompleter Custom Completion Rules

I'm using Qt4.6 and I have a QComboBox with a QCompleter in it. The usual functionality is to provide completion hints (these can be in a dropdown rather than inline - which is my usage) based on a prefix. For example, given chicken soup chilli…
jcuenod
  • 55,835
  • 14
  • 65
  • 102
24
votes
3 answers

Blocked waiting for a asynchronous Qt signal

I know, there are some similar questions to the following out there, but I couldn't find a concrete answer that helps me. So here's my problem: I work on an application that does some gui-initialisations on start up. One of the things I have to do,…
cyphorious
  • 809
  • 3
  • 7
  • 19