Click here to Skip to main content
15,881,089 members
Everything / Desktop Programming / QT

QT

QT

Great Reads

by The Ænema
This article will teach you how to create an amazing, clean and smooth WPF/Winform UI for your native application without using any complex, unsafe, ActiveXish methods, etc.
by Andrew Kirillov
An open source application to acquire and process video from cameras
by ashcairo
How to use OpenGL and friends to write an app that targets mobile and desktop platforms.
by Marco Bertschi
A brief step-by-step guide on what is needed to get Qt and the Qt Creator installed on your Linux environment

Latest Articles

by Dawid Borycki
In this article, you will build a Qt-based Python application with two C/C++-based DLL dependencies. This architecture mimics a typical scenario of using Python and Qt for rapid UI prototyping and DLLs for computation-intense work.
by Dawid Borycki
This article shows you how to reduce the computation time of the x64 architecture by 40 percent by making simple changes.
by CodingKnight
An examination of PySide and PyQt to help find out which one to use
by CodingKnight
Comparison of PyQt and Tkinter

All Articles

Sort by Score

QT 

6 Jan 2020 by The Ænema
This article will teach you how to create an amazing, clean and smooth WPF/Winform UI for your native application without using any complex, unsafe, ActiveXish methods, etc.
4 Apr 2019 by Andrew Kirillov
An open source application to acquire and process video from cameras
15 Oct 2012 by ashcairo
How to use OpenGL and friends to write an app that targets mobile and desktop platforms.
17 May 2012 by Volynsky Alex
Before we can use custom widgets in Qt Designer, we must make Qt Designer aware of them. There are two techniques for doing this: the "promotion" approach and the plugin approach.Promotion approachThe promotion approach is the quickest and easiest. It consists of choosing a built-in Qt...
18 Oct 2014 by Marco Bertschi
A brief step-by-step guide on what is needed to get Qt and the Qt Creator installed on your Linux environment
13 Jan 2020 by Igor Gribanov
Property browsing is a common task and many standalone libraries already exist, but let's explore the built-in functionality in Qt library to handle this.
9 Aug 2020 by CodingKnight
Comparison of PyQt and Tkinter
29 Oct 2012 by OriginalGriff
The whole idea of DLL files is that you don't have to combine them together - they exist separately so they can be used by multiple applications without needing multiple copies.The only way to combine and EXE with the DLL files would be to include the source of the DLLs in the EXE source, and...
6 Sep 2014 by Marco Bertschi
A walk-through on how a Key-Value pair can be parsed using a PERL-compatible regex engine
26 Dec 2011 by CPallini
Have a look at the Command design pattern (you may start at related Wikipedia page[^]): you may gain some insight.
18 Jun 2012 by Richard MacCutchan
Should be:void (CALLBACK *managedCallback1)(char **);void (CALLBACK *managedStopCallback)();The extra asterisk before the open parenthesis is incorrect.
6 Feb 2013 by Matthew Faithfull
That depends what you're doing with C/C++ and how much experience you have.Qt is very very good for small to mid scale application development for Windows, Linux and Mac. If you want to step outside that you may be out of luck, check the latest Qt docs. Qt is also very large, at least as large...
19 Dec 2013 by CPallini
Form the documentation[^], it looks you should use:QProcess myProcess;myProcess.start("pcd_viewer", QStringList()
22 Nov 2017 by Jochen Arndt
You can do that but it is bad style. A temporary variable should be local and not a class member: for (int i = 0; i
26 Mar 2019 by thoughts-on-coding
Introduction into an Automated C++ Build Setup with Jenkins and CMake
1 Sep 2020 by CodingKnight
An examination of PySide and PyQt to help find out which one to use
5 Nov 2020 by CPallini
The dot, roughly speaking, it is the 'member access operator', it allows your code to access an object member (a public variable or a method). Quote: QChart* chart = chartView().chart(); The above code looks 'strange' to the novice because the...
2 Feb 2021 by Rick York
It actually isn't there twice. The language is case sensitive. The first thing, MainWindow::Arguments, is the return type of a method. I assume it is an enumeration in the MainWindow class or one of its parents. The second one,...
31 May 2010 by Smithers-Jones
PreetiJuneja wrote:Where to start withHow about a beginners book?PreetiJuneja wrote:how will I get code for it?Hmm, how about: You have to write it yourself? And when you have a real problem, you come back, tell us, what exactly your problem is, and the maybe will give you a...
18 Jul 2010 by «_Superman_»
Use the GetWindowText[^] function with the window handle of the QT application as its first parameter.
27 Oct 2010 by Dalek Dave
Would help greatly if you could show us the code and the error message.It is impossible to answer you properly without these little clues!
13 May 2011 by Yusuf
Well have you looked at QCryptographicHash::hash[^]QString encodedPass = QString(QCryptographicHash::hash(("my string"),QCryptographicHash::Md5));Remember Qt returns binary, if you need it in Hex format use QByteArray::toHex.[^]
25 Jun 2011 by Sergey Alexandrovich Kryukov
I think this one is quite good: http://doc.qt.nokia.com/[^].Also pay attention for the Wiki at Qt Center: http://www.qtcentre.org/wiki/index.php?title=Main_Page[^].I would advice you to get used to English even if you're much more comfortable with Chinese; the habit reading in English...
21 Oct 2011 by Richard MacCutchan
The problem could be anything and anywhere; there is no way anyone else can even begin to guess what it may be. You need to add some logging/debug code to your application and gather sufficient information to identify where and why it is failing.
14 Feb 2012 by JackDingler
1. Define your problem.2. Work out your methodology.3. Design your architecture.4. Write your code.Come back if you have any C++ questions.
15 Apr 2012 by Chandrasekharan P
This link [^] looks like a good resource to integrate Qt with Visual Studio.
9 May 2012 by JF2015
I suggest you have a look at the XNA framework, which is the preferred solution for .NET applications running on Windows, WindowsPhone and XBox360:http://msdn.microsoft.com/en-us/aa937791.aspx[^]http://en.wikipedia.org/wiki/Microsoft_XNA[^]
17 May 2012 by Arun Kumar K S
How i can create .bundle extension file using Qt creator example(Myplug.bundle). I am in a work to create a plugin to already existing application that applications plugins are in bundle format. i found some sample code in Xcode to create bundle .How I can create such a project using QtCreator
30 Jul 2012 by Volynsky Alex
Try to use following way:void MyClass::writeSettings(QSettings &settings){ QFont font = this->font(); settings.setValue("reader.file.name", m_currentFile); settings.setValue("reader.file.mimetype", m_currentMimeType); settings.setValue("reader.file.position",...
19 Dec 2012 by CPallini
It looks using a Linux virtual machine would be the easy path, see the following discussion: http://qt-project.org/forums/viewthread/16474[^].
15 Jan 2013 by Jochen Arndt
Just have a look at the usbutils[^] sources which contain the lsusb utility. It uses the libusb[^] package. See the libusb API[^] for the provided functions.
11 Jan 2014 by CPallini
You might use, for instance, Visual C++, either for creating a console application or a GUI one.A GUI application written using WINAPI would have a pretty small executable with minimal additional dependecies (see, for instance "Deployment in Visual C++"[^]).
11 Mar 2014 by Peter Leow
Hope this helps you to get started: qtexcerpt.pdf[^]
6 Sep 2015 by TheHumbleGuy
Hi,first of all -> Qt is C++Qt supports different variants of UI implementation. QWidget-based and QtQuick-based. If you create a basic desktop application i would recommend the QWidget based way.Its probably the best to start with a small example to understand the basic concept of...
6 Nov 2015 by Jochen Arndt
Qt provides the QFile[^] class that can be used with together with the QTextStream[^] class .But it is not really necessary to use the Qt classes. You can just use the C or C++ standard library file I/O functions to create a file or open an existing one and write to it.To write formatted...
10 Nov 2015 by Jochen Arndt
In this block you are creating a QFile object with the same name as an existing object:if (nflag!=0){ QFile mFile(LoggerFileName); mFile.open(QIODevice::WriteOnly|QIODevice::Text); nflag=0;}You are opening a file but the other mFile object is still in it's previous...
11 Nov 2015 by Jochen Arndt
Such styles are usually applied on application level and not on widgets.At first you should decide which kind of styling you want use (style sheets or setting styles by code). They can be mixed but it is not recommended. This link may help you with the decision:...
15 Dec 2015 by Jochen Arndt
From your previous posts I know that the input is originally an 8 byte wide buffer.So why not use that (or a 64-bit value build from that) to perform your operations? That is how programming works: Operating on binary data. Strings should be used only for human readable user output,...
18 Jan 2016 by Jochen Arndt
This is a relative path:QDir dir("../MyProjects/ProjectB");If the current working directory is not a sub directory of "C:\MyDevelopment\", the path will be probably invalid (not existing).This will return the path to the passed name relative to the above directory.LFName=...
31 Dec 2016 by Dave Kreskowiak
There is no "best". It's a matter of preference. Try them both out and make your own decision.
28 Nov 2018 by Rick York
This error is not unique to Qt or any other framework. It is a linkage error meaning the methods noted can not be found. Often you will think you have the method implemented for a class but your function signature differs from the header's definition. It appears that you need to correctly...
28 Nov 2018 by CPallini
As Rick stated, this is a common linker error about missing methods. Now, looking at your code, you defined onsecChanges, onminChanges and onhrsChange methods, but you are apparently calling (see the error messages) secChanges, minChanges and hrsChanges. Can you spot the name mismatches? You...
20 Feb 2019 by Aurelian Georgescu
Strongly Typeded Identifiers in Qt
26 Jan 2020 by Richard MacCutchan
linux qt programming tutorial - Google Search[^]
5 Nov 2020 by OriginalGriff
You need to learn the basics, not just ask questions about random parts of them: you aren't going to get far unless you do understand what it going on. And "the dot here" is very, very definitely C++ basics! :sigh: Have a look here: What is the...
17 Nov 2020 by Mohibur Rashid
Short answer no. QHash is not Vector. Read this document to understand vector - std::vector - cppreference.com[^] I will refer three documents for you. * Templates - C++ Tutorials[^] - will explain what templates in C++ is * C++ - Default...
17 Nov 2020 by Richard MacCutchan
How many more times do you plan to ask this question? I have already given you links to the documentation where you can find the answers, please go and study it. What type of vector is this. Or how does this work?[^]
24 Dec 2020 by Rick York
The problem is this : SoundEvent::SoundEvent() That is the implementation of the class' constructor. That appears to be the declaration of the class which should appear like this : class SoundEvent { public: SoundEvent( qint64 timestamp = 0,...
10 Aug 2010 by kiranpmody
Hey,I wanted to know a few things. Has anyone any experience with using the C# binding for QT on a Windows XP/Vista/7 platform building for a Windows CE device?I want to know if there is a sample app (just a basic button which produces a hello world message would do) that I could use to...
28 Oct 2010 by Sauro Viti
I suppose that the error message complains about dll that could not been located. Isn't it?If so, just add the bin folder of your Qt distribution (something like c:\Qt\4.7.0\bin) to the system path.
24 Jan 2011 by Yusuf
Look at this [^]discussion forum. Here [^]is one of starting.
13 May 2011 by markkuk
In Qt 4.3 or later you can use the QCryptographicHash[^] class.
14 Jun 2011 by CPallini
You are returning the buffer held by a temporary object.
2 Jul 2011 by Emilio Garavaglia
Learning Java from C++ is easy.Your problem will not be Java itself, but the library you will use for GUIs.And it is the same problem as learning the QT library.
5 Aug 2011 by Nagy Vilmos
You are converting the image to base64. You must either remove the conversion or convert it back at the other end.
20 Oct 2011 by Amarnath S
We are developing a C++ / Qt / VTK application which is supposed to run on both Windows (XP) and MAC. The code base is the same, and we simply do separate compilation / building. Now, the strange thing is that it works fine on Windows (in Release mode); but sporadically crashes on the MAC...
17 Nov 2011 by StarDrago
If I understood You correctly You need to pack a few files to the single one. Try to do with BoxedApp Packer!
7 Feb 2012 by Christian Graus
You can't make the web service use JSON if it does not do so already. Don't make things hard for yourself, just use what the web service expects. If you control the web service, you can change it to use JSON, I would think. I write web services inside MVC, not using WCF, that send and recieve...
25 Apr 2012 by Geoff Samuel
Create a PyQt Widget that can be drawn on
4 Aug 2012 by Christian Graus
People ask this all the time, and it never makes sense. No, QT is not Quicktime. It's a UI library. But, you know what your skills are. You know what you're writing for ( you didn't even say, is this to learn, is it for a class ? ). So, decide on something that seems within your abilities. ...
23 Aug 2012 by Joan M
I would not go with a specific client unless you have plenty of control that this client will never change (something you should not want to tie to).Take a look at this link[^] in a website from one of the members of CP (the article here is not as new as in his web site).Here you will...
11 Dec 2012 by Member 9620311
I currently repairing some bugs on the Directory System.This system has a Webview panel and also a virtual keyboard.This system was developed by using QML, Javascript and 1% of C++.The virtual keyboard has error in the codes. I entered lower case 'a',in the website textbox it will appear...
19 Dec 2012 by X Guy
Dear developers,i have a C++ program which is written in QT, now the development stuff is done and it is compiled to be used inside windows but now i want to compile it for linux too.but the thing is i don't know how to do it :-(Note: I'm using QT 4.7.4 32 bit and mingw on windows 7.
20 Dec 2012 by Albert Holguin
Well... set up your compiler to and IDE onto your Linux machine (if you use an IDE). Now, you'll have to rebuild your Qt libraries for Linux, that should be in their documentation (although I have noticed their documentation kind of sucks). Once you have built the libraries, configure your IDE...
16 Jan 2013 by Jochen Arndt
You must link your program with the libusb library. Therefore, you have to add the libary name libusb to your project. How to do this depends on your development environment. With a simple Makefile, just add the name at the end of the linker call (many Makefiles use a LDLIBS variable that is...
6 Feb 2013 by Espen Harlinn
Let's not forget C++Builder XE3 [^]I like the IDE, and you'll find tons of free components at: Torry's Delphi Pages[^], as C++ builder is able to use, and compile, components written for Delphi (VCL).Best regardsEspen Harlinn
29 May 2013 by KarstenK
why dont yiu use google for that???http://qt-project.org/faq/answer/how_can_i_convert_a_qstring_to_char_and_vice_versa[^]
29 May 2013 by CPallini
Quote:QString myString to TCHAR wString ??QString has the toWCharArray[^] method.
4 Jul 2013 by smss IR
Hello everybody.When I have been studying this book : "Qt GUI Programming with Qt4, Second Edition"; saw an example which I implemented it on my Ubuntu, but it NOT compiled ...And the given error when I try to make it, is :finddialog.cpp:26:40: error: no matching function for call to...
5 Jul 2013 by Leo Chapiro
Try this: QHBoxLayout *topLeftLayout = new QHBoxLayout; QVBoxLayout *leftLayout = new QVBoxLayout; topLeftLayout->addWidget(label); topLeftLayout->addWidget(lineEdit); //leftLayout->addWidget(topLeftLayout); leftLayout-> addLayout(topLeftLayout);
19 Dec 2013 by H.Brydon
It seems to me that you don't have an implementation that will satisfy:QProcess myProcess(commandAndParameters);ormyProcess.start();The APIs in question take different parameters from what you have provided...
11 Jan 2014 by Captain Price
Well, you have to program directly to the operating system's API. This API is system-specific. On windows it is the Windows API. The Windows API is written in pure C.A "Hello-World" of the Windows API (AKA, Win32 API)://"Hello-World" application#include LRESULT CALLBACK...
11 Mar 2014 by Maciej Los
Steps to do:1) buy a book2) search for tutorials[^]3) start coding4) go to 1) This is the only way i know. And i promise you, it's the best way.
8 May 2014 by OriginalGriff
Recompile the original source with an ARM compiler: you can't convert X86 machine code (which is what the library will contain) to ARM machine code - they are totally different processors and indeed types of processor. X68 is CISC, ARM is RISC (according to the manufacturer anyway: I disagree).
29 Sep 2014 by shang12
I am working in a small project using QtMy program is a client, connected to server.I use QTcpSocket.connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(handleData()));Client receives data from server in 2 cases :+) Case 1: Server always send its statusClient receives and only show...
22 Oct 2014 by Yoav Miller
you will just have to save what was the last request the client sent (case 1 or 2), and when the data comes back from the server, process it and signal it to the next level.
4 Dec 2014 by OriginalGriff
Then I would start by asking at the website that you posted the problem post with, not a completely unrelated website that can't access their database...
6 Dec 2014 by CPallini
You have just to modify (or redesign) your application as server (in a client/server architecture). MSDN provides all you need[^].
8 Dec 2014 by enhzflep
It's actually pretty easy, if one is vaguely familiar with image-based programming tasks.I left a description of the file format in a comment above, though this can be seen from the code below.I first tried to create the new image and then use GDI+ to save it as a PNG complete with 16...
27 Jul 2015 by User 59241
I am not sure whether you don't understand unions or numbers. Floats and ints are different. A float is stored in IEEE 754 format: https://msdn.microsoft.com/en-us/library/0b34tf65.aspx[^]To put this another way there is absolutely no correlation between what is stored in memory for a long...
5 Aug 2015 by Jochen Arndt
Most FTP servers have a time out value for closing the connection when no requests are received. FTP clients usually have a keep-alive option to send a FTP command in defined intervals (e.g. the NOOP command). So you should implement something similar in your client.
8 Nov 2015 by Jochen Arndt
Because you are working on the project as group everybody should have the same development setup. So I would ask your fellow how he setup his Qt installation and help you doing the same on your machine. Then you should have no problems.Read on if you still want a manual setup.If he is...
11 Nov 2015 by Jochen Arndt
An incomplete example on how to store a timestamp based on the available code:int prevTime = 0;void someFunction(){ if (PCANReadS == PCAN_ERROR_OK) { int diffTime = 0; // If not first frame if (prevTime) difftime = timestamp.millis -...
3 Dec 2015 by Jochen Arndt
This won't work in a Qt worker thread.From http://doc.qt.io/qt-5/thread-basics.html[^]:Quote:As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All...
14 Dec 2015 by XamBEE
I want to remove null byte from string in which i am searching for FIRST non zero byte. and after getting the first non ZERO byte keep all NULL bytes further. look at the example below. Ex:QString myStr1 = "7f00000000000000";QString myStr2 = "7f00000000008300";Output...
19 Dec 2015 by Jochen Arndt
This can be done passing the address of the combo box as pointer or reference. Example:void Customers::initComboBox(QComboBox *cb){ // Optionally clear existing items cb.clear(); for (int i = 0; i
2 Jan 2016 by nv3
Without specifying what you mean by "really big" and what your actual problem is, it is difficult to help you. Try to answer the following questions:(1) What is the size of your virtual address space? (In a typical 32-bit system it's about 2 GB; in 64-bit systems it is much larger.)(2)...
18 Mar 2016 by Jochen Arndt
For a 2D chess game you may use the Graphics View Framework | Qt Widgets 5.6[^]. The chess board can be then drawn on the background layer of the QGraphicsScene Class | Qt Widgets 5.6[^]. Designing the board should be no problem. Just draw the 64 rectangles filled with alternating...
28 Apr 2016 by Jochen Arndt
User interactions should be always performed in the main GUI thread.A possible solution would be using an event that signals your main thread to display the message.Define the event ID as public member in the MainWindow header file. Note that the value must be application wide unique...
19 Jul 2016 by KarstenK
I would guess that your Mat back isnt proper initialized, but as I read it is another problem. For that kind of question you better search and ask in the OpenCV forum.Here is some example code for Using BackgroundSubtractorMOG2 for images which should help you.
16 Nov 2016 by Jochen Arndt
You need the image dimension in pixels (width and height), a lat/lon reference point at a specified pixel position (e.g. lat0 and lon0 at x = y = 0), and the lat/lon degress covered by the image (e.g. by having another reference point at max. x and y).First step is calculating the scaling...
22 Nov 2016 by Jochen Arndt
Please don't post external links to images. You only have a few lines of code and an error message that can be posted here.If you had done that I would be able to copy and paste the code into my answer showing you how to solve the problem. But so you will only get a textual answer.The...
1 Jan 2017 by VISWESWARAN1998
Well you have to decide it on your own, I'll explain the advantages and dis-advantages Qt :Advantages: 1. Qt has its own designer and designing a good GUI with the GUI designer available with Qt designer is fairly simple with the help of spacers, buttons, html editor etc., 2....
11 Apr 2017 by Jochen Arndt
At first you need the file format specification. See QuickTime File Format - Wikipedia[^] for an overview and history and the QuickTime File Format Specification[^] for the reference. According to the reference, QuickTime files use "atoms" to specify data blocks. Each atom begins with a 4 byte...
20 Sep 2017 by Jochen Arndt
You should clarify your question. A virtual serial port can be only "created" by providing a driver which is a system component and can't be therefore implemented by a normal application. Even the socat examples uses an existing serial port (/dev/ttyS0). If that is virtual or physical does not...
16 Jun 2018 by Kirk Hawley
Finally figured it out. When I copied required Qt dll's into my build directory I used the ones in the Qt winrt_armv7_msvc2017 directory instead of msvc2017_64. The winrt_armv7_msvc2017 dlls are for WinRT apps, or, now, UWP apps. WinRT needs VCRUNTIME140_APP.dll, which is probably going to be...
28 Nov 2018 by KarstenK
This kind of linker error are the result of missing implementation of these functions. Often is missing implementation, some typo or wrong scope (class or private) the reason. Goto to the place where the functions are implemented and fixit.
29 Nov 2018 by CPallini
I've just installed QTCreator (3.5.1, based on QT 5.5.1) on my Linux box. The program compiled and ran smoothly (buttons producing no effect, however). To make it work I had to: add a sleep call in the Mythread::run method. //... for (int i = 0;; i++) { sleep(1); QMutex mutex; ...
2 Dec 2018 by Richard MacCutchan
Start by learning the subject. Google will find you lots of materials.
10 May 2019 by Stefan_Lang
First of all, you can significantly speed up the calculation of a power expression with a high integer exponent, by repeatedly squaring intermediate results, rather than just multiplying with the base. Here's a sample implementation that you can adapt to your prefered integer type: #include...