Stack Exchange Network

Stack Exchange network consists of 174 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 development framework widely used for the development of GUI programs.

0
votes
2answers
54 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; { ...
1
vote
1answer
106 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 ~...
0
votes
0answers
13 views

Proper place to store the selected item of a model

I'm developing a Qt/QML-based application that uses global configuration profiles, which can be saved and loaded by the user. Almost all screens are affected by what is the currently selected ...
0
votes
0answers
38 views

Speed up code completion in QtCreator

I'm developing a GUI in Qt Creator 4.7.2. I installed it using the standard online installer form here. My MainWindow class now contains ~10.000 lines of code. It is now extremely annoying to ...
0
votes
1answer
42 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 ...
-3
votes
1answer
58 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 (...
1
vote
1answer
153 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 ...
-2
votes
1answer
67 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 ...
1
vote
2answers
120 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 ...
4
votes
3answers
863 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 ...
0
votes
2answers
328 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. ...
0
votes
0answers
35 views

Model-View in Qt app with device access

I'm building a monitoring system that, well, monitors a series of devices, periodically requesting various kinds of information to each device, such as current status, networking information and the ...
0
votes
0answers
77 views

Why does Qt consider disconnectNotify as violating the modularity of OOP?

Source It is stated that disconnectNotify is violating the OOP concept of modularity, why? Isn't it considered like LiveData of Android ? If it is really violating modularity, what was the ...
1
vote
3answers
610 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 ...
2
votes
1answer
86 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 (...
1
vote
1answer
493 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 ...
1
vote
2answers
303 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 ...
2
votes
1answer
195 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. ...
0
votes
1answer
103 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 ...
0
votes
1answer
199 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 ...
0
votes
2answers
336 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 ...
3
votes
2answers
575 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/...
0
votes
1answer
136 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 ...
0
votes
0answers
307 views

What is the proper way to delete a QProcess Pointer?

Backstory: I usually avoid Pointers like the plague, and so I am very inexperienced using them. I am currently threading a class, and it is complaining when I have a QProcess on the stack because ...
0
votes
2answers
281 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 ...
-1
votes
1answer
684 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 ...
1
vote
3answers
130 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 ...
1
vote
1answer
90 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 ...
7
votes
2answers
379 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 ...
7
votes
1answer
101 views

Database Model description using constants

I want to create a class with static constants which are used whenever a part of an application want to access the database in any way. This way I want to remove all magic numbers and string inside my ...
0
votes
1answer
102 views

What is the proper way to track my build versions in Qt?

Basically what I need in my project is a number of some sort that iterates itself every time I build my project, and that I can output by my program. So for example, when generating audio, I need to ...
0
votes
0answers
297 views

Qt open source and DRM/Copy Protection

I have learnt from here and here that LGPLv3 does not forbid the use of a DRM technology: The LGPLv3 doesn’t forbid anyone from implementing any kind of DRM technology. However, if someone ...
0
votes
0answers
96 views

Qt Naming Schemes for returns of boolean member variables: enabled(); vs isEnabled(); ?

In building my classes, I have noticed that I have not been very consistent about naming my boolean returns. In Qt; I notice that many of their classes use the is prefix, but checking their coding ...
0
votes
1answer
140 views

How to play audio samples while generating them

I am trying to write a simple live sine wave generator from scratch in Qt. I try not to use any external APIs like ASIO or VST. And I want to generate new audio while playing. (As opposed to the Qt ...
4
votes
2answers
1k views

Not understanding the concept of how to make my GUI application

I am making a program that primarily deals with heavy data mining and analysis. It is primarily a back-end type algorithm, with no GUI elements or console windows seen as it runs. Occasionally though, ...
2
votes
2answers
1k views

In Qt or C++, how should I check whether my `int` variable has been defined?

Short Problem: How should I check if integers are undefined, just as I can check QStrings for having NULL values? Backstory: This is my coding style when I am trying to avoid overloading my ...
1
vote
1answer
1k views

Creating a private in-house application with Qt

I want to create an application using the Qt framework, but can not at all afford a commercial license. While looking at the licensing comparison table, I noticed that the LGPLV3 license said this: ...
0
votes
2answers
553 views

Passing by refernce

I am trying to understand the ideas of pointers and references in C++. I am stuck with the following, what would be the specific behaviour in this case? I have a class like this: class MyClass{ ...
4
votes
1answer
560 views

Qt Quick dynamic QML vs Apple's App Store rules

Imagine that I've got a piece of custom audio hardware that I'd like to be able to control in a multitude of ways via a tablet/touchscreen GUI. In particular, my goals are to have the tablet's ...
4
votes
2answers
2k views

How to facilitate thread-safe access to large set of shared variables?

I have 2 sets--inputs and outputs--of 70 32-bit integer variables and 70 bools (140 vars altogether). These need to be accessed and modified from 3 threads. What is an appropriate design pattern to ...
0
votes
1answer
61 views

Sharing Project configuration files for an application with Qt IDE using Cmake and sharing via Git?

Imagine that you are starting to work in a project with a group of people. You want to share your code and the full configuration files of CMake, Qt IDE configuration. So you if you want to test or ...
6
votes
2answers
469 views

Why is threading platform-dependent?

I am reading book "Foundations of Qt Development", Chapter 12, and I read that threading is platform-dependent, can someone explain, why? I know how to use threads but that what they said is not so ...
0
votes
1answer
2k views

Find if certain files have been added or removed in large directory structure

I have a larger directory structure (dir + sub directories) with files. It contains files of certain types. For one particular type (let's say with appendix .foo) I need to figure out if files have ...
1
vote
1answer
580 views

Client-Server app architecture with custom communication protocol

I am working on Qt/QML/C++ based Client-Server software system with custom protocol. Now, in both projects inside QtCreator I have same header and implementation files inside both projects. What is ...
2
votes
1answer
1k views

Can Qt desktop programs be recompiled for Android/iOS as-is?

One of the advantages of open-source programs is that they can be ported easily to any platform simply by recompiling. Qt is also a cross-platform toolkit that can work on several platforms simply by ...
-1
votes
1answer
403 views

(Re)structuring a Qt Project [closed]

A PySide project I've been working on for a while now has started to grow to a point where it's becoming large enough that I've had to step back and re-think the overall design. I've spent some time ...
4
votes
3answers
1k views

I want to overload a function with the same type parameter; what should I do?

I'm creating an API, and I want to overload a function for strip: QString MyClass::strip(); QString MyClass::strip(QRegularExpression open); QString MyClass::strip(QRegularExpression close); QString ...
4
votes
3answers
2k views

Is it good practice to have your C++/Qt functions always check all its arguments for null values?

Backstory While developing with Qt Signal/Slots, I came across a few segmentation faults that had me puzzled as to what was causing it. Eventually I figured out that you could actually pass a slot ...
-2
votes
1answer
518 views

Can I use Qt open-source for my web-scraping website? [closed]

I apologize if I should be understanding this more readily but I'm a little new to this and dont understand the LGPL license. Here is the FAQ for it: http://www.qt.io/qt-licensing-terms/ I am making ...
10
votes
2answers
2k views

Merits of copy-on-write semantics

I am wondering what possible merits does copy-on-write have? Naturally, I don't expect personal opinions, but real-world practical scenarios where it can be technically and practically beneficial in a ...