Looking for Qt trainer
Hi, I'm looking for someone who can give half/full day training over zoom on topics like QGraphicsView & OpenGL, Qt Unit Test, Multithreading and Debugging.
If anyone interested, please pm me. Thank you.
Not interested in using QML or UI Design Form.
https://redd.it/1dzwq0e
@qt_reddit
Deploying (bundling) tool
Hello,
I'm building a Linux application and I only need to package it as a tar.gz file with all the dependencies, for it I'm using the https://github.com/linuxdeploy/linuxdeploy tool with the qt plugin, but recently I saw that in the Qt5 documentation this other tool https://github.com/QuasarApp/CQtDeployer is linked.
I wonder what is the community recommended deploying tool?
Thanks
View Poll
https://redd.it/1dz6pay
@qt_reddit
QtNetwork Client/Server for MacOS
hi guys, I'm just became a intern in a company which uses QT. the problem is im a Mac user and they wanted to me work on QTest and QtNetwork. so I need to understand how should I use Client/Server architect. what would you guys suggest me for using server and port connection? If I'm not mistaken I can use postman, but im not sure can I use it for serial ports. If need to use any other tool or you want to give me a suggestion, just write. Thank you <3
https://redd.it/1dy84bf
@qt_reddit
Small Issue with QT
Right clicking doesn't work
I wanted to check this program out. It's cool, but I'm having issues with the above. I can't right-click on anything in the UI to activate the slot. I was wondering if anyone had advice for this. I've seen a few threads, but I wonder if this issue is the same. I'm going to uninstall and re-install and see if that works. I appreciate any help you can provide.
https://redd.it/1dxthqp
@qt_reddit
QtPositioning on AOSP
Hello, I need to ask do you know any ways to get GPS position on AOSP? This code don't work:
https://preview.redd.it/7w2w65hv63bd1.png?width=1824&format=png&auto=webp&s=8532d857b5e8c40e7436a92fe7730d7370dc9d43
I tested it on two the same phones - one with original rom ( with Google Services ) and another with ArrowOS and noticed that program works well on original rom so probably this is a problem with Google Services. ( I added photo because I don't know how to format code on reddit )
https://redd.it/1dxewwr
@qt_reddit
Question About Qt licensing
So, I am a dev, looking to make a desktop app and sell it commercially.
The qt website clearly states that I have to get a license for that which starts from $999/year. Although I am not sure if I would even get that many users in the first year.
What if I just create the desktop app from qt and give it to everyone for free, but charge money only if they want to use premium features from a backend service? Would that work.
https://redd.it/1dwayto
@qt_reddit
Qt based mobile phone OS: KDE Plasma Mobile 6 in postmarketOS
https://www.youtube.com/watch?v=6pOSaj0KM20
https://redd.it/1dvy63m
@qt_reddit
Guidance regarding Qt framework for building cross platform applications
Hi there , I am looking to build a cross platform GUI (windows and android mainly).( Note: I am a lone DevI am building everything in community software) I want guidance on how to proceed regarding the building of a dashboard for viewing data from a remote device. Should i use design studio? it seems it makes everything in .ui.qml file where i cannot give any javascript logic. I have made a small qml only app completely by coding the qml . But i want advice on what to do if I want to build largescale applications .
I have used design studio exported project from it and then tried to edit in the qt creator but cannot seem to apply the logic and since i am a noob i cannot understand the file organisation or default structure of how the design studio exports and where I can put the back end logic.
https://redd.it/1dv4dd2
@qt_reddit
Qt Creator SIGSEGV Segmentation fault
I installed Qt through aqt (in my country you can't set Qt). When I run this code i get an error:
#include <iostream>
int main(int argc, char *argv[\]) {
std::cout<< "Hello World!";
}
an error appears on the line with cout. error: signal: SIGSEGV appointment: Segmentation fault
how to fix the error? The problem is most likely in the Qt itself. but I have no idea what to do.
https://redd.it/1dv13wl
@qt_reddit
PySide6 QWebEngine doesn't play video on Instagram
Hi,
I'm trying to fix an issue I have with QWebEngine to make it play videos from Instagram.
Unfortunatelly no matter what I try I get an error message stating that it was not possible to play the video of the reel or in stories.
I don't make anything fancy or against Meta's policy, no automation, slow rates of http requests (only manual controlled requests are made). I just load urls from my sqlite file and maintain notes about the profiles I like.
It's not a tool specific to Instagram but I'd like to be able to view videos.
Would it be possible to make QWebEngine load videos ? How ?
The exact error message I get in the web page is:
Sorry, we're having trouble playing this video.Learn more
And in the console I get this:
PROGRESSIVE_JAVASCRIPT_NATIVE/MEDIA_ERR_SRC_NOT_SUPPORTED/URL_RESPONSE_HTTP_200: MEDIA_ERR_SRC_NOT_SUPPORTED/URL_RESPONSE_HTTP_200 Unknown media error. Fetched video content with Status:200 Content-Type:video/mp4 [Caught in: VideoPlayerErrorBoundary caught an PROGRESSIVE_JAVASCRIPT_NATIVE/MEDIA_ERR_SRC_NOT_SUPPORTED/URL_RESPONSE_HTTP_200 (PolarisVideoX)\]
https://redd.it/1dtfi9s
@qt_reddit
Console application QT noob
Hello, I'm new to Qt. I just installed Qt creator and created my first console application (left all in default).
When i run the application this is what i get in the application output
#include <QCoreApplication>
#include <QDebug>
#include <QString>
#include <QTextStream>
void doqt(){
QTextStream qin(stdin);
QTextStream qout(stdout);
qout << "Please enter your name: ";
QString name = qin.readLine();
qout << "Hello " << name;
}
int main(int argc, char *argv[]) {
QCoreApplication a(argc, argv);
doqt();
return a.exec();
}
21:41:39: Démarrage de C:\DEV\Qt\coretuto\qt6-e3\qt6-e3\build\DesktopQt672MinGW64bit-Debug\qt6-e3.exe…
Please enter your name: Hello
it seems like the readLine() line is skipped
here is my kit selection window ( I left it in default)
https://preview.redd.it/2a8srbr7oy9d1.png?width=802&format=png&auto=webp&s=3bd7f74f06ee19cf4ae32d4d64d1fe31062db34e
I tried in the C++ way => same result
https://redd.it/1dt26tq
@qt_reddit
Choosing the Right Framework for Cross-Platform Mobile App Development
https://www.quickwayinfosystems.com/blog/cross-platform-mobile-app-development-right-framework/
https://redd.it/1dst54p
@qt_reddit
Couldn't setup GitHub Copilot
Spent 4-5h to something people say very easy, just follow the instructions.
I think I set up correctly, but Qt (12.0.2) couldn't detect agent.js, and I couldn't find either. Sign in button disabled.
Following the QT Creator Documentation:
I set up subscription.
Downloaded and extracted zip for Neovim and clicked the exe file, then closed.
Installed latests Node.js using the msi file.
Neovim powershell command. (For this one I might have accidentally run the first one for Vim, but deleted the folder and run the other one)
Then I run :Copilot setup in neovim and it took me to github and I logged in. Now, when I do :Copilot setup it says logged in as...
Now in Qt, I add node.js box the node.exe file path, and agent.js I couldn't find despite running a whole search in my entire drive.
Would really appreciate it if you could help. 🙏🏻🙏🏻😊
https://redd.it/1ds4hcd
@qt_reddit
Can I Wrap My Qt App with SwiftUI on macOS?
I have a Qt application that I'd like to modernize. I don't want to use the old UI system for my app on macOS. Instead, I want to wrap my Qt app with SwiftUI and Swift code. Is it possible to keep my Qt app as the core and use a Swift app as the wrapper? If so, can you provide some guidance or ideas on how to achieve this?
Any insights or suggestions would be greatly appreciated!
https://redd.it/1dr9veu
@qt_reddit
QFileSystemModel - filter only files, display all dirs
I am working on a widget that should be able to show a directory, and emit a signal when a file has been double clicked. I have also added a filer - to show only files that matches a glob.
My problem: is that I want to show all directories in the view, event those which do not match the filter. The filter should apply only to files. Does anyone know what I am missing?
class FileSystemWidget : public QWidget {
Q_OBJECT
public:
FileSystemWidget(QWidget *parent = nullptr) : QWidget(parent) {
QString homePath = QDir::homePath();
model = new QFileSystemModel(this);
model->setRootPath(homePath);
model->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot);
model->setNameFilterDisables(false);
backButton = new QPushButton(tr("Back"), this);
connect(backButton, &QPushButton::clicked, this, &FileSystemWidget::navigateBack);
homeButton = new QPushButton(tr("Home"), this);
connect(homeButton, &QPushButton::clicked, this, &FileSystemWidget::navigateHome);
upButton = new QPushButton(tr("Up"), this);
connect(upButton, &QPushButton::clicked, this, &FileSystemWidget::navigateUp);
nextButton = new QPushButton(tr("Next"), this);
connect(nextButton, &QPushButton::clicked, this, &FileSystemWidget::navigateNext);
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addWidget(backButton);
buttonLayout->addWidget(nextButton);
buttonLayout->addWidget(upButton);
buttonLayout->addWidget(homeButton);
buttonLayout->addStretch();
treeView = new QTreeView(this);
treeView->setModel(model);
treeView->setRootIndex(model->index(homePath));
treeView->expand(model->index(homePath));
for (int i = 1; i < model->columnCount(); ++i) {
if (i != 1) {
treeView->hideColumn(i);
}
}
treeView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
treeView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
rootPathEdit = new QLineEdit(homePath, this);
QCompleter *completer = new QCompleter(model, this);
completer->setModelSorting(QCompleter::CaseInsensitivelySortedModel);
rootPathEdit->setCompleter(completer);
connect(rootPathEdit, &QLineEdit::returnPressed, this, &FileSystemWidget::onRootPathEdited);
filterEdit = new QLineEdit("*.*", this);
connect(filterEdit, &QLineEdit::returnPressed, this, &FileSystemWidget::onFilterChanged);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addLayout(buttonLayout); // Add the button layout at the top
layout->addWidget(rootPathEdit);
layout->addWidget(treeView);
layout->addWidget(filterEdit);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
setLayout(layout);
setWindowTitle(tr("File System Viewer"));
connect(treeView, &QTreeView::doubleClicked, this, &FileSystemWidget::onItemDoubleClicked);
historyStack.push(homePath);
currentHistoryIndex = 0;
updateButtonStates();
}
signals:
void fileDoubleClicked(const QString &filePath);
private slots:
void onItemDoubleClicked(const QModelIndex &index) {
QFileInfo fileInfo = model->fileInfo(index);
if (fileInfo.isDir()) {
QString path = fileInfo.absoluteFilePath();
navigateTo(path);
} else {
emit fileDoubleClicked(fileInfo.filePath());
}
}
void navigateUp() {
QDir currentDir = QDir::current();
Key Challenges in Developing MCU and MPU Applications Using Qt
can you help me with this ? What are the primary challenges engineers face when developing applications for Microcontroller Units (MCUs) or Microprocessor Units (MPUs) using Qt?
https://redd.it/1dzuau3
@qt_reddit
Need help with how to Access and Update Individual Plots in a pg.GraphicsLayoutWidget?
Hi,
Using pg.GraphicsLayoutWidget(), I constructed an object and added several plots and items (such as an image plot, a colour bar, a left plot, and a bottom plot) to it within this layout. I need to access and update these plots individually from other functions in my code.
Is it possible to access each plot from this layout object? I tried using pg.GraphicsLayoutWidget().getItem(row=0, col=1) but it retuned None.
Any insights or suggestions would be greatly appreciated.
Thank you!
https://redd.it/1dyzsl9
@qt_reddit
basysKom GmbH | Use Compute Shader in Qt Quick
https://www.basyskom.de/2024/use-compute-shader-in-qt-quick/
https://redd.it/1dy3b0a
@qt_reddit
Qt Change/Edit a specific line in a text file
This is the final part of my project, its a game project that keeps records of players names grade level and finally the score. Everything is stored in a single .txt file and I'm able to display every player the only part I'm having issues is with the score portion, I cant get Qt to update the line of text that the player is in.
Scoreboard:
https://preview.redd.it/yrm53qtl95bd1.png?width=1323&format=png&auto=webp&s=bc476761da435301b7377e4b6dea3155e4657c81
Choosing a Player:
https://preview.redd.it/77b76rtl95bd1.png?width=1518&format=png&auto=webp&s=d0fd28e6837daf09470bd85ff9c1dd69f7e30469
Adding new score to player:
https://preview.redd.it/nl3v2vtl95bd1.png?width=1316&format=png&auto=webp&s=b219da4db6c2bd228a7fe32c39c924dc9bab6d2d
https://preview.redd.it/amwxjrtl95bd1.png?width=791&format=png&auto=webp&s=67709dbd363537f6fd729e7d6e5abd804b9b5397
include "race.h"
include "ui_race.h"
include <QDialog>
include <QMainWindow>
include <QDialog>
include <QTextEdit>
include <QPushButton>
include <QFile>
include <QIODevice>
include <QTextStream>
include <QCoreApplication>
Race::Race(QWidget *parent)
: QDialog(parent)
, ui(new Ui::Race)
{
ui->setupUi(this);
QPixmap pix3("C:\\Desktop\\project\\senior\\race.jpeg");
ui->label3->setPixmap(pix3);
ui->setupUi(this);
ui->Player1->setMaxVisibleItems (20);
ui->Player1->setEditable (true);
QFile file("C://Desktop//project//senior//name.txt");
// QString line;
if(file.open (QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream in(&file);
while(!in.atEnd())
{
QString line = in.readLine();
ui->Player1->addItem (line);
}
file.close ();
}
}
Race::~Race()
{
delete ui;
}
void Race::on_pushButton_clicked()
{
QString fname3 = "C://Desktop//project//senior//name.txt";
QFile file3(fname3);
if(file3.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
{
QTextStream stream(&file3);
QString file3 = ui->scoretext->text();
stream << file3;
}
file3.close();
}
https://redd.it/1dxo2te
@qt_reddit
Qt 6.2.9 LTS Opensource released
https://lists.qt-project.org/pipermail/announce/2024-July/000505.html
https://redd.it/1dwcw4d
@qt_reddit
Qt create multiple .txt files
Good evening
Yesterday i had posted a similar situation and got a great idea but my professor insist to do it a new way. So as of now I have a super basic practice GUI interface and I just want it to create new .txt files every time a button is pressed. I have a code in c++:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main ()
{
int n=1,i=1;
std::string name, grade, gpa;
while(n==1)
{
std::cout << "Enter student info : " << std::endl;
std::cout << "Name : ";
std::cin >> name;
std::cout << "Enter grade level : ";
std::cin >> grade;
std::cout << "Enter GPA : ";
std::cin >> gpa;
std::ofstream file("Student" + std::to_string(i) + ".txt");
file << name << std::endl
<< grade << std::endl
<< gpa << std::endl;
cout<<" continue?"<<endl;
cin>>n;
i++;
}
}
Now going into Qt i get an error
https://preview.redd.it/ao2v5f1pmkad1.png?width=1478&format=png&auto=webp&s=ca772e633fd7a2f3912a9c4f885f171ff8017552
Any ideas or input?
https://redd.it/1dvi1wf
@qt_reddit
I can't install QT properly
I've been trying to install QT creator for 3 days now and I always encounter a problem. After not having any kits I reinstalled the app and couldn't use the functions I already imported then I reinstalled QT creator again following the Stanford University's guide on how to install QT and now the projects I create have a yellow "!"(⚠️) on them and no main files. Is there a way to properly install QT creator with no problems? What am I supposed to do?
https://redd.it/1dv28x3
@qt_reddit
Qt Creator 13.0.2: Update .txt file line
Good evening
Im close at the finish line with my project for school just having issues updating lines of text.
So in short my GUI has Inputs that are sent to a notepad text and saved, under this window I have the scroll read every line in the text file and display it. Now I need the GUI to grad that row of text that the user chooses and update the score in the end of the line and update the notepad file.
​
https://preview.redd.it/021ej27i4gad1.png?width=1624&format=png&auto=webp&s=b6f6e46d6057d6daecaf632699d636f4941375fb
I know its weird looking im not finished but at the end of the line it should display the players last score and when we hit save then it should update the new score. I dont have code yet im assuming when we choose the player the line text should be chosen? Im just stressed been up all night doing the entire GUI
https://redd.it/1dv05ty
@qt_reddit
Qt creator 13.0.2 notepad input
Hello Qt gods, hope everything is good
So i was able to record input via notepad but im lost in regards to adding both inputs into one .txt file can anyone please help me?
#include "addplayer.h"
#include "ui_addplayer.h"
#include "mainwindow.h"
MainWindow *ptrmain;
AddPlayer::AddPlayer(QWidget *parent)
: QDialog(parent)
, ui(new Ui::AddPlayer)
{
ui->setupUi(this);
QPixmap pix2("C:/Desktop/senior/add.jpeg");
ui->label->setPixmap(pix2);
}
AddPlayer::~AddPlayer()
{
delete ui;
}
void AddPlayer::on_Returnbutton_clicked()
{
hide();
ptrmain = new MainWindow(this);
ptrmain->show();
}
void AddPlayer::on_Savebutton_clicked()
{
QString fname = "C://Desktop//senior//name.txt";
QFile file(fname);
QString fname2 = "C://Desktop//senior//grade.txt";
QFile file2(fname2);
if(file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
{
QTextStream stream(&file);
QString file = ui->name->text();
stream << file <<"\n";
}
if(file2.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
{
QTextStream stream(&file2);
QString file2 = ui->Grade->text();
stream << file2 <<"\n";
}
file.close();
hide();
ptrmain = new MainWindow(this);
ptrmain->show();
}
https://preview.redd.it/e962px8p71ad1.png?width=1441&format=png&auto=webp&s=9ac764a7c8af2899a4ecceed4957877ee8e809cb
https://preview.redd.it/jlukyy8p71ad1.png?width=1918&format=png&auto=webp&s=0afc34566d00c22b68fe0a603caa04b51fdfe20b
I just need both text files as one so i can have it read it as one solid line
https://redd.it/1dtd2uv
@qt_reddit
Choosing the Right Framework for Cross-Platform Mobile App Development
https://www.quickwayinfosystems.com/blog/cross-platform-mobile-app-development-right-framework/
https://redd.it/1dst57e
@qt_reddit
Remote compiling and debugging with qtcreator?
Hi, I'm developing Qt C++ programs on a 44-core XEON server connected to my HP740 thin client via 1Gb/sec Ethernet LAN wired connection. The HP740 is driving three 4K monitors and is acting as my desktop machine.
I'd like to run the qtcreator GUI on the HP740 machine for editing of the code. But the compilation goes much faster on the XEON server and the code will ultimately be run on the server so I'd like to be able to compile and debug on the XEON server while using the qtcreator GUI interface running on the HP740. Right now, I'm running qtcreator on the server using ssh X11 forwarding but it's not as crisply responsive as I'd like for editing. While VNC is a little more responsive, it's more of a hassle to get a nice display when you want to open several files at once because I like to view each file on each of the three 4K monitors. I'm thinking that my only good option is to upgrade my LAN to 10Gb/sec. Your advice appreciated and thanks.
https://redd.it/1dsako1
@qt_reddit
Qt line and store input
Good afternoon everyone
First off I want to thank those that helped last post, it was very helpful and I want to thank this community for not roasting me when I ask for help.
That being said Im practicing right now for my main project and Im having issues on how I can store user input , I want to go the up most basic way to store and save user input may I have any guidance please? Im good in c but my c++ needs a bit more practice im assuming i need to create strings? Or is there a faster clean way?
https://preview.redd.it/5k2u1z8scl9d1.png?width=1227&format=png&auto=webp&s=52e3dfa95bba064b1f57014c6f06d8a82facf709
https://redd.it/1drnfaq
@qt_reddit
currentDir.cdUp();
QString path = currentDir.absolutePath();
navigateTo(path);
}
void navigateBack() {
if (currentHistoryIndex > 0) {
QString path = historyStack.at(--currentHistoryIndex);
navigateTo(path);
}
}
void navigateNext() {
if (currentHistoryIndex < historyStack.size() - 1) {
QString path = historyStack.at(++currentHistoryIndex);
navigateTo(path);
}
}
void navigateHome() {
QString homePath = QDir::homePath();
navigateTo(homePath);
}
void onRootPathEdited() {
QString path = rootPathEdit->text();
QFileInfo fileInfo(path);
if (fileInfo.isFile()) {
emit fileDoubleClicked(fileInfo.filePath());
} else if (fileInfo.isDir()) {
if (QDir(path).exists()) {
navigateTo(path);
}
}
}
void onFilterChanged() {
QString filterText = filterEdit->text().trimmed();
QStringList filters = filterText.split(QRegularExpression("[,;]"), Qt::SkipEmptyParts);
filters.replaceInStrings(QRegularExpression("^\\s+|\\s+$"), "");
model->setNameFilters(filters);
model->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot);
treeView->setRootIndex(model->index(rootPathEdit->text()));
}
private:
QFileSystemModel *model;
QTreeView *treeView;
QLineEdit *rootPathEdit;
QLineEdit *filterEdit;
QPushButton *backButton;
QPushButton *nextButton;
QPushButton *homeButton;
QStack<QString> historyStack;
int currentHistoryIndex;
void navigateTo(const QString &path) {
treeView->setRootIndex(model->index(path));
rootPathEdit->setText(path);
QDir::setCurrent(path);
if (historyStack.isEmpty() || historyStack.top() != path) {
while (historyStack.size() > currentHistoryIndex + 1) {
historyStack.pop();
}
historyStack.push(path);
currentHistoryIndex = historyStack.size() - 1;
}
updateButtonStates();
}
void updateButtonStates() {
backButton->setEnabled(currentHistoryIndex > 0);
nextButton->setEnabled(currentHistoryIndex < historyStack.size() - 1);
}
};
PS: history forward is not working. Any hints on what I got wrong - will be helpful!
https://redd.it/1dqmpuc
@qt_reddit
List Table style using TableView
Hello,
I'm trying to achieve the List Table Style (from MS Excel table styles or the one below). But I don't know how. The QML TableView (from Qt6.7) doesn't have any row styling or I don't know of it. It only takes a delegate and instantiates it for every column in a row. I don't have a problem with that, I just want each row to have a background like this
Example
using a TableView. This one uses a ListView, but has the resizing problem and is heavy. Now, I've tried using the same background color for each column. But there is a spacing between them, which doesn't go away by setting columnSpacing to 0.
https://redd.it/1dqbthq
@qt_reddit