Electrical Engineer project
Good evening
Please forgive my question if its too dumb but today was my first time using Qt. So in my cause I have to design a GUI using Qt for a project and Im already using Qt creator ->Desktop Qt 6.7.2MinG but working in my project i realized that the project needs sensors and I have to read them. I might need a pi but my question is am I going to need a new project using Boot2Qt 6.7.2 Raspberry Pi? Or can I program the Pi via Desktop settings?
https://redd.it/1dopkjb
@qt_reddit
Software Engineer Internship at QT
I've applied for an internship position at QT and have an upcoming interview with a Talent Acquisition Specialist and one of the hiring managers. The interview will be a 30-minute call on Teams. If anyone has experience with an interview for this or a similar position, could you share how the interview went and, if possible, what technical questions were asked?
https://redd.it/1dnzj9c
@qt_reddit
QtCreator Is there a way to filter out symbols marked with attribute((visibility("hidden"))) from autosuggestion/completion?
I've tried placing a .clangd file with these options in the project root
Index:
ExcludeVisibility: hidden
ExcludeSymbols:
- 'attribute((visibility("hidden")))'
but it's not working.
The class methods marked as hidden aren't being linked correctly, which is how it should work, but it's kind of annoying how they still show up in autocompletion.
Edit: Forgot to mention that this is only about public methods, private ones don't show up.
https://redd.it/1dmq5cz
@qt_reddit
How to use chrome extensions in QtWebEngine?
Title is the question. any hack or trick to bypass this limitation ?
https://redd.it/1dl4jrb
@qt_reddit
Making a super simple UI for my pyqt app - recommendations to make this UI look better?
This isn't a technical question, more of a UI one. I'm just thinking about what the best way is to lay out these strings (which point to filepaths). Any general advice on making this UI look better would be great. I'm a civil engineer, so hardly the sort to have an eye for what a good looking app looks like...
​
https://preview.redd.it/m2d80riqjt7d1.png?width=755&format=png&auto=webp&s=297b72f12a89e3e3b42cfbee1283a7889c534bbf
https://redd.it/1dkqv8f
@qt_reddit
Qt 6.7.2 Released
https://www.qt.io/blog/qt-6.7.2-released
https://redd.it/1djg81u
@qt_reddit
Can't get Qmenus to look good
Hey all, new to PySide6.
Cant figure out why menus and Qmenus are almost black by default, with a white shadow..? the shadow is lighter than the default colors for other widgets?
It looks horrible.
There is not a single native app in windows that sets the menus to black because you're using a dark theme and then gives them a white shadow... so I don't understand why pyside6 would by default do this.
And when I try to set a stylesheet it introduces a new problem.... with a grey corner for some reason.
How do you guys go about getting a decent looking window with menus?
Because it seems like relying on pyside6 to provide decent a looking interface by default isn't a thing.
I just want native looking menus for windows11 dark theme?
Menu black by default with a white shadow. DUMB
Trying to set a stylesheet.. same problem.. white shadow. DUMB
Setting fusion style, can't have rounded corners? DUMB
Setting a stylesheet causes random white grey corner. DUMB
Native windows menu, not dumb like pyside6's dumb menus
https://redd.it/1dijo15
@qt_reddit
How to call a CPP function from compiled WASM's JS files?
I have compiled a c++ QT program with a simple add function and have recieved 4 files
app.html, qtloader.js, app.js and app.wasm
I took those files to VS code to load with Liveserver and was able to do it sucessfully, but when I tried to access the "add" function I was unable to. I tried the ways in which I was able to do it with "Non Qt" Cpp cose but failed.
I have used extern keyword for the function.
Is there some specific way to call such functions from qtloader.js or app.js?
I tried to google but didnt find a solution, any sources to look for?
https://redd.it/1dhgc11
@qt_reddit
Eclipse CDT IDE for KDE development tutorial
https://www.youtube.com/watch?v=_5bxCQdngaM
https://redd.it/1dh5yjs
@qt_reddit
Do you guys use different editor for coding and use qt for designing?
I'm a newbie to QT and for coding the editor seems so off to me because of lack of features, shortcuts etc. Which one is the best practice? Should I keep using QT editor for coding or set things up for coding on vscode?
https://redd.it/1dga7cx
@qt_reddit
PSA: Qt3D / QML for Qt6 is still broken for Ubuntu 24.04
https://bugs.launchpad.net/ubuntu/+source/qt3d-opensource-src/+bug/2069171
https://redd.it/1dfunyq
@qt_reddit
Sculpting QGraphicsPathItems?
Hey all. I have this tool which allows me to "sculpt" QGraphicsPathItems with the mouse. It works amazing, but with a serious flaw. Whenever I move the path item to a different position, I can only sculpt it from the original position. For example, If i move path A from point C to point B, I can only sculpt the path from point C. Any help is greatly appreciated, and heres the code:
self.sculpting_item = None
self.sculpting_item_point_index = -1
self.sculpting_item_offset = QPointF()
self.sculpt_shape = QGraphicsEllipseItem(0, 0, 100, 100)
self.sculpt_shape.setZValue(10000)
self.sculpting_initial_path = None
self.sculpt_radius = 100
def mousePressEvent(self, event):
pos = self.mapToScene(event.pos())
item, point_index, offset = self.find_closest_point(pos)
if item is not None:
self.sculpting_item = item
self.sculpting_item_point_index = point_index
self.sculpting_item_offset = offset
self.sculpting_initial_path = item.path()
self.canvas.addItem(self.sculpt_shape)
def mouseMoveEvent(self, event):
if self.sculpting_item is not None and self.sculpting_item_point_index != -1:
pos = self.mapToScene(event.pos()) - self.sculpting_item_offset
self.update_path_point(self.sculpting_item, self.sculpting_item_point_index, pos)
self.sculpt_shape.setPos(self.mapToScene(event.pos()) - self.sculpt_shape.boundingRect().center())
def mouseReleaseEvent(self, event):
if self.sculpting_item is not None:
new_path = self.sculpting_item.path()
if new_path != self.sculpting_initial_path:
command = EditPathCommand(self.sculpting_item, self.sculpting_initial_path, new_path)
self.canvas.addCommand(command)
self.sculpting_item = None
self.sculpting_item_point_index = -1
self.sculpting_initial_path = None
self.canvas.removeItem(self.sculpt_shape)
def find_closest_point(self, pos):
min_dist = float('inf')
closest_item = None
closest_point_index = -1
closest_offset = QPointF()
for item in self.scene().items():
if isinstance(item, CustomPathItem):
path = item.path()
for i in range(path.elementCount()):
point = path.elementAt(i)
point_pos = QPointF(point.x, point.y)
dist = (point_pos - pos).manhattanLength()
if dist < min_dist and dist < self.sculpt_radius: # threshold for selection
min_dist = dist
closest_item = item
closest_point_index = i
closest_offset = pos - point_pos
return closest_item, closest_point_index, closest_offset
def update_path_point(self, item, index, new_pos):
path = item.path()
elements = [path.elementAt(i) for i in range(path.elementCount())]
if index < 1 or index + 2 >= len(elements):
return # Ensure we have enough points for cubicTo
old_pos = QPointF(elements[index].x, elements[index].y)
delta_pos = new_pos - old_pos
# Define a function to calculate influence based on distance
def calculate_influence(dist, radius):
return math.exp(-(dist**2) / (2 * (radius / 2.0)**2))
# Adjust all points within the radius
for i in range(len(elements)):
point = elements[i]
point_pos = QPointF(point.x, point.y)
dist = (point_pos - old_pos).manhattanLength()
if dist <= self.sculpt_radius:
influence = calculate_influence(dist, self.sculpt_radius)
elements[i].x += delta_pos.x() * influence
elements[i].y += delta_pos.y() * influence
# Recreate the path
new_path = QPainterPath()
new_path.moveTo(elements[0].x,
qlistwidget.clear() needs arguments but i dont know what to put
ive tried everything for self and i dont know what other arguments it wants me to give
class ListBox(QListWidget):
def init(self, parent=None):
super().init(parent)
for file in os.listdir('C:\\Users\\User\\Music'):
if file.endswith(".mp3"):
file=file.replace(".mp3","")
self.addItem(file)
self.browser = QLineEdit(self)
self.browser.resize(300,25)
self.browser.move(25,70)
self.browser.textChanged.connect(self.search)
def search(self):
text=str(self.browser.text())
filtereditems=ListBox.findItems(self.ListView,text,Qt.MatchContains)
QListWidget.clear(self=ListBox)
for i in filtereditems:
item=QListWidgetItem.text(i)
print(item)
# ListBox.addItem(item)
https://redd.it/1dfmpjt
@qt_reddit
Qt or not ?!
I am interning for one of the top telecommunication company, and I am a second year software engineering student. I have good experience with QT/QML and c++.
Now, the story is, I saw my manager and team was doing manual works in the spreadsheet, and I made a proposal to make an application for all the task management and operational work to automate the process. Our team of almost 50 people, inside 4000+ people company wants a browser system for their task management.
I can build it in QT and can host with wasm as well, or I can learn python and start doing Django for 1 month and start with it.
If you were in my position what would you have done, please suggest some ideas.
Big fan of QT from day 1.
https://redd.it/1dddo1r
@qt_reddit
Alaternatives for Matlab App Designer
We use Matlab Apps for calibration and quality testing of a product in our company. This tests require to capture images, processing those images, write results in excel and read input from excel as well.
We are looking for alternatives, as with Matlab it is very painfull to do this things in a reliable way (a lot of errors interacting with excel, for example).
Is QT for Python a good alternative? The important stuff is interacting with cameras and excel (in a reliable way, no errors all day like matlab), and image processing.
Thank you all!
https://redd.it/1dd8ask
@qt_reddit
QtTest vs Google Test… which wins for Qt UIs?
I’ve been using QtTest for 8 years, writing tests for C++ and QML components and (mostly) love the test runner built into Qt Creator.
There’s a push at the office to only do Google Tests.
I don’t do Google Test (yet). Does anyone have experience with testing Qt UIs with GT and QtTest and have an opinion on strengths and weaknesses?
https://redd.it/1dohwzu
@qt_reddit
Replacing requests, Session and HttpDigestAuth with Qt
Basically the title. I'm struggling to implement a connection to an ABB IRC5 controller using ABB Robot Web Services v1.
The example uses the python requests module which I need to replace with corresponding Qt classes.
I know Qt, but never had to deal with http/websockets and struggle with the documentation of QAuthenticator class in PySide6.
In pseudo-code:
- perform a post-request on a specified url, retrieve 401 error code
- perform http-digest with username/password and retrieve a cookie and http-ok response.
-subscribe to a websocket
As far as I understand I need a QNetworkAccessManager together with a QAuthenticator. But how to I use the setOptions() method to enable HttpDigest?
And how to extract the cookie from a response (once this would work) ?
https://redd.it/1dngql3
@qt_reddit
Need Help with two reporting functions
Sup folks. I startet to code a mobile App with arc gis App Studio. Im almost done but i need help with two reporting functions. They dont work and im sitting like 5 days on it and cant fix it. Anyone wants to help me? Gonna pay 100 Europs through paypal
https://redd.it/1dmjr7i
@qt_reddit
About designing Qt apps
Hello,
I am a designer interested in designing Qt applications, especially for touch screens. I mainly use Figma and I saw that there is a free trial version for the Qt designer framework. The site requires some data in order to download the installer - but what worries me is that the trial only lasts 10 days which is a short time to be able to evaluate such a framework, especially if the time I dedicate to this exploration is not constant. Also I don't want to mess my linux setup installing trial software but I can use distrobox for this.
What approach do you recommend before proceeding with the trial? Also, is there an open design base system for designing Qt apps in particular with basic KDE themes (e.g. breeze)?
Thanks!
https://redd.it/1dkfb6e
@qt_reddit
New challenge: A blank mainwindow app gives error when openning in debug mode
It is a HP Victus 16 sxxxx series notebook,
Fresh installed Qt having 6.2 and 6.7, with C++17
Created new C++ desktop gui app with qmainwindow
No any classes added or any modification applied, just blank app created by using qt's New Project -> blah blah.
When runs it using release it is ok, a blank form appears.
When runs it using debug it errors at the step in the screenshot :
(tested with qmaike and cmake as well)
Should be system compatibability problem.. Anyone came accross and solved?
access violation at "m\_direct3D9 = direct3DCreate9(D3D\_SDK\_VERSION);"
*^(QDirect3D9Handle::QDirect3D9Handle() :)*
*^(m\_d3d9lib(QStringLiteral("d3d9")))*
*^({)*
*^(using PtrDirect3DCreate9 = IDirect3D9 \*(WINAPI \*)(UINT);)*
*^(if (m\_d3d9lib.load()) {)*
*^(if (auto direct3DCreate9 = (PtrDirect3DCreate9)m\_d3d9lib.resolve("Direct3DCreate9")))*
*^(m\_direct3D9 = direct3DCreate9(D3D\_SDK\_VERSION); // #define D3D\_SDK\_VERSION 32)*
*^(})*
*^(})*
https://preview.redd.it/335uax7bwi7d1.png?width=1319&format=png&auto=webp&s=9599c3e7709b3450d526dbabc30fd5a87b776c3a
https://redd.it/1dji6w6
@qt_reddit
Can't remove corner from menu
https://preview.redd.it/5fu4wn0iz97d1.png?width=834&format=png&auto=webp&s=5fa5f5fd1974a5373b1b9e87ad3126720b5e10b5
Can't figure out how to remove the corner from the menu
https://preview.redd.it/f55r6o6lz97d1.png?width=535&format=png&auto=webp&s=0840698811c54a50f66c2a8e784576573db92293
https://redd.it/1dik3pw
@qt_reddit
Using QT's native gRPC support in 6.8
https://lastviking.eu/fun_with_gRPC_and_C++/qt_client.html
https://redd.it/1di06uv
@qt_reddit
Floating Main Menu
Hi guys
I have this idea of a floating Menu instead of the fixed Menubar on top. User should be able to drag it over the screen where he needs it...
Does anybody have seen something like this already ?
Rgds
https://redd.it/1dhbvqh
@qt_reddit
QtDesigner
Hi I am new to qt, I learned basic stuff like signals actions some qt classes, but I don't get qt designer especially layouts, so any material recommendations or advices to learn it?
https://redd.it/1dgl50e
@qt_reddit
elements[0].y)
i = 1
while i < len(elements):
if i + 2 < len(elements):
new_path.cubicTo(elements[i].x, elements[i].y,
elements[i + 1].x, elements[i + 1].y,
elements[i + 2].x, elements[i + 2].y)
i += 3
else:
new_path.lineTo(elements[i].x, elements[i].y)
i += 1
item.setPath(new_path)
item.smooth = False
https://redd.it/1dfryeg
@qt_reddit
How do i make list widget find item return text instead of object
im trying to make it to where when i call finditems on qlistwidget it will return only text in the list widget and not these weird objects i cant use.
class ListBox(QListWidget):
def init(self, parent=None):
super().init(parent)
for file in os.listdir('C:\\Users\\User\\Music'):
if file.endswith(".mp3"):
file=file.replace(".mp3","")
self.addItem(file)class ListBox(QListWidget):
def init(self, parent=None):
super().init(parent)
for file in os.listdir('C:\\Users\\User\\Music'):
if file.endswith(".mp3"):
file=file.replace(".mp3","")
self.addItem(file)
self.browser = QLineEdit(self)
self.browser.resize(300,25)
self.browser.move(25,70)
self.browser.textChanged.connect(self.search)
def search(self):
text=str(self.browser.text())
filtereditems=ListBox.findItems(self.ListView,text,Qt.MatchContains)
print(filtereditems)
https://redd.it/1dfm2w6
@qt_reddit
Reading and opening files for android QT 6.7
I'm currently working on making a windows c++ program run on android. I've made it so it can save files correctly now, but the program isn't able to open or read content uris once I save and if I try to open a file. I'm wondering about the proper way to go about doing this, as I've noticed a lot of methods are outdated with new QT versions, and I've been going in circles and dead ends with my methods.
Do I need a runtime permission manager? Or is changing the AndroidManifest.xml enough?
Are java and jni classes necessary? Or is there another way to get this done?
Any methods or help would be greatly appreciated. Thank you
https://redd.it/1ddoii9
@qt_reddit
Reading the current active palette from QML
Hi,
I've been trying to make my application work with all possible themes comes by default with Qt (Both material and universial theme). So far I can set QT_QUICK_CONTROLS_STYLE=Universal QT_QUICK_CONTROLS_MATERIAL_THEME=Dark
to make default components appear in dark mode. But my custom components uses SystemPalette
to read the system colors. But that doesn't seem to be affected by the enviroment variables.
Is there a way to get the current theme colors?
To illustrate the issue:
SystemPalette {
id: palette
colorGroup: SystemPalette.Active
}
Rectangle {
width: 30
height: 30
color: palette.base // still my system's default color
}
how do i call a ui function using a variable from a function?
don't know a better way to say this but it would be like
QString getText(??? widget)
{
return ui->widget->text();
}
https://redd.it/1dbj3p7
@qt_reddit