Relative Content

Tag Archive for c++qt

QIcon::setFallbackSearchPaths not working

I am trying to deploy a Qt6 application, which bundles its own icons (this way on Windows/OSX I get consistent icons). As part of my build I deploy into $BIN/share/icons the content of the breeze icons (I have a CMake function that does this for me).

Custom Qt combobox entries are shifted down when item is preselected

I am working on a custom combobox with remove buttons for each entry. I have left the buttons and code which is not relevant to the problem out. After creating the combobox I want to preselect an entry in mainwindow.cpp. If I choose an index smaller than 10 everything is OK. For index values greater than 10 entry labels are shifted down depending on the actual index value, while tooltips are shown correctly. All this happens on Windows with Qt 5.15.2. I also tested with Qt 6.6.3 there is no problem. I think this is a Qt bug, but please point out if I am doing something incorrectly. I am also interested if I can get rid of the problem with Qt 5.15.2.

How to add/change QStackedLayout without changing current layout?

I am making a Sudoku app, and I am trying to show text boxes (line edit) on top of sudoku grid. To do this, I have a 2-page stackedWidget, one with the grid and one with the text boxes. Everything is already organized in the event of a window resize, and now whenever I try to add the QStackedLayout (to enable ShowAll), it changes the window layout entirely.

Establishing ssh connection using QProcess in Qt-creator

I am trying to create an application that connects to my raspberry pi via ssh and lists the stuff in it’s home directory. The problem is that it says “process not started” and I don’t understand why the process won’t start.

QT Creator design tab is greyed out

I don’t know if this is the expected behavior. I created a new QT Quick application project. It shows up a main.qml and main.cpp file. The problem is the design tab is greyed out.

How to know a value of offset in QPlainTextEdit

In QPlainTextEdit first typed symbol is drawn with a small offset, literally there a few pixels. But how to know the value of this offset in the code? Look at the screenshot, distance between red line and selected character is what I need to know.