Stack Overflow » Qt
18 FOLLOWERS
Qt is a cross-platform application development framework widely used for the development of application software that can be run on various software and hardware platforms with little or no change in the underlying codebase while having the power and speed of native applications. In this category of Stack Overflow, find detailed answers for all your questions related to the Qt software.
Stack Overflow » Qt
5h ago
I get an error when creating a query to the database, this is not my first query in the code, but it gives an error and I do not know what to do with it, if I create this query in the database itself, then there is no error, this is what the error looks like:
"QODBCResult::exec: Unable to execute statement:" Error: "[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2."
here is the code:
QSqlQuery queryRequest(db);
queryRequest.prepare("INSERT INTO ЗаявкаНаРемонт (id_клиента, Дата, Оборудование, Тип_неисправности, Описание_проблемы, Статус_ ..read more
Stack Overflow » Qt
8h ago
I'm developing a program using Qt/C++ in Windows.
I had created two subclasses that inherit from QWidge. The windows based on these two classes were created respectively, one of which is a child window of the other. Subsequently, I placed a QLabel in the child window.
Surprisingly, the child window background was transparent.
When I set a style sheet for the parent window, the style sheet works normally. But when I set a style sheet for the sub-window, the style sheet does not work on the sub-window itself, but on the label inside it.
Just like this: the stylesheet for the sub-window doesn't w ..read more
Stack Overflow » Qt
10h ago
I created a custom model for QTreeView. The complete minimal code to show the problem is below. If I add a new node to the root node, by clicking "Add Level 1", it shows up. But if I add a new node to the second level by clicking "Add Level 2", it does not show up. That node only shows up if I collapse the parent node and then expand it again. What part of my MyTreeModel is wrong?
I am adding the QT tag, even though my code is PySide6, because the fault is probably in my understanding of the methods of QAbstractItemModel, which is not something specific to Python or to PySide.
Full Code
from ..read more
Stack Overflow » Qt
12h ago
I want to transfer data from a Qt application in one PC, to the Qt application integrated in the flashed yocto linux image in the SD card in the BeagleBone Black board via RS485. This Qt application will be launched on booting the BBB. I understand that there are multiple UARTs available for BBB. I want to know if all of these pins for UART are already enabled or not. If not, how to enable those pins for doing serial communication. I found this BB-UART4-00A0.dtbo file in the boot partition of my SD card.
/dts-v1/;
// magic: 0xd00dfeed
// totalsize: 0x3f9 (1017)
// off_dt_struct ..read more
Stack Overflow » Qt
13h ago
The minimal example code below renders the following GUI:
What I would like to achieve, instead, is this (manually edited image):
... which is to say, I would like the column (horizontal) headings to have two lines of text, centered: the top line of text in bigger font size, and the bottom one in smaller font size and bold font.
I originally hoped that I could just use HTML and QCSS styling for this, but
https://forum.qt.io/topic/30598/solved-how-to-display-subscript-text-in-header-of-qtableview
this is not supported by Qt, you would need to implement a QStyledItemDelegate and set it to y ..read more
Stack Overflow » Qt
14h ago
I am building a Google Test project in Qt Creator using CMake. The library is located in C:/cpplibraries/googletest-1.13.0.
This is the auto-generated CMakeLists.txt file for the project:
cmake_minimum_required(VERSION 3.5)
project(testProj LANGUAGES CXX)
enable_testing()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if ($ENV{GOOGLETEST_DIR})
get_filename_component(_GTEST_BASE $ENV{GOOGLETEST_DIR} REALPATH)
elseif (EXISTS "C:/cpplibraries/googletest-1.13.0") # set by QC
get_filename_component(_GTEST_BASE "C:/cpplibraries/googletest-1.13.0" REALPATH) # set by QC
en ..read more
Stack Overflow » Qt
14h ago
Hello I'm using QML View3D and PhysicsWorld to model dices. For my task I need ability to set custom background image for modelled "world". The image should be ~4K resolution, as far as rendered image will be displayed on 4K screen.
For the moment I use following solution:
View3D{
...
Model{
Node{
z: -80
Rectangle{
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
id: rectBG
width: testBG.width
height: testBG.height
I ..read more
Stack Overflow » Qt
17h ago
I am not able to use MSVC COMPILER in qt i am also getting CMake kit configuration issue so i have separately installed CMake and added the path in qt which is CMake-D i have installed visual studio 2019 i am not able still use MSVC Compiler.I have attached snaps Am i missing any step.MSVC issue
CMake path
Kit config CMake errors ..read more
Stack Overflow » Qt
19h ago
I create a InnerShadow effect using Qt Quick Effect Maker, preview seems to be working fine.
but when I am trying to implement this effect into my QML application it is not being reflected there.
I exported this effect with both options Qt 6 Compatibility and Qt Latest but it is still not working.
I am using:
PySide6
Qt 6.5.3
Qt Creator 10.0.2
Here is the simple page I am trying to build.
import QtQuick
import QtQuick.Window
import QtQuick.Effects
import "widgets"
import "effects/InnerShadow"
Window {
width: 640
height: 480
visible: true
color: "#ffffff"
Rectangle ..read more
Stack Overflow » Qt
20h ago
I have a QOpenglWidget and a customized QOffscreenSurface,then I set Qt::AA_ShareOpenGLContexts attribute to QCoreApplication,here is my code:
void main(){
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QApplication a(argc, argv);
MainWindow w;
w.show();
}
mainwindow has a subclass of QOpenglWidget TextureWidget and a subclass of QOffscreenSurface OffscreenRender, I want to share buffer objects and texture objects between these two class.
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
center = new QSplitter();
center->resize(800,4 ..read more