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.)

Filter by
Sorted by
Tagged with
2 votes
1 answer
193 views

Dijkstra implementation for large graphs

I am implementing the Dijkstra 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 takes quite some ...
rednefed's user avatar
2 votes
1 answer
1k 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 ...
Matthias Herrmann's user avatar
4 votes
0 answers
411 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 ...
PVPJCJ's user avatar
  • 41
4 votes
1 answer
100 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 ...
VISWESWARAN NAGASIVAM's user avatar
2 votes
1 answer
4k 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 ...
Fab's user avatar
  • 23
7 votes
1 answer
351 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 ...
feedc0de's user avatar
  • 171
2 votes
0 answers
2k 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 ...
letelete's user avatar
1 vote
1 answer
3k 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 ...
konstantin_doncov's user avatar
3 votes
2 answers
803 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.) ...
Akira's user avatar
  • 168
4 votes
1 answer
477 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″ ...
Ruslan's user avatar
  • 258
3 votes
1 answer
2k 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 ...
Snowfish's user avatar
  • 103
2 votes
0 answers
265 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 ...
magu_'s user avatar
  • 938
3 votes
0 answers
1k views

Improved QML Settings

Qt.labs.settings 1.0 module from QtDeclarative (depricated) allows to use QSettings to make ...
Tomilov Anatoliy's user avatar
2 votes
1 answer
2k 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 ...
Snowfish's user avatar
  • 103
2 votes
1 answer
391 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...
Jamie S's user avatar
  • 33
9 votes
2 answers
6k 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 ...
Fritz's user avatar
  • 193
5 votes
1 answer
945 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 ...
Programmer's user avatar
3 votes
1 answer
293 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 ...
Chinmoy's user avatar
  • 31
0 votes
2 answers
2k 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 ...
user avatar
3 votes
0 answers
161 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: ...
Kamajii's user avatar
  • 147
0 votes
2 answers
342 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 ...
user3860708's user avatar
3 votes
0 answers
1k 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 ...
rok's user avatar
  • 141
4 votes
1 answer
686 views

Custom QT widget for QStackedWidget

I have a widget like below: ...
Joshua Strot's user avatar
6 votes
1 answer
8k 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 ...
Jack M's user avatar
  • 404
6 votes
1 answer
3k 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 ...
towi's user avatar
  • 608
2 votes
0 answers
113 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 ...
dlewin's user avatar
  • 129
4 votes
0 answers
584 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 ...
vsz's user avatar
  • 141
2 votes
0 answers
146 views

Race Condition Check

I have provided below my code in Qt 5.6(QML). I wanted to send the data when the slider value changes and also to send the same data every 2.5 secs when the slider is not moving. As a heart beat from ...
Shravan Singh's user avatar
6 votes
1 answer
2k views

Modular Visitor Pattern

Motivation I created this because the Visitor pattern felt like the most appropriate, but I also wanted to satisfy the Open/Closed principle with respect to the logic when visiting specific node ...
John Neuhaus's user avatar
6 votes
1 answer
5k views

Music player written in Python using PyQt

Some days ago, in the middle of a flight, in one hour or so, I've written this basic music player using Python3 and PyQt4. I needed some easy to use music player, so I decided to write this piece of ...
jrodriguezmonti's user avatar
3 votes
0 answers
1k views

C++ Single instance application with interrupt of main instance

I am writing an application using Qt5.7.1 which suppose to run as single instance application. One of the requirements is whenever user launches second instance of application, this instance should ...
Alexey Kamenskiy's user avatar
9 votes
1 answer
821 views

Raw PCM to FLAC conversion using QtGstreamer in C++

This is part of my kynnaugh-cc TeamSpeak 3 plugin implementing speech recognition for deaf/hearing-impaired users. One of the self-contained classes in my code has the job of converting incoming PCM ...
allquixotic's user avatar
6 votes
2 answers
656 views

Simple four function calculator in python

I just finished my first Python GUI project, a simple four function calculator. I think I've tested it pretty thoroughly. I'm learning python and OOP, so any critiques would be welcome. In general, ...
Matt's user avatar
  • 339
-1 votes
1 answer
43 views

Filled data structure with unique objects that does not have same member variables [closed]

I have in-house template like QList which creates a list of all objects of, say, Book. This list contains many objects of <...
samprat's user avatar
  • 101
5 votes
1 answer
131 views

Tool to prepare custom screenshots for uploading to Steam Cloud

I've recently released my first ever Qt application, and would be glad if someone will look into it and tell me if there are some flagrant anti-patterns and likes. This grabs some screenshots (paths) ...
Neurotransmitter's user avatar
3 votes
2 answers
3k views

QSlider direct jump on click

By default, QSlider move his thumbtrack by a value belonging to the singleStep() prop on mouse click. To make thumbtrack jump directly at the mouse click point, we need to create a new class inherited ...
user3204810's user avatar
4 votes
1 answer
1k views

Reimplemented QAbstractTableModel::setData

I have subclassed Qt QAbstractTableModel with QJsonDocument as data source which I have reimplemented the ...
KernelPanic's user avatar
1 vote
1 answer
1k views

Reading a file chunk by chunk in QT 4.3.3

I have following code in QT in ...
TechEnthusiast's user avatar
3 votes
1 answer
11k views

Insert new row to a QTableView by double-clicking the last row

Recently I was experimenting with QTableViews and I wanted to create something where I can add a new row to a table without having any additional button/menu item ...
Szőke Szabolcs's user avatar
4 votes
0 answers
685 views

MVC and Subject-Observer pattern in C++ & QT

I am trying to implement the MVC pattern in C++ & QT, similar to the question here: Other MVC Questions The program has 2 line edits: mHexLineEdit mDecLineEdit 3 buttons mConvertToHexButton ...
Smash's user avatar
  • 91
1 vote
1 answer
820 views

Setting and showing an image file on a QGraphicsView

This code sets and shows an image file on a QGraphicsView. I'm interested in seeing how to improve readability and reduce redundancy. ...
Akito's user avatar
  • 21
3 votes
1 answer
299 views

Image downloader class

I'm a novice regarding both C++ and Qt. This class is used in my project to get an image from a web service. If a new call to StartDownload is made before the ...
jacwah's user avatar
  • 2,661
3 votes
2 answers
87 views

Conditionally set strings if files exist

How can I reduce the lines I use with this code block? ...
user99434's user avatar
0 votes
2 answers
23k views

Replacing certain characters in a QString

This question is kinda similar to mine. However, I am using C++ with Qt instead of C#. How would I efficiently and easily remove all accents and special characters like !"§$%&/()=? etc. from a <...
Davlog's user avatar
  • 677
5 votes
1 answer
655 views

Settings dialog, using information from its parent window

My MainWindow popups a SettingsDialog. The setting dialog need to hide certain fields if the connected device is certain type. <...
zadane's user avatar
  • 327
3 votes
1 answer
3k views

MyTimer based on QTimer

I needed a timer that fires in intervals for a given duration when e.g. a button is pressed. The button can be pressed several times thus I thought it would be easiest to create a new timer for each ...
463035818_is_not_a_number's user avatar
3 votes
1 answer
2k views

PyQt5 validator for decimal numbers

This class is similar to QDoubleValidator, but it improves slightly on the editing comfort. The comments mention "comma" but it's actually the decimal point of your locale (comma for me). ...
Sebastian's user avatar
  • 133
7 votes
2 answers
9k views

Mean, Median and Mode of a QVector

I would like some help condensing this code down to size. I am trying to utilize Qt's container classes as efficiently as possible. I do not believe this code reflects my objective. ...
Ritchie Shatter's user avatar
6 votes
2 answers
341 views

Reading an SSH config file for an IP

I wrote this class which reads an SSH config file and checks whether an IP exists. If the IP does not exist, the class adds a block for that IP address. Header file: ...
zadane's user avatar
  • 327
4 votes
1 answer
771 views

Object destruction in Qt dialog

I am new to Qt and am trying to understand object destruction and where I need to explicitly destroy objects using delete. ...
newtoQt_s's user avatar