Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [qt]

Qt is a cross-platform application and UI framework for developers using C++ or QML, a CSS & JavaScript like-language. (Also use the [c++] tag for C++ code.)

6
votes
1answer
71 views

Qt Number Generator v2

Link to the old question. I tried to learn some new things from the answers and here's what I did: Used Qt Designer so that in Config.h, all member variables and ...
5
votes
2answers
145 views

GUI Number Generator in QT C++

I'm pretty new to Qt but already have a little experience with C++ so the first "project" I wanted to try out was a GUI random number generator. I am looking for some advices either in naming ...
4
votes
1answer
51 views

Enum class for weight units

I have some enum classes for units, like Weight units (KG and LB). I am translating the code to Qt C++ from Java, and I'm wondering what the best way to do this is as enums cannot have constructors in ...
2
votes
0answers
8 views
1
vote
0answers
59 views

Transfering Image Data with QTCPSocket

In my program I am transferring image files continuously through QTCPSocket for each frame I am creating new connection which I believe causes the performance problems. But I couldn't transform my ...
4
votes
1answer
131 views

C++ Qt simple GUI game

I'm trying to learn how to use Qt (5.11.1) for GUI applications so I've done a simple memory game where 12 tiles are displayed and every time the user clicks on a tile it will show an image, so they ...
3
votes
0answers
36 views

Basic Qt5 UI with button [closed]

I have the following Qt class: mainwindow.h class MainWindow : public QWidget { Q_OBJECT QPushButton* m_button; public: explicit MainWindow(); }; mainwindow....
1
vote
1answer
65 views

Prepare a cross-platform QT C-wrapper class for unit testing and mocking

The situation I recently started a cross platform QT project (arm, linux-x86, windows) that aims to interact with CAN-Bus hardware. I want to learn and get used to unit testing from scratch as good ...
1
vote
0answers
139 views

Drawing rectangle on a video with mouse in QT

I created a where I select a video using QOpenFileDialog and play the video on QGraphicsView. After that I select an area on ...
1
vote
1answer
62 views

Simple Qt GUI to list user-created categories and tasks

I've written a very simple program using Qt that I intend to continue working on as I continue learning C++ and Qt. I'm mostly wondering about my general code and comment style, specifically in terms ...
-1
votes
1answer
67 views

How to use a predicate to create or filter vector [closed]

I have function which returns a vector or strings (values from an sqlite3 table). For each of those strings I need to generate a Qt Checkbox, if it does not exist yet. My first version looks like ...
3
votes
0answers
97 views

PyQt layout wrapper with indents

As I'm sure a lot of you are aware, the layout files generated for Qt look quite horrible. Maya had a wrapper that let you indent each widget when building manually, so I decided to have a try with ...
4
votes
1answer
110 views

Age in hours calculator

I've written a small script, which calculates hours since the birth. I ask use about how old they are in years, months and day. I show them approximately how many hours they have lived. Below is the ...
1
vote
0answers
133 views

Alt-Coin Wallet QT Project for Mac OS-X

I was told my QT Project file is a hot mess. I'm returning to C++ after many years of doing Java and I'm really new to QT. I would like someone familiar with QT Project files to give my code a once ...
2
votes
1answer
86 views

Concurrent access to data with QReadWriteLock

Using Qt, I've got this code in order to protect access to some shared data between threads. I'm pretty sure the idea is correct, but I don't know if RVO and/or RAII could potentially screw the ...
2
votes
0answers
453 views

PyQt frame which changes color with child focus

I am working on an application that has various "panels" contained within splitters. I wanted the panel border to change color when one of it's children gained focus. Here is a simple example of the ...
8
votes
1answer
214 views

Simple postfix calculator app

Premise I'm writing a simple postfix calculator app in C++ using the Qt (5) GUI framework. This is simply for practice with software development. Visually, my calculator looks like this: The ...
5
votes
1answer
626 views

Plotting a GPS track

I have performed this test and they have not given me a conclusive answer (they really have not given me any response). I have to paint a graphic, do you think the implementation is correct? Is there ...
12
votes
3answers
510 views

A moveable QScopedPointer, or a Qt and std cross-compatible unique_pointer

I'm a hobby programmer, so I've never been through a code review before (online or offline). That said, here goes: Background I use Qt extensively but have long wanted ...
8
votes
2answers
3k views

A simple Fraction class

My code seems to work fine. However, I feel like it is a bit too long (fraction.cpp). I really want to create simple, readable, and efficient code. Sample Run: Here is the fraction.h file: ...
2
votes
1answer
69 views

Djikstra implementation for large graphs

I am implementing the Djikstra algorithm for a large graph (40k nodes, 100k arcs). For shorter paths the searchtime is under a second for larger ones (from one end to the other) it take quite some ...
2
votes
1answer
511 views

QT - Class For Connecting to Mqtt Broker With QMqttClient

Task: Class for connecting to a mqtt broker using QMqttClient and getting notified on connect and ...
4
votes
0answers
101 views

SoundBoard in C++ Using Qt

I've been working on a soundboard software for tabletop games audio immersion in C++ using Qt. The software consists of 2 tabs who provides to a game master a set of individual sounds or scenes to be ...
4
votes
1answer
69 views

RubberDucky Detector

RubberDucky which will look like a regular usb drive but it will act like a keystorke device. This C++ program will help you to find whether the connected device is actually a USB device is actually ...
2
votes
1answer
2k views

QT/QML scripting and property binding approach

I'm asking your help to understand it the following code does something that should really be avoided. The application I'm currently working on is an embedded HMI for a process controller who shares ...
7
votes
1answer
186 views

ApiClient with http communication in Qt

This is my first code review request on this page. I tried to simplify my ApiClient as much as possible. The full version is also on GitHub. I thought very long about how to design the API client ...
2
votes
0answers
731 views

Visualization of sorting algorithms

I recently started to learn Qt framework and decided to create an app to visualize the sorting algorithms(for this moment there are 5 sorting algorithms). I just want to know if I'm doing everything ...
1
vote
1answer
2k views

Multi-client TCP server with a thread for each client and DB connection pool

I'm creating a Qt TCP (with SSL) server to which multiple clients should connect and use the DB, and this is the main task. So, I think I can use this architecture: each client has its own thread, and ...
3
votes
2answers
261 views

Using QXmlStreamReader to read configuration file of key-value pairs

Background The following XML snippet contains configuration parameters for our application in key-value pair manner. (Despite using INI files for such purpose may be better, I have to use XML files.) ...
4
votes
1answer
132 views

C++ with Qt - Conversion of angle in radians to DDD°MM′SS.FFF″ string

I had to write a function which takes an angle in radians and precision N as input and returns a string representation of its magnitude in the format DDD°MM′SS.FFF″ ...
1
vote
1answer
855 views

Use callback style to start a worker thread and receive result in Qt

After using JavaScript for a while, I think callbacks are pretty good for asynchronous programming, but I haven't seen anything similar in C++. What I want to achieve is to start a worker thread from ...
2
votes
0answers
161 views

asyncio with live update and abort capabilities

This is my first shot at asyncio. I'm looking for any pointers you might have. Especially: Are there any race conditions? This code doesn't scale as expected. In ...
1
vote
0answers
228 views

PySide: Feedback progress of task back to GUI from QThread

I have some PySide GUI application which is capable of executing long running tasks. The targets of my application design is to put the task execution to a thread to not block the GUI (e.g. for ...
1
vote
0answers
504 views

Improved QML Settings

Qt.labs.settings 1.0 module from QtDeclarative (depricated) allows to use QSettings to make ...
2
votes
1answer
844 views

Better QOpenGLWidget by delaying GL code to initializeGL with lambda functions

When I am writing OpenGL applications with the QOpenGLWidget class, deciding what code goes into the initializeGL function has ...
2
votes
1answer
252 views

Logging class in Qt library for foreign language calls

I have a small C++/Qt library that interfaces with an application in another language (so interfacing must be performed using primitives, notably pointers to Handler...
5
votes
1answer
2k views

Safely and elegantly handling UNIX signals in Qt applications

When you search the web on how to gracefully shut down your Qt application when receiving SIGTERM, you are invariably directed towards this informative, yet ...
5
votes
1answer
443 views

Board game in c++ using qt

I have been working on a board game in c++ using qt. The game cosist of four palyer with four different colors. I am looking forward to improving my board looking. This is all working fine, but I ...
3
votes
1answer
129 views

Sharing file descriptor between an under-privileged and a privileged process (using C++ and Qt)

This code is part of my Google Summer of Code project. It will be used in a file manager to provide file management in a root-owned directory. As the title suggests this will be used to share file ...
0
votes
2answers
1k views

Open text file and read data to an arrayfire array using Qt and C++

I'm currently writing a C++ project with a Qt GUI and would like to read numerical data from user-selected text files through QtFileDialog::getOpenFileName. There ...
3
votes
0answers
108 views

Trait class for a serialization framework

In a current project I have implemented a small non-intrusive serialization framework based on type traits. The generic trait template looks like this: ...
0
votes
2answers
198 views

C++ QThread for Oscilloscope/LAN communication

I have written a Class for LAN communication using an Agilent Oscilloscope. I would like you to your opinion what I can change with this code, so it work without problem. I would like to know your ...
3
votes
0answers
841 views

Send Opencv::Mat image from Qt application to HTML client, using websocket

I wrote an application in C++ using Qt 5.7, basically is a websocket server, using qwebsocket for this, capable to send an image elaborated with OpenCV to an HTML client. In order to do this I encode ...
4
votes
1answer
365 views

Custom QT widget for QStackedWidget

I have a widget like below: ...
6
votes
1answer
2k views

My first Qt application - a multiple-state window with a menu

This is my first Qt app and also some of my first non-trivial C++ code. The application displays a menu offering two options. Clicking either option takes you to a sub-page with some text and a back ...
3
votes
1answer
1k views

Making modern (RAII) C++-code with Qt5

I am fully aware that Qt is quite good with handling ownership in its object trees. The usual pattern seems to be to use a raw new, assigning the result to a raw ...
1
vote
0answers
20 views

QtGui interface - improvements to structure

My code brings up a GUI interface, the user enters info: text that ends up in the resulting report, and dialog windows that select a file, be it data or a picture. I have been using this code ...
3
votes
0answers
99 views

Matrix Project: defining a matrix CAD through objects design

The main concepts of this project This whole project will include a designer to create leds figures (AKA patterns) + a player to animate these patterns + a client to send patterns to a distant target ...
1
vote
0answers
25 views

Populating a view showing data from user contacts

I am using a QSqlRelationalTableModel model_contacts to populate a view that shows all necessary data from the contacts of the user. Today, I need to add a ...
5
votes
0answers
381 views

Creating a global font handler for a Qt widget application

A widget-based Qt application has to run on a wide variety of platforms, some of which don't include fonts at all. Therefore I created a global font loader utility class, with the justification that ...