Click here to Skip to main content
15,889,909 members
Everything / QT Creator

QT Creator

QT-Creator

Great Reads

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
by Asif Bahrainwala
OpenGL Compute Shader
by AmirShrestha
This article demonstrates how to link a third party libraries (DCMTK) to Qt based project.
by Marco Bertschi
A short guide on how you can style and customize the appearance of you QML controls in a CSS-like way

Latest Articles

by Asif Bahrainwala
OpenGL Compute Shader
by PatGulotta
An easy to use C++/Qt/Qml Floating Action Menu providing the ability to add Floating Actions Menus to a Qt/Qml cross-platform project.
by Nicolas Kogler
Extensible code editor with syntax highlighting, code completion and line numbering
by Mahmoud Samir Fayed
Simple database application for Desktop and Android written in the Ring Programming Language

All Articles

Sort by Updated

QT Creator 

23 Nov 2023 by KarstenK
Sounds like you must configure the camera settings or output correct. Take a look at this camera example code.
27 Oct 2023 by Member 15746979
I have drawn diamond on the 2D view. I want to rotate diamond on a particular axis(x-axis). If I have entered 20 degrees in textbox, then the diamond should be rotated on x-axis 20 degrees. Currently, I have top view of diamond and I want to...
25 Oct 2023 by Sebastian Porstendorfer
That is not a 2D problem, but a 3D one. You simply cannot rotate like this in 2 dimensions. You will need to define the diamond shape in 3D, and rotate it along one axis about the model origin, which should e.g. be the barycenter of the model....
25 Oct 2023 by Rick York
You are drawing the shape in two dimensions so with the data you have it is impossible. You have to compute the vertexes of facets of the diamond in three dimensions for this to be possible. Then you need to use a transformation matrix to...
2 Oct 2023 by Member 15746979
I want to bring live view of camera in C++ inside QT. I have tried the following code. In the code below, what happens is that all the cameras connected to the laptop are shown in the combo-box, and then when we select a camera from the combo-box...
2 Oct 2023 by Ridhdhi Vaghani
I am new to using QT and this is my first project inside QT. I built this project in QMake within C++. I don't know QT. But I want to learn it. I want to create a build of the project which can't be done by me. It is like a problem that I don't...
29 Sep 2023 by CPallini
The documentation Create Your First Applications | Qt 6.5[^] doesn't fit your needs?
5 Jan 2023 by Member 8840306
I am new in QT using C++ 98.I am setting the stylesheet in QT from of 5 label and 5 button using this class function Code 1(working), void Display::setting_Style() { ...
5 Jan 2023 by Michael Haephrati
There are a few issues with the code you provided in Code 2: In the first loop, you are trying to access the widget member of the signalMapper object, but this object does not have a widget member. You need to use MyForm::getMyForm() to get a...
27 Oct 2022 by mandeepish
I have a QString fileName which stores in it a path to a subdirectory (eg. C:/Qt). I also have a treeView inside a dialog box. Upon starting the application, we browse a file and once the file/folder is selected, I save the path of the...
17 Jun 2022 by Member 8840306
I want to draw map boundary(red dash line) by reading (lat,log) from this file that i made from google earth that is space separated file. 45.521282 56.506097 46.061904 58.982127 46.477755 61.11857 46.563424 66.067484 46.510663 66.351164...
30 Apr 2022 by Richard MacCutchan
If there are any QT experts on the site then chances are they will find any questions on the subject. Posting entries like this is rather a waste of time. Also, one wonders why you are running out of patience with dedicated forums (Qt and Linux).
1 Mar 2022 by Member 15253975
Hello, I am currently working in a qt project, my requirement is to log a data on a specific time (for eg: 10:14:21:100) when system clock reach this 100 msec on every second i need to log the data. Any body tell me how to achieve that......
1 Mar 2022 by Greg Utas
I'm not familiar with qt, but it probably has a "time now" function that includes milliseconds. Something like this should then work. You have to calculate how long to sleep until the next multiple of 100 msecs occurs: int sleep_time() { auto...
7 Feb 2022 by Elmin Hozbo
So I made simple calculator using pushbuttons(+,-,*,/)now i want to add a combobox instead of pushbuttons but i dont really now how.I was trying with switch case but it dont work.PLease help. What I have tried: I tried switch and i think i can...
7 Feb 2022 by M Imran Ansari
//C# Windows Form, when working with ComboBox, you have to assign DataSource, ValueMember to access the id of selected text and DisplayMember to show the selected text. You can achieve this using the following code: public class Operator { ...
7 Feb 2022 by KarstenK
Try some searching with a search machine which spitted out some QT5 TUTORIAL QCOMBOBOX - 2020.
18 Feb 2021 by steveb
This does not look like C or C++. /*Illegal return value*/onReadingChanged:/*Illegal token and missing parameter list*/ { accelerometerReading.xValue = (reading.x).toFixed(2); accelerometerReading.yValue = (reading.y).toFixed(2);...
18 Feb 2021 by jacobglaw
onReadingChanged: { accelerometerReading.xValue = (reading.x).toFixed(2); accelerometerReading.yValue = (reading.y).toFixed(2); accelerometerReading.zValue = (reading.z).toFixed(2); } What I have tried: onReadingChanged: { ...
17 Feb 2021 by CPallini
The brackets force the .x evaluation to happen before the .toFixed(2) one. Note they are not needed because of the left-to-right associativity of the member access operator (.). See C++ Operator Precedence - cppreference.com[^].
17 Feb 2021 by OriginalGriff
The brackets are probably not needed, but it's possible there was once a cast that required them - they just ensure that the dereference happens before the call to toFixed which would happen anyway!
14 Feb 2021 by OriginalGriff
Please don't repost if your question does not appear immediately: all of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then...
15 Nov 2020 by Rick York
First : you should learn how to add the code tags to your posts so one can see the code displayed properly. Your question is unclear. Curly braces are used to delineate groups of code such as the extents of a function or a method, the...
15 Nov 2020 by CodeProjectQuestions
What does it mean to have the { } after the vector? QVector AlbumDao::albums() const { QSqlQuery query("SELECT * FROM albums", mDatabase); query.exec(); QVector list; while(query.next()) { Album*...
14 Nov 2020 by CodeProjectQuestions
class GALLERYCORESHARED_EXPORT Picture { public: Picture(const QString& filePath = ""); Picture(const QUrl& fileUrl); int id() const; void setId(int id); int albumId() const; void setAlbumId(int albumId); QUrl...
14 Nov 2020 by Rick York
Picture is a class and from what you posted it appears that it is not derived from anything. The GALLERYCORESHARED_EXPORT flag is a modifier defined as a macro. In user code that is going to be defined as __declspec(import) in the windows world...
31 Oct 2020 by Richard MacCutchan
Try using QMimeData Class | Qt Core 5.15.1[^] to see which formats the data can be returned in.
31 Oct 2020 by Sergiy P
I'm getting data from clipboard and checking its type: const QClipboard *clipboard = QApplication::clipboard(); const QMimeData *mimeData = clipboard->mimeData(); if (mimeData->hasImage()) { ...
17 Jul 2020 by Ultran Messiski
Just use a app virtualizer like Enigma Virtual Box (free) or BoxedAppPacker (not Free) in top of that if you have no issue with loading dlls and functions one by one manually you can do manual mapping.
6 Apr 2020 by rpm3d
hi every bodyokthat is improvei have a exe program that use 4 dlland i wanna to bint this exe and dlls together...or combinenow is clear??
29 Sep 2019 by Stan Huang
I tried to create an empty project using Qt-Creator-v4.8.0 on Windows-7 and got 'No valid kits found' at some step. Below is my sequence: File --> New File and Project --> Application --> Qt Widgets Application (then location & name were given) --> In 'Kit Selection' page, there are two empty...
22 Mar 2019 by Gerry Schmitz
A serial port can only be accessed by one thread at a time (open; close). Each Window has its own thread; so they cannot "share the port". You can share the "data" / concurrent queues; not the port.
22 Mar 2019 by Member 9350237
Hello all, I'm developing a multi-widget Qt desktop application that serially interacts with an embedded device. I'm new to Qt and serial port application development. I need to reuse the opened serial port instance in other forms as well for reading or writing. Where and how I can...
23 Jan 2019 by Stan Huang
The trouble came from that I clicked the Qt-Creator icon at GUI to start it. Starting Qt-Creator in such way didn't set necessary environment variables. I then started it using the below way: 1 . open Terminal 2 . execute $~/qtcreator-4.1.0/bin/qtcreator.sh , it works then.
23 Jan 2019 by Stan Huang
I created an empty project at Qt-Creator-4.1 / Ubuntu with sequence: File --> New File or Project --> Application --> Qt Widgets Application --> ... --> Finish Then, I tried to build it and got "c: command not found" Did I miss any required steps before it? What I have tried: I tried to find...
20 Jan 2019 by Stan Huang
This trouble was due to that I installed only Qt-Creator, not Qt SDK. Once I re-installed it from https://www.qt.io/download-qt-installer , it works.
17 Jan 2019 by OriginalGriff
This is probably the same problem as you posted an hour ago: How come "no valid kits found"?[^] Rather than posting a new question to cover exactly the same ground (except of the OS and exact error message) edit your original question and add information to that. Duplicating questions...
30 Nov 2018 by UA12
these are the errors. Quote: qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init qt.network.ssl: QSslSocket: cannot...
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; ...
29 Nov 2018 by Richard MacCutchan
You have declared those methods in "Mythread.h", but you have not implemented them in the source code.
29 Nov 2018 by UA12
I keep getting this error when I try running a code that I wrote in Qt. I have attached the link to the screenshot of the error. The screenshot of the error Link to the code repository: GitHub - UA12/Stopwatch[^] What I have tried: I have been trying to understand what the problem is but...
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.
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...
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...
17 Nov 2018 by Coder Block
Hi all,Is there any PLC editor open source available in any laguange.or may be libraries that help me to develop my PLC editor window base application.If not,The please suggest me best shareware for same.Thanks ,
3 Aug 2018 by Rick York
That doesn't look like a valid file name to me : if ( !b.load( ":/images/nehe.bmp" ) ) You need to either remove the colon or insert a drive letter.
3 Aug 2018 by Member 13927363
I found this sample project based on NEHE Tutorial but doesn't work on my Qt version 5, tried editing some code but this the file cannot be loaded. And warning exists also warning: C4005: 'CALLBACK': macro redefinition this line gives the macro warning and the file is...
27 May 2018 by Sayan Bera
On an image(x by y), a QGraphicsRectItem is added, Let say Qrect(73, 77, 43, 28) Qrect(x,y,w,h). After resizing the image to 128 by 32, how this QGraphicsRectItem can be redrawn with proper co-ordinates. The image is first resized, and then the graphicsRectItem to be added. The grey area within...
20 Apr 2018 by KarstenK
What about copying the database file?
20 Apr 2018 by kashif mehmood
i am making a library management system in qt c++ in it i want to make a backup of database when user clicks the generate backup but i have no idea about how do i do it What I have tried: void liberarian::on_generatebackup_clicked() { Generator bu; bu.setModal(true); bu.exec(); ...
22 Feb 2018 by Asif Bahrainwala
OpenGL Compute Shader
7 Mar 2017 by Charly LEE
Hi,I am using QTextDocument to write html code and convert it to pdf filecode as below: QPrinter...
2 Mar 2017 by Charly LEE
Hi,as the description.I need to use the QFileDialog in Qt Quick Application without any widget. So I have to use it in QML. However, FileDialog in QML has no method/property to set the default saving file name so far as I know.Can anyone help me?What I have tried:I have searched...
2 Mar 2017 by Jochen Arndt
It seems that you have to implement it yourself or use an existing solution like Advanced FileDialog in QML | Kullo[^].
20 Feb 2017 by PatGulotta
An easy to use C++/Qt/Qml Floating Action Menu providing the ability to add Floating Actions Menus to a Qt/Qml cross-platform project.
1 Jan 2017 by Dreamer_X
i code with C++i want to know which is the best for GUI Desktop application : Qt or Visual Studio?What I have tried:i code with C/C++ and for web Python(Django)i tried at school C#
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....
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.
29 Dec 2016 by YznIT
is there anyway to collapse all code blocks in qtCreator ?i'm using Qt Creator 4.1.0What I have tried:i know that i can collapse code block with ctrl +
29 Dec 2016 by YznIT
I found a solution all you need to do is:1. Tools>options>Environment>keyboard2. search for Unfold All and set it to whatever you want.Thanks :D
29 Nov 2016 by Member 12877377
I want to write a hotel management system. First of all I want to know Can I write rest of the code in QT creator or I need another IDE too?What I have tried:I have already written db in SQL, examined QT, included database connecting and querying.
29 Nov 2016 by Jochen Arndt
The IDE does not care. You can use what you want (e.g. what matches your requirements and what you like or know). QtCreator makes sense when using Qt because you have the integration for the Qt UI design and the help for the Qt functions.But there are more comprehensive IDEs that might...
29 Nov 2016 by KarstenK
At first you must think about the requirements and needed interface and other stuff like security, internet access and servers. Than you must make some architectual sketching for what I like UML use case to cover all needed functions.After that and some discussions with your project partners...
31 Oct 2016 by A7lam Lover
i have found the solusionQString open_file = QFileDialog::getOpenFileName(this,"open file","/home path");QFile file01(open_file);now if you want to use the file for any operation you likefor example (get the file name or size) just use (file01) to do operations onby the way...
31 Oct 2016 by A7lam Lover
i'm making a files hash calculator app for a kde linux enviromentbut i'm facing a few problems:in this code that calculate the file's hashhashwrapper *sha512 = new sha512wrapper();std::string sha512Hashing = sha512->getHashFromFile("file01.iso");you notice the file01.iso heremy...
29 Oct 2016 by Nicolas Kogler
Extensible code editor with syntax highlighting, code completion and line numbering
17 Oct 2016 by Member 12798995
Hi all, I wanna know how to make this console appAn app to list all wifi saved in the pchow i can do this?? What method to use ??What I have tried:No try I just Want to know how i can start ???
17 Oct 2016 by Jochen Arndt
The first thing to do is querying you favorite search machine. Because getting such hardware related information depends on the operating system it should be included in the query. So a query might be "c++ windows list wlan interfaces". Following some hits you should be able to find these...
10 Oct 2016 by Mahmoud Samir Fayed
Simple database application for Desktop and Android written in the Ring Programming Language
24 Sep 2016 by Richard MacCutchan
You would most likely use a dialog. Either a predefined OpenFileDialog or QDialog Class | Qt 4.8[^].
11 Sep 2016 by Member 12733346
Hi Everyone, i've to implement in c++ a class for load a resource file while it update a progress bar (preferibly with Observer Design Pattern) implementing a GUI with QT Creator.I don't know how to begin..Teorically Subject is the file, and the Observer is my Progress Bar.i have googled...
11 Sep 2016 by Jochen Arndt
To provide a progress display your loading routine must update the GUI control in intervals. This is usually done by performing the loading in blocks and update the progress bar after handling each chunk of data.With Qt, Signals & Slots | Qt Core 5.7[^] are used for communication between...
29 Jul 2016 by tseiff
You didn't say, but I'm guessing you are probably trying to use gsoap on multiple namespacesI don't know how Qt handles things, but maybe this will help you find the solution.On the command line, using gsoap direclty, this will give you the same error:wdsl2h -o header1.h...
29 Jul 2016 by mytempacc
Found this error while compiling my qt gsoap application error: redefinition of 'Namespace namespaces []error: 'Namespace namespaces [8]' previously defined heredon't know what this is???can anybody help me out??? plz.
28 Jul 2016 by Jochen Arndt
Just write a command / batch file that does the job:rem Start application for each file in specific directoryecho offfor %%i in (data_file_path\*) do app_path_and_name "%%i"Here data_file_path is the full path to your data files and app_path_and_name is the full path and name of your...
28 Jul 2016 by XamBEE
Hello programmers!!In my application I am doing simulation from previously logged data. Logged data files are in one folder e.g Folder_A. Now I want to start as much instance of application as much files are in the Folder_A.Previous i was passing single file to application for singel...
27 Jun 2016 by Kaushik_M
This article is more on handling the state transition of an app in iOS device
20 Jun 2016 by Member 12587659
I am working on Non Gui Application. I need to browse a datalog file (datalog.txt) from comand line. How I can browse file(datalog.txt) from computer drive without Gui?? I am using QT.What I have tried:I dont have any idea of command line. so any help would be appreciated
20 Jun 2016 by Jochen Arndt
Qt is a GUI framework. If you don't want a GUI, there is no need to use Qt. Then just use standard C and/or C++ library functions.It is not very clear what you want to achieve. Do you want to open a text file and print the content to the console or process it line by line?That is quite...
19 Jun 2016 by Leo Chapiro
What do you mean by "browse a datalog file"?If you just want to open a file dialog, try to use QFileDialog Class like this:fileName = QFileDialog::getOpenFileName(this, tr("Open Image"), "/home/jana", tr("Image Files (*.txt)"));
6 Jun 2016 by AmirShrestha
This article demonstrates how to link a third party libraries (DCMTK) to Qt based project.
12 May 2016 by Mehdi Gholam
Google is your friend.Start from an example and learn what they have already done : EasyPaint Qt-Apps.org[^]
11 Feb 2016 by Jochen Arndt
You can use an event as already suggested in my answer to your question update/change QListWidget item value[^]:In a header file included by MainWindow.cpp and AnalysisWorkerThread.cpp (value should be application wide unique):# define DISPLAY_GRAPH_EV (QEvent::User + 1)Handle custom...
11 Feb 2016 by XamBEE
Hello CP members,Yes, I know that one cannot use GUI things from non-GUI threads. thats why i am trying to "do process" in worker thread(Non-GUI) than coming back to GUI thread(main thread) to display Graph. but getting following error.QObject: Cannot create children for a parent that is in...
27 Jan 2016 by Jochen Arndt
Just track the file position in a variable. File I/O functions return the number of items that has been read or written.High level file I/O methods often provide functions that return the current position (e.g. ftell) than can be used too.Special care must be taken when files are...
27 Jan 2016 by XamBEE
In my application I am reading from the text file but i need to keep eye on the file pointer where I am reading or how much content of the file i already read. and where to start next. There are TWO situations where i need to do this.CASE 1:: While 2 system A and B are accessing the file F...
25 Jan 2016 by Jochen Arndt
If the update should be initiated by another thread, you should create an event for that:// MyDialog.h// This must be unique for the application.#define UPDATE_COUNT_EV QEvent::Userclass UpdateCountEvent : public QEvent{public: UpdateCountEvent(int err, int warn, int v) : ...
24 Jan 2016 by XamBEE
I have created a Qlistwidget having some items(3 rows)Total Errors:: __Total Warnings:: __Total Voilations:: __ I want to know how to update the QListWidget each item while executing the thread? I have counter variable for each item of the QListWidget(ErrCount, WarCount, VCount)....
20 Jan 2016 by Jochen Arndt
See Data structures - C++ Tutorials[^] about structure type names and object names.In you case WorkerThreadStr is the type and workerthreadstr is an object (here a member of WorkerThreadClass).So you have to use the object name if you want to assign a value from a class function:void...
20 Jan 2016 by XamBEE
Hi,I am trying to get STRUCT value in my .cpp file but dont know exactly how to do this because i am using this first time.here is the code how i am trying to do..in WorkerThreadClass.h fileclass WorkerThreadClass : public QObject{ Q_OBJECTpublic: explicit...
19 Jan 2016 by Jochen Arndt
The arguments are passed to the main function where argc specifies the number of arguments and argv is the list of arguments. The first argument argv[0] is the name of the command itself so that argc will be at least 1.These parameters are passed to the QCoreApplication constructor that...
19 Jan 2016 by XamBEE
I have a Qt application for which i have to pass some command line arguements to make it execute. In the start user need to Type the FileName. Than i need to look for this file in file directory.This is my incomplete code.int main(int argc, char *argv[]){ QCoreApplication app(argc,...
14 Jan 2016 by Jochen Arndt
You can use one of the overloaded QWidget update()[^] functions that accept coordinates, a rect, or a region passing an area covering your area2 and area3 but not area1. In your paintEvent() handler pass the area which is provided by QPaintEvent to the used QPainter instance handler using...
14 Jan 2016 by LeHuuTien
I have a problem, need some helps. I have a Qwidget that have paint event, assume I have 3 areas on my qwidget are area 1, area 2 and area 3. I want to repaint only area 2 and area 3(not repaint area 1) when I call update or repaint of Qwidget. How can I do that.
14 Jan 2016 by Jochen Arndt
You can start any Windows program from a command prompt. Just enter the complete path at the prompt and press the Return key. There must nothing be changed in the source code.
14 Jan 2016 by Jochen Arndt
From the QWidget::paintEvent[^] documentation:Quote:A paint event is a request to repaint all or part of a widget. It can happen for one of the following reasons: repaint() or update() was invoked, the widget was obscured and has now been uncovered, or many other...
14 Jan 2016 by XamBEE
I need to execute my QT program from Window command line interface. What changes i need to do in Main() and how i can call this through command line??My program main function is..int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); ...
13 Jan 2016 by LeHuuTien
I have some problems. Hope anyone can help me. I have a Qwidget1 and Qwidget2. Qwidget1 have a widget that promote to Qwidget2. Both Qwidget1 and Qwidget2 have paintEvent. I have writed "qDebug()
8 Jan 2016 by Jochen Arndt
This is not related to Qt but plain C/C++.Just read the text file line by line, search the line for the string, and return that when found. So you have to select a file method that can read text files by line. Such a method may be the standard C file functions (fopen, fgets[^], fclose)...
8 Jan 2016 by XamBEE
I searched this site, as well as many other..but I'm not having any solution yet. My program needs to search for a word in a text file, and if it finds that word, Prints out/displays the entire line. example text file has the followingint DCDC_SyncGap_MRPDO[]={5,0,0,0,0};int...