Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [qt]

Qt is a cross-platform application development framework widely used for the development of GUI programs.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
32 views

What's the correct way to implement a gameloop with a QApplication, drawing to a QGraphicsScene? [closed]

I'm making a GUI-focused game. The game itself is developed somewhat independently of the GUI. My reasoning is that I might want to change the interface technology at a later date. Right now, the game ...
NeomerArcana's user avatar
0 votes
0 answers
43 views

Setting Dependency Design

Hello I'm currently designing an GUI application who's main job is to update and display settings and some other data. For context, I'm using QT framework. I'm starting to refactor the settings ...
mcmatt90's user avatar
0 votes
1 answer
40 views

Is it a good approach to encapsulate View and Model inside a dedicated Widget?

Lets say you have a ItemView and a ItemModel. Would it make sense to have a ItemWidget encapsulating those two, so code using ItemWidget don’t have to deal with ItemView and a ItemModel specifics? ...
Narann's user avatar
  • 101
0 votes
0 answers
24 views

3 QAbstractListModels versus 1 QAbstractItemModel

This is a simplified representation of the existing data structure I have in my code (The actual data structure is composed of classes), the data of which I need to display and modify via multiple ...
19172281's user avatar
  • 133
1 vote
0 answers
195 views

Is it preferable to embed ".qm" translation files with Qt Resource System or bundling it with PyInstaller?

I'm learning PyInstaller for deploying Python applications, more specifically, applications developed with PyQt5. As far as I understand, it's possible to bundle application data (or "resources&...
Giovanni L's user avatar
0 votes
1 answer
112 views

What information should one infer from a class header that marks its constructor explicit?

If a class is written well, you should be able to gleam all relevant information about the class simply by looking at its header. If one sees that the constructor is marked explicit: What should one ...
Anon's user avatar
  • 3,613
0 votes
2 answers
303 views

Accessing Hardware-based resources from multiple worker threads

I have a technical application that interacts with different hardware components: measurement devices, sensors, custom hardware. These use dedicated interfaces like USB, serial ports, TCP/IP ...
FourtyTwo's user avatar
  • 119
0 votes
1 answer
217 views

Plugin system design core component access: Common practice?

I wonder how to design a good plugin architecture in C++/Qt. The main concern I have is about dependency injection vs globals when it comes to the core components. Plugins should have access to ...
ManuelSchneid3r's user avatar
0 votes
0 answers
30 views

User proof network app with distant database [duplicate]

I’m currently writing a software for my company (3rd world country), and I wanted it as simple as possible to install and maintain, so I started with Qt and no server app beside the database, (MariaDB ...
Max13's user avatar
  • 159
0 votes
1 answer
2k views

Using the same function in two classes? [closed]

I have two classes for making pyqt5 windows. Inside class one I have a button with a function it is connected to. Class One: from PyQt5 import QtGui, QtWidgets, QtCore from PyQt5.QtWidgets import ...
Have a nice day's user avatar
0 votes
1 answer
96 views

Designing a library API to allow for interactivity

The application I'm currently working on is deeply coupled to the UI framework in use (Qt at the moment). I would like to separate the UI-specific code from the rest as much as possible, with the goal ...
Higor E.'s user avatar
  • 121
1 vote
3 answers
279 views

When is Model/View/Controller Too Much?

To preface, I work at a place that I feel misunderstands and overuses MVC, but I also recognize that maybe it's me who doesn't understand it. I'm used the model/view exclusively within the context of ...
stowaway's user avatar
1 vote
2 answers
2k views

Best way to access (grand grand) parent element in gui

I'm creating a multi window gui program, in c++ with Qt Widgets. I do have many custom gui elements, which usually are c++ classes inherited from QWidget or other Qt elements. When foo is the main ...
Turtle10000's user avatar
0 votes
1 answer
3k views

fake filesystem for unit tests

I am writing an application in c++ and Qt5. It would be very convenient for me to create a virtual file system so I can unit test code working on files. I have found that in Qt4 there was a ...
Michał Walenciak's user avatar
2 votes
2 answers
710 views

Design tips for waiting for a user input while working on another thread

I am working on an application with multiple threads (using Qt, C++). One of this threads is designed to execute a batch of operations like reading/writing from/to files as well as creating new ones. ...
ArenaLor's user avatar
  • 129
2 votes
2 answers
136 views

Processing user commands and parameters

I'm writing a GUI application which needs the facility for users to interact with the system and execute tasks via a sort of command line interface. The user will type commands in a text box, with ...
19172281's user avatar
  • 133
1 vote
0 answers
68 views

How to organize an App composed of Features in Qt?

When developing a somewhat larger application, with 3-4 screens or so, what is the most common way to organise the code? I've read that organize-by-feature trumps organize-by-type, so I was ...
xtofl's user avatar
  • 334
1 vote
0 answers
632 views

How to design a PyQt/Pyside2 application to use the MVC pattern with the Qt MV pattern?

The context: I created a PySide2 app to remote control a pyhsical product. The device is interfaced with a driver to get and set it's overall state (state machine with nested and parallel states) and ...
thinwybk's user avatar
  • 111
2 votes
2 answers
2k views

How can I emulate Signals and Slots found in Qt, to Javascript / Typescript Classes?

Ive brought this up with other developers, and they say while there is no obvious way forward, it seems that they all have an idea of how to go about it. Is there any way I can implement signals and ...
Anon's user avatar
  • 3,613
0 votes
0 answers
49 views

Which components of an HTML Element, can I assume will be static over the course of its lifetime?

This is a question for people who are familiar with how HTML typically is built and behaves on webpages. Backstory and requirements I am building an HTML tracker with a C++/Qt backend. I am trying ...
Anon's user avatar
  • 3,613
1 vote
4 answers
688 views

How would I add up enumerator values such that any combination provides a unique number?

Backstory (You can skip) I am writing a pronunciation library for irregular words. Take something like the following: T1E1s // tee one E one es | tee one E ones 1994-1995// 1994 (minus|dash|to|) ...
Anon's user avatar
  • 3,613
1 vote
1 answer
329 views

Architecture/Design for Hardware Control Software

I'm currently working on the control software for a system that includes a lot of user controllable hardware and also has many configurations. Configurations in this context refers to a specific ...
Developer Paul's user avatar
2 votes
1 answer
3k views

Do I need to make my code open source or buy a license? [closed]

I want to develop a GUI in python for my company in order to sell it to the customer. Being fresh from the university where I used pyQt, I promptly started programming using that library, just to ...
Francesco Pegoraro's user avatar
1 vote
2 answers
2k views

Organizing and Creating a Custom Qt Widget

I am looking to create a digital Rolodex to keep track of contacts in Qt 5.9 and am uncertain how to efficiently create custom widgets. Examples online like the classic clock example show to ...
Steve's user avatar
  • 225
2 votes
3 answers
508 views

In c++, is there a way inside a function block, to execute cleanup code after the value has been returned?

Backstory (You can skip) I am building an API for managing Files and Directories in a consistent manner across a project. This is for deduplication and consistency when performing a task, and in this ...
Anon's user avatar
  • 3,613
1 vote
0 answers
225 views

Save data from multiple Qt components scattered around multiple QML files

I would like to save the current "value" property of several components (e.g. a Slider) as a configuration profile when the user clicks on the Save button in my application. However, the Save button ...
ivarec's user avatar
  • 315
1 vote
2 answers
2k views

Should I always allocate QObject and derived classes to the heap?

I was in #Qt irc channel, and I showed a small snippet of my code in a style that I heavily rely upon. It looks like this: /* Get Reply from Server */ QPointer<QNetworkReply> reply; { ...
Anon's user avatar
  • 3,613
1 vote
1 answer
343 views

How to understand and design functions with enumeration arguments that work in tandem with bitwise operators in C++ and Qt?

In the C++, there are 6 bitwise operators: Symbol Operator & bitwise AND | bitwise inclusive OR ^ bitwise XOR (eXclusive OR) << left shift >> right shift ~...
Anon's user avatar
  • 3,613
0 votes
1 answer
483 views

How to manually model a UML activity Diagram to JSON with Qt C++?

Suppose I have a kind of UML activity diagram with 1-n forks and joins. The assignment of the individual nodes relative to each other is defined by an XML relationship table via UUIDs where each ...
FlKo's user avatar
  • 111
-3 votes
1 answer
464 views

QElapsedTimer hasExpired() - Is it one msec off?

Here is a a part of the documentation of Qt's QElapsedTimer: bool QElapsedTimer::hasExpired(qint64 timeout) const Returns true if this QElapsedTimer has already expired by timeout milliseconds (...
FlKo's user avatar
  • 111
1 vote
1 answer
516 views

Remove duplicated switch statements caused by not knowing type at compile time of opencv matrix?

I have a situation that occurs 5 times in my code, and continues to grow. Basically I have the same switch statement structure every time I need to perform an operation that involves my matrix and ...
Krupip's user avatar
  • 1,300
-1 votes
1 answer
2k views

What Is the Best (Conventional) Way to Format Code for PyQt5

I was looking into PyQt5 for one of my side-projects and would really like to get to learn it better. However, I wasn't sure how to correctly format the code. I've seen tutorials do class definitions ...
MrGVSV's user avatar
  • 13
3 votes
3 answers
549 views

How to separate serialization, visualization and computation from GUI editable code objects?

This might be an X Y problem, but here's my situation. I've got a QT5 C++ code base whose task it is to allow for the configuration of a "process chain". A "process chain" here means a list of ...
Krupip's user avatar
  • 1,300
11 votes
5 answers
14k views

Moving from Qt/C++ to C#/WPF - Productivity Gain?

I created a small Desktop application (approx 15000 lines of code, so not that large) written in C++/Qt. This is non-commerical, just a hobby project and I am coding on my free time. The larger the ...
ndbd's user avatar
  • 349
0 votes
2 answers
2k views

What is the safest practice in handling QWidget pointer lifespan in a QObject oriented environment?

Consider the following constructor: NetworkTools::NetworkTools(QObject *parent) : QObject(parent) { view = new QWebEngineView(); view->setParent(parent); // Produces an error, shown below. ...
Anon's user avatar
  • 3,613
2 votes
3 answers
1k views

Architecture of gui application

I am writing gui application. I want to implement following structure: project tree with nodes of different type and behavior (i.e. when right clicking or selecting there can be different menu ...
user avatar
3 votes
1 answer
266 views

Reusing UI elements between two different QWidgets

I am writing a utility in C++ with Qt which communicates with an embedded device. The program was originally going to be used to just plot data from the device, but a new requirement has been added (...
ctzdev's user avatar
  • 131
3 votes
1 answer
2k views

When writing a Qt application is good practice to ALWAYS prefer Qt function implementations, data types, and classes when they are available?

I'm just starting out with Qt and I really want to try and keep my application as separated from Qt as possible in case I decide to use a different toolset later, but at the same time don't want to ...
tjwrona's user avatar
  • 239
1 vote
2 answers
428 views

How should I structure my C++ project to allow for starting, stopping, and pausing my program?

TL;DR: How should I structure my C++ project to allow for starting, stopping, and pausing my program? Overview: I am designing an application that needs to allow users to start, pause, and stop the ...
Alan's user avatar
  • 129
2 votes
1 answer
338 views

Using Qt in Open Source App that Communicates with Closed Source Hardware

Preface I'm having trouble determining if I can use the Qt framework for developing a cross platform desktop app. Situation The app is open source, and the libraries it uses are also open source. ...
Megabytte's user avatar
0 votes
1 answer
116 views

For Qt, or C++, do modern standards or practices exist for designing Run Configuration files for your programs? [closed]

Backstory I am building a daemon that is to be run in the background on systems based on X11. As of right now, the settings are hardcoded, and that obviously needs to change. As such, I plan to ...
Anon's user avatar
  • 3,613
0 votes
1 answer
1k views

In Qt or C++, is there a good means for creating a switch with dynamically generated cases, or should I just use a for loop (or something else)?

Presume this situation: Max Number of 256 key slots. Key slots are defined by a struct, and a variable for each (256) has to exist. User defines which keys slots are active at initiation (in my ...
Anon's user avatar
  • 3,613
-1 votes
2 answers
766 views

Interaction between model and self-modifying data in Qt MV

I have a tree structure that represents a system of devices that are connected to the PC via serial port. In a way, this structure was inspired by tree model example in Qt and I think that helps to ...
qloq's user avatar
  • 159
5 votes
2 answers
3k views

What can I infer from someones code when they use direct initialization with Curly Braces as opposed to Parenthese?

Up until now, I have been initializing most of my variables as such: const QString foo("bar"); Which from my newfound understanding, is known as direct initialization. (http://en.cppreference.com/w/...
Anon's user avatar
  • 3,613
0 votes
1 answer
333 views

Windows Qt5-based app porting to Linux

I'm here today, because I'd like to ask you a question about porting application built with Qt5 to linux. I have been asked to port this application to linux, I don't yet have the source code, but I ...
pzaj's user avatar
  • 143
3 votes
2 answers
3k views

Events fired when widgets are updated programmatically

In the GUI application I'm working on I have a number of custom (composite) widgets that I've created, with each widget having an update_gui function where I access my SQLite database so I can fill in ...
sunyata's user avatar
  • 449
-1 votes
1 answer
2k views

Is it required to disclose source code for custom Qt software? [closed]

I was hired to develop a custom Qt application for a customer, but I'm concerned about the licensing. My software will not be publicly distributed and it is going to be used exclusively by this ...
Fernando's user avatar
  • 115
1 vote
3 answers
1k views

How to handle custom metadata in XML?

Backstory I have an XML type document (SSML, which is used forText-To-Speech), which will be used to generate audio files when ssh transferred to a remote server. As such, I will need to include ...
Anon's user avatar
  • 3,613
1 vote
1 answer
168 views

Static link GUI project as dynamic library

My app has 2 projects: logic.dll and GUI.dll. Currently, its size is 1MB, but the whole app's size is 60MB+ due to the dependency dlls. I've read about QT-LGPL license and know that to keep my app ...
MarkJoy's user avatar
  • 13
7 votes
2 answers
615 views

How to treat in-house libraries

I am facing problems structuring projects and libraries. In the company I am working for I often see, that things would be more maintainable and less error prone, if we could extract common code and ...
exilit's user avatar
  • 187