Questions tagged [qt]

Qt is a cross-platform application development framework widely used for the development of application software that can be run on various software and hardware platforms with little or no change in the underlying codebase, while having the power and speed of native applications. Qt is available with both commercial and open source licenses.

General information

Official logo

Qt logo

About

Qt (pronounced officially as cute (/'kjuːt/) though commonly pronounced as Q.T. (/ˈkjuː.tiː/)) is a cross-platform application development framework widely used for the development of GUI programs (where it functions like a cross-platform widget toolkit), and also used for developing non-GUI programs such as console tools and servers. wikipedia

Qt was created by Trolltech, and was acquired by Nokia in 2008. One month after the end of symbian development at Nokia, Nokia decided to sell Qt. From September 2012 and until now Qt is managed by the Qt Company which is subsidiary of Digia.

License

Qt is available under four different licenses:

  1. GNU General Public License (GPL) version 3.0
  2. GNU Lesser General Public License (LGPL) version 2.1
  3. GNU Lesser General Public License (LGPL) version 3.0
  4. Qt Commercial License (which comes in three versions with different features and prices: "Indie Mobile", "Professional" and "Enterprise")

Current version

The latest official release is 6.2, released in September 2021. The major version indicates API and binary compatibility.

Recommendations

Tagging

You will often see questions tagged specifically as , , or to indicate that the question is related to Qt 3.x, 4.x, 5.x or 6.x respectively. Qt 3.x is no longer supported. The latest released major version is Qt 6.x so, when not specifically mentioned, version 6.x of the API should be assumed for questions posted after September, 2021.

Spelling

The correct spelling is Qt, not to be confused with QT, which stands for QuickTime - an extensible multimedia framework developed by Apple Inc.

Resources

Documentation

There is an extensive official documentation (all classes) available on Qt's website, in addition to tutorials and examples. You will often see these tutorials and examples referenced in the questions and answers on this site. Qt also provides an integrated development environment, IDE, named Qt Creator. Although it mainly aims at creating Qt applications, it can be used to create regular C++ applications as well.

Video courses

Pluralsight has a series of three courses on Qt:

  1. Introduction to Qt: A C++ Cross Platform Application Framework
  2. Qt Quick Fundamentals
  3. Integrating Qt Quick and C++

Pluralsight is a subscription based but if you're only interested in Qt you can send the author @todgentille a private tweet and request a week long VIP pass. You'll get unlimited access to the higher subscription level for a week that allows viewing online and offline and you can download the course materials.

Packtpub also has a video tutorial based on Qt 5.

Voidrealm released a full free series of Qt tutorials for beginners on his youtube channel.

Books

Qt introductory books:

Integrated learning of Qt and C++:

Concepts of UI design:

Check out the official Qt documentation for more details of recommended books about Qt programming.

85593 questions
88
votes
27 answers

Unresolved external symbol "public: virtual struct QMetaObject const * __thiscall Parent

I inherited a class from QObject : class Parent: public QObject { Q_OBJECT QObject* cl; public: Parent(QObject *parent=0):QObject(parent) { cl = NULL; } QObject* getCl() const { return cl; } void…
Mohsen Zahraee
  • 3,309
  • 5
  • 31
  • 45
88
votes
1 answer

Can I use Qt LGPL license and sell my application without any kind of restrictions?

I want to start a cross-platform project. I had my researches and now I am almost certain Qt is the right deal. There is a big obstacle here though: licensing. I want to sell my project and I also don't want to give out any source related to my work…
Hossein
  • 24,202
  • 35
  • 119
  • 224
87
votes
4 answers

What does the "lock" instruction mean in x86 assembly?

I saw some x86 assembly in Qt's source: q_atomic_increment: movl 4(%esp), %ecx lock incl (%ecx) mov $0,%eax setne %al ret .align 4,0x90 .type q_atomic_increment,@function .size …
gemfield
  • 3,228
  • 7
  • 27
  • 28
87
votes
6 answers

How to configure CLion IDE for Qt Framework?

How to configure CLion IDE for Qt Framework? Is this IDE compatible with Qt, or are there other IDEs compatible with Qt? I just want to try to use something else than Qt Creator.
123qwe
  • 1,525
  • 1
  • 14
  • 16
87
votes
4 answers

Interpreting segfault messages

What is the correct interpretation of the following segfault messages? segfault at 10 ip 00007f9bebcca90d sp 00007fffb62705f0 error 4 in libQtWebKit.so.4.5.2[7f9beb83a000+f6f000] segfault at 10 ip 00007fa44d78890d sp 00007fff43f6b720 error 4 in…
knorv
  • 49,059
  • 74
  • 210
  • 294
85
votes
6 answers

Project ERROR: Unknown module(s) in QT: webkitwidgets

I am porting code from qt4 to qt5. I added the following line to my .pro file, as suggested: QT += webkitwidgets However, when I run qmake, I get the this error: Project ERROR: Unknown module(s) in QT: webkitwidgets I am developing on Ubuntu 12.04…
user1251007
  • 15,891
  • 14
  • 50
  • 76
84
votes
2 answers

Difference between qt qml and qt quick

I'm confused with QML, QtQuick 1.0 and QtQuick 2.0. What's the difference between them? I use QtCreator 2.8.1 based on Qt 5.1.1. I want to develop a desktop program, which technology should I use?
骑天大圣
  • 854
  • 1
  • 6
  • 8
83
votes
5 answers

Get current working directory in a Qt application

I'm writing a program in C++ using the Qt library. There is a symbolic link in my home bin directory to the executable. I would like the current working directory of my program to be the directory in which I am with my terminal (ie. the result of…
Geoffroy
  • 1,071
  • 1
  • 7
  • 11
83
votes
5 answers

QVector vs QList

I have a list of integers that I need to iterate over but an array is inadequate. What are the differences between vectors and lists and is there anything I need to know before I pick a type? Just to be clear, I've read the QT docs but this is the…
jcuenod
  • 55,835
  • 14
  • 65
  • 102
83
votes
12 answers

Linking a qtDesigner .ui file to python/pyqt?

So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?
Chris
  • 21,549
  • 25
  • 71
  • 99
83
votes
4 answers

QtCreator and Command Line Arguments

Is there a way to send command line arguments to a program being debugged in QtCreator?
paul simmons
  • 5,568
  • 13
  • 51
  • 78
83
votes
5 answers

How to check whether file exists in Qt in c++

How do I check whether a file exists in a given path or not in Qt? My current code is below: QFile Fout("/Users/Hans/Desktop/result.txt"); if(!Fout.exists()) { eh.handleError(8); } else { // ...... } But when I run the code it is not…
user1322915
  • 1,211
  • 2
  • 13
  • 10
82
votes
1 answer

Issues when attaching and detaching external app from QDockWidget

Consider this little piece of code: import subprocess import win32gui import win32con import time import sys from PyQt5.Qt import * # noqa class Mcve(QMainWindow): def __init__(self, path_exe): super().__init__() menu =…
BPL
  • 9,632
  • 9
  • 59
  • 117
82
votes
9 answers

What is the correct way to make my PyQt application quit when killed from the console (Ctrl-C)?

What is the correct way to make my PyQt application quit when killed from the console (Ctrl-C)? Currently (I have done nothing special to handle unix signals), my PyQt application ignores SIGINT (Ctrl+C). I want it to behave nicely and quit when it…
static_rtti
  • 53,760
  • 47
  • 136
  • 192
82
votes
4 answers

How delete and deleteLater works with regards to signals and slots in Qt?

There is an object of class QNetworkReply. There is a slot (in some other object) connected to its finished() signal. Signals are synchronous (the default ones). There is only one thread. At some moment of time I want to get rid of both of the…
stach
  • 2,135
  • 2
  • 20
  • 22