Qt5 Tutorial Visual Studio Add-in - 2020
We need to download the following two:
- Qt5 SDK , In my case, it's the Qt 5.1.1 for Windows 64-bit (VS 2012, OpenGL, 522 MB) (Info)
- Visual Studio Add-in 1.2.2 for Qt5
Once the Add-in installed successfully, we should now see QT5 show up on the Menu Bar:
The next step is to let the VS know where to get bin/qmake and lib/libraries. Without this step, we may get "Unable to find a Qt build! To solve this problem specify a Qt build" when we try to create a new Qt5 project.
In my case, they are under "C:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl".
So, we need to pass this information.
From the top menu, QT5->Qt Options. Then, select "Add" and type the path into "Path"
The "Version name" should be filled with 5.1.1. Hit OK.
Now, let's create a new Visual Studio Project: File -> New -> Project. We will now see a new addition called Qt5 Projects. This allows us to create various Qt applications. For now, select "Qt Application"
We just leave everything untouched.
Press "Finish"
Let's build the project and run.
We're going to add simple UI (QProgressBar and QSlider) with "valueChanged(int)" signal and "setValue(int)" slot.
Before we start building the project, we may want to make sure that our host and target are set properly.
Things to check - in my case, Host:x64, Target (Platform):x64
If this is not set properly, we may get "linking problem: fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' or something similar error messages.
- Check properties options in linker settings at: Properties > Configuration Properties > Linker > Advanced > Target Machine. In my case, it should be x64.
- Select Build > Configuration Manager from the main menu in visual studio. Make sure our project has the correct platform specified.
After that, we should check Qt Project Settings as well. If this hasn't been set, we may get "There's no Qt version assigned to this project for platform x64" - visual studio plugin for Qt:
Right click the project > Qt Peoject Settings > Under the Properties tab > Version
Set signal and slot for the UI we added:
Build and run:
The progress bar keeps updated as we move the slider. So, seems to be working fine!
Qt 5 Tutorial
- Hello World
- Signals and Slots
- Q_OBJECT Macro
- MainWindow and Action
- MainWindow and ImageViewer using Designer A
- MainWindow and ImageViewer using Designer B
- Layouts
- Layouts without Designer
- Grid Layouts
- Splitter
- QDir
- QFile (Basic)
- Resource Files (.qrc)
- QComboBox
- QListWidget
- QTreeWidget
- QAction and Icon Resources
- QStatusBar
- QMessageBox
- QTimer
- QList
- QListIterator
- QMutableListIterator
- QLinkedList
- QMap
- QHash
- QStringList
- QTextStream
- QMimeType and QMimeDatabase
- QFile (Serialization I)
- QFile (Serialization II - Class)
- Tool Tips in HTML Style and with Resource Images
- QPainter
- QBrush and QRect
- QPainterPath and QPolygon
- QPen and Cap Style
- QBrush and QGradient
- QPainter and Transformations
- QGraphicsView and QGraphicsScene
- Customizing Items by inheriting QGraphicsItem
- QGraphicsView Animation
- FFmpeg Converter using QProcess
- QProgress Dialog - Modal and Modeless
- QVariant and QMetaType
- QtXML - Writing to a file
- QtXML - QtXML DOM Reading
- QThreads - Introduction
- QThreads - Creating Threads
- Creating QThreads using QtConcurrent
- QThreads - Priority
- QThreads - QMutex
- QThreads - GuiThread
- QtConcurrent QProgressDialog with QFutureWatcher
- QSemaphores - Producer and Consumer
- QThreads - wait()
- MVC - ModelView with QListView and QStringListModel
- MVC - ModelView with QTreeView and QDirModel
- MVC - ModelView with QTreeView and QFileSystemModel
- MVC - ModelView with QTableView and QItemDelegate
- QHttp - Downloading Files
- QNetworkAccessManager and QNetworkRequest - Downloading Files
- Qt's Network Download Example - Reconstructed
- QNetworkAccessManager - Downloading Files with UI and QProgressDialog
- QUdpSocket
- QTcpSocket
- QTcpSocket with Signals and Slots
- QTcpServer - Client and Server
- QTcpServer - Loopback Dialog
- QTcpServer - Client and Server using MultiThreading
- QTcpServer - Client and Server using QThreadPool
- Asynchronous QTcpServer - Client and Server using QThreadPool
- Qt Quick2 QML Animation - A
- Qt Quick2 QML Animation - B
- Short note on Ubuntu Install
- OpenGL with QT5
- Qt5 Webkit : Web Browser with QtCreator using QWebView Part A
- Qt5 Webkit : Web Browser with QtCreator using QWebView Part B
- Video Player with HTML5 QWebView and FFmpeg Converter
- Qt5 Add-in and Visual Studio 2012
- Qt5.3 Installation on Ubuntu 14.04
- Qt5.5 Installation on Ubuntu 14.04
- Short note on deploying to Windows
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization