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 5.14. 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, and Qt 6 is still in beta. The latest released major version is still Qt 5.x so, when not specifically mentioned, version 5.x of the API should be assumed.

Spelling

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

Reminder

Please, do not answer poor questions that will likely get closed or even deleted later. We are aiming for high-quality in this tag, thus we do not wish to encourage poor questions by feeding them with answers.

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:

Please, check out the official Qt documentation for more details of recommended books about Qt programming.

79389 questions
13
votes
2 answers

Minimizing a Qt application

How can I minimize my application by clicking on some button in the application, on Windows Mobile and Symbian platforms, under Qt?
Sergey
  • 793
  • 2
  • 6
  • 18
13
votes
4 answers

How to make a fast QTableView with HTML-formatted and clickable cells?

I'm making a dictionary program that displays word definitions in a 3-column QTableView subclass, as user types them, taking data from a QAbstractTableModel subclass. Something like that: I want to add various formatting to the text, I'm using…
Xilexio
  • 1,184
  • 18
  • 35
13
votes
1 answer

QComboBox - Select no entry

I have a QComboBox on my ui and set the model like this: QStringListModel* model = new QStringListModel; QStringList stringlist; stringlist << "Test1" << "Test2" << "Test3"; model->setStringList(stringlist); ui->comboBox->setModel(model); Now I…
iBent
  • 322
  • 2
  • 15
13
votes
2 answers

Is Qt Quick the way to go to build a modern GUI for a C++ application?

After 4 years of absence I'm finally coming back to Qt development again. I'm quite impressed by the development it has gone through, but also a bit confused by Qt Quick, which got just introduced in Qt 4.7 For me it seems like something to build a…
znq
  • 42,465
  • 38
  • 114
  • 143
13
votes
2 answers

undefined reference to staticMetaObject

It looks like Qt is not handling the Q_GADGET macro properly, because i am getting the error below. Anyone know why? ERROR: undefined reference to `Exception::staticMetaObject' EDIT: Later i found that the MOC doesn't generate moc_exception.cpp.…
Krab
  • 5,663
  • 5
  • 35
  • 73
13
votes
4 answers

How can I create a QML GridLayout with items of proportionate sizes?

Potentially related: https://stackoverflow.com/a/30860285/3363018 I've been trying to create a QML layout with items that span variable numbers of rows and columns. So, e.g., a rectangle that spans two rows and four columns, one to the right of it…
Dylan
  • 251
  • 1
  • 2
  • 7
13
votes
3 answers

Aspect Orientated Programming in Qt

I'm trying to get my head around AOP and some Qt Code would really help. From wikipedia here is some sample code (easy for a Qt/C++ programmer to read): void transfer(Account fromAcc, Account toAcc, int amount, User user, Logger logger) throws…
Derick Schoonbee
  • 2,793
  • 1
  • 20
  • 36
13
votes
3 answers

How to make clang-format skip sections of c++ code

Is there any way to configure the clang-format tool to skip my Qt::connect function calls ? There are several connects in my constructors which looks like these: connect( m_Job, SIGNAL( error( const QString&, const QString& ) ), this, SLOT(…
p.i.g.
  • 2,559
  • 1
  • 19
  • 38
13
votes
5 answers

pip install -U PySide error

Does anyone know how to avoid the following error when running pip install -U PySide as per the official website instructions here: https://pypi.python.org/pypi/PySide/#installing-pyside-on-a-mac-os-x-system Note that I have already done brew…
warship
  • 2,505
  • 6
  • 30
  • 58
13
votes
2 answers

HowTo find Subitem in QAbstractItemModel and QTreeView class?

Question: how to find sub item, in a QTreeView loaded QAbstractItemModel model with model->match() method? Problem: model->match() can't find sub items, wtf?! Here is the example: As you can see from the picture, I'm trying to expand Layouts sub…
mosg
  • 11,175
  • 12
  • 61
  • 86
13
votes
11 answers

Q_OBJECT linker error!

I am receiving the following linker error when I build my application. HIMyClass.obj:: error: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CHIMyClass::metaObject(void)const " …
liaK
  • 10,834
  • 10
  • 43
  • 70
13
votes
4 answers

Setting up Qt5 with Visual Studio 2015

Searching Google for 'Qt5 - Windows 10 - VS 2015' only brought up a blog post from April stating that support for VS 2015 is in the works (link). The Qt5 downloads page (OpenSource version) currently has no links for Visual Studio 2015. So, is it…
neoaggelos
  • 614
  • 1
  • 4
  • 17
13
votes
2 answers

What is the correct way of Multiple inheritance in Qt/C++?

In my Qt application, I have a base class as follow. I am using QObject because I want to use Signal-Slot mechanism in all derived classes. class IRzPlugin : public QObject { public: virtual void registerMenu(QWidget*); virtual void…
Ashika Umanga Umagiliya
  • 7,998
  • 19
  • 86
  • 167
13
votes
2 answers

MySQL TIMESTAMP to QDateTime with milliseconds

If I use a QSqlTableModel to access a MySQL database I can convert a TIMESTAMP field using the following: QDateTime dateTime = index(section, column).data().toDateTime(); QString str = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz"); So str shows,…
KcFnMi
  • 3,922
  • 8
  • 43
  • 90
13
votes
1 answer

What to use instead of `qt5_use_modules`?

The Qt 5 CMake manual states that the qt5_use_modules macro is deprecated: This macro is obsolete. Use target_link_libraries with IMPORTED targets instead. ... But qt5_use_modules does more than simply specify link libraries: it specifies include…
Kyle Strand
  • 14,120
  • 3
  • 59
  • 143
1 2 3
99
100