Questions tagged [qt]

32676 questions
1

votes
1

answer
57

Views

QDateEdit - paint cell of calendarPopup

I create custom form and user interface components with Qt Designer and use Qt's integrated build tool uic, to generate code for them when the application is built. The generated code contains the form's user interface object. I have QDockWidget with QDateEdit, I want to paint cells of some date: I...
ncica
1

votes
3

answer
121

Views

Qt3d. Draw transparent QSphereMesh over triangles

I have a function that draws triangles through OpenGL I draw two triangles by pressing a button (function on_drawMapPushButton_clicked()). Then i draw a sphere that placed above these triangles. And now i see, that sphere is drawed correctly over first triangle, but second triangle drawed over the...
Ligvest O
1

votes
1

answer
54

Views

QML Animation to transition color from bottom to top

I have a login QML page. When the user inputs the code, I have 4 circles in white, and I would like to transition to blue, filling the circle from bottom to top. So basically, I want to animate the color property so it transitions from white to blue when 'isNumberInserted' is true, and just move it...
laurapons
1

votes
2

answer
50

Views

Problem with linking C library to Qt project

I know this is a 100times discussed topic, but after number of attempts, I just can't find the solution since don't understand the situation - no errors. I am trying to connect dll 'C' library to my project and receiving some crazy code in App output '...exited with code -1073741515' as well as empt...
Alexander Lyapin
1

votes
2

answer
58

Views

How to use JavaScript libraries on QML

I use some javascript libraries with QML on 5.12.2. Some of them works like Proj4JS. But I get errors when using geographiclib.js library with QML. How can the JavaScript library be imported into QML? main.qml: import QtQuick 2.12 import QtQuick.Window 2.12 import 'geographiclib.js' as MyGeo Window...
Edip Ahmet
1

votes
1

answer
30

Views

Error: Unknown method parameter type: QString&

On C++ side, I had this method: class MyClass : public QObject { Q_OBJECT Q_INVOKABLE QVariant getFamily_byParentName(QString &parentName) const; // ... } I was calling the C++ method on QML: onButtonClicked: { myClass.getFamily_byParentName(items3D.model[0]) // items3D.model[0] is a string } The ab...
user3405291
1

votes
1

answer
31

Views

Collection of QObjects like ListModel

I want to create a list of ShortcutItems as a QObject and add ShortcutItems into that. For example, I have this: #include class ShortcutItem : public QObject { Q_OBJECT Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) Q_PROPERTY(QString action READ action WRITE setAction NOTI...
MoreMag
1

votes
1

answer
35

Views

QTreeWidgetItem with two parents

Can I somehow attach one QTreeWidgetItem to two (or more) nodes at once? Just like this: parent1 └child1 parent2 └child1 If I just do addChild() on both parents, the child appears only on the first parent. Is that even possible? Or such result can be achieved only by completely copying of descen...
garbart
1

votes
2

answer
33

Views

openGL - failed to display an images

Learning to display images using QOpenGLWidget. However, I've met some problems. How can I pass the GLuint texture variable (the actual texture loaded from the image) into the shader scripts? Like how to bind GLuint texture to uniform sampler2D texture? Maybe I am just not realising I already did th...
Jinx
1

votes
1

answer
32

Views

Trouble with live communication with QProcess and VS C++

I'm trying to establish a live communication between a QT program and a VS C++ program. However, I can read anything unless I close the writechannel in which I can't write anything anymore. Furthermore, the code I have now reads a continuous stream of output when I write one line to the VS C++ progr...
chteng2002
1

votes
1

answer
12

Views

QAbstractTableModel editing without clearing previous data in cell

I have created a model based off of QAbstractTableModel that allows the user to edit data in that model. The model is displayed in a QTableView in a QMainWindow. So far in my model I am able to make the cells editable, and save whatever the user types in after editing is finished. The issue is that...
DaveK
1

votes
1

answer
35

Views

How to change property of QML item from c++

I am writing a small QT(5.12) application in C++, which will be moving center of QMap every second. I am trying to update the coordinates so the center will refresh, but after debugging it, it's always staying the same (original value). That's my first attempt with QML, so I am helping myself with t...
tomazj
0

votes
0

answer
3

Views

how to access Qt MainWindow members

In my project, there are a number of class files including mainwindow.h. In the mainwindow.h, there is a variable QImage qimge that I want to call in other class files, e.g., subClass1.h. To my knowledge, one way is to create a signal-slot connection between the mainwindow and other classes. Withou...
jingweimo
0

votes
0

answer
3

Views

Stl_relops not found using qt-creator on linux mint

I'm trying to use qt-creator on linux but when my application is build, an error message says that usr/include/c++/7/bits/stl_relops was not found but I have it on /usr/include/c++/7/bits/stl_relops. I've edited my application.pro and included INCLUDEPATH += /usr/include/c++/7/bits/stl_relops but ev...
Felipe Paz
1

votes
0

answer
12

Views

Cannot open include file

I have installed Qt 5.12.3 and Vulkan SDK and VULKAN_SDK environment variable set.Then I tried to build the vulkan examples in Qt\Examples\Qt-5.12.3\vulkan\hellovulkancubes, and the Qt compiler gave me the following information: 'D:\Qt 5.12.3\msvc2017_64\include\QtGui/qvulkaninstance.h(55): fatal...
AH_HUANG
1

votes
0

answer
8

Views

DCMTK library with qt in mac

i have installed DCMTK through brew and i have configured it on qt adding the path directed to the library. When i try to open a DICOM image and run the project, i have these 2 errors: Undefined symbols for architecture x86_64: 'DicomImage::DicomImage(char const*, unsigned long, unsigned long, unsi...
Melinda Bechini
1

votes
2

answer
78

Views

the matter of signal and slot of this program(Qt)?

I wanna link two pages that when the program runs and welcome page is shown after clicking 'ok' next page comes. here is my code but I don't know why it give error!!!!what is the problem? welcome.h: #ifndef WIDGET_H #define WIDGET_H #include #include #include class welcome : public QWidget { Q_OB...
Mojtaba Ahmadi
1

votes
2

answer
11.2k

Views

Set date at QDateEdit with C++

I have this QDateEdit widget but it displays always a standard time like 01-01-2014 (in DD-MM-YYYY, but I can change this in the UI). But I want it to display the current time if the dialog (where this QDateEdit widget is) is opened. I tested this just on a label (see the void form_dialog). But its...
SjonTeflon
1

votes
2

answer
2.5k

Views

QTreeWidget - width of column with widget

I have QTreeWidget with two columns. The first column is the text, and the second is QPushButton. I can not specify the size of buttons and the size of the second column. When you try to set the size of the column of content, the second column disappears. How to change the width of the second column...
Vika
1

votes
2

answer
6.2k

Views

QObject::setParent: Cannot set parent, new parent is in a different thread

Greeting I have a following class. class MyClass : public QObject { Q_OBJECT public: Q_INVOKABLE QVariant status(); public: MyClass(ClassX * classX); public slots: void slotA(); void slotB(); signals: void signalA(); void signalB(); private: void init(); void doSomething(); private: ClassX * classX;...
M.H.
1

votes
1

answer
669

Views

QPainter composition not working as expected with background

I'm trying to draw two rectangles with same color and transparency on a QFrame with a white background. These rectangles should overlap and the their transparency should not change (also in the overlapping region). So like this: Here is the code I have so far: class Canvas : public QFrame { public:...
Frank
1

votes
2

answer
450

Views

QTableView not updating properly

I am creating a small program that takes user input into a model and then shows that input in several views that take it through filters. When the user clicks the button that accepts the input, the program updates the amount of cells in the views and then resizes those cells as necessary so that the...
user2962533
1

votes
1

answer
1.7k

Views

How to draw with QPainter on a specific widget from a group of widgets in QMainWindow?

This is my code: #include 'mainwindow.h' #include #include #include #include #include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { m_QPushButton_calibration = new QPushButton('Calibrate', this); connect(m_QPushButton_calibration, SIGNAL (released()),this, SLOT (handleButton()...
Aquarius_Girl
0

votes
0

answer
14

Views

Qt: Weird Behaviour when removing outline from QTableView

I'm trying to remove the dotted outline, when an item in a QTableView is focused. I found in other answers, that outline: 0 will remove it, but i for me, that is only working in weird cases: It works with this (but then also the background has a different color, what u dont want): tableView->setSty...
knoxfighter
1

votes
1

answer
2.6k

Views

How to connect Python and QML with PySide2?

I want to write a simple desktop application on Ubuntu and I thought that an easy way was to use Qt with QML as GUI and Python as the language for the logic, since I am somewhat familiar with Python. Now I am trying for hours to somehow connect the GUI and the logic, but it is not working. I manage...
Fabian
1

votes
2

answer
488

Views

Timers cannot be stopped from another thread Qt

I am working on Qt application. There I am using two threads, one for the GUI and one for do the processing. I have worker class which has QTimer as member class. .h file: #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include class Worker : public QObject { Q_OBJECT public: Worker(...
RuLoViC
1

votes
1

answer
35

Views

How to create a button in editing field of ComboBox?

The requirement is when we type something in ComboBox, an X button appears on the right side of this field (to remove what we have typed). How can I do this? The result with setClearButtonEnabled
trangan
1

votes
2

answer
62

Views

Program Crash on C++ regarding checking if data exists

What I do here is convert my input name to char then check from the text file if char a which is the input name exists or equal to existing nameData. nameData is the variable stored in the text file. But my program crashed once it detects that the input is new. What may seemed the problem in this pr...
Rin_asdfghjkl
1

votes
2

answer
79

Views

Qt QDateTime from string with timezone and daylight saving

i am inserting time from string QDateTime time =QDateTime::fromString('Wed Mar 26 22:37:40 2019 GMT-08'); qDebug()
Awais Rafique
1

votes
0

answer
11

Views

TableView does not load the QSqlQueryModel into it

I'm using a tableView to display some information from a table in my database via a QSqlQueryModel. It connects it creates the actual table, it creates the rows and collumns and labels them accordingly, when i use model->rowCount(); in qDebugg() it shows me the proper number of rows, same for column...
Rares Andrei
1

votes
1

answer
37

Views

QML Popup: know how it was closed

I've a QML Popup that I can close by clicking outside of it or by pressing escape (hence default closing policy is fine). However, I need to do different things if the popup is closed with escape (cancel a few things) or by clicking outside (commit the changes). I can't use Dialog, we don't want exp...
Davidbrcz
1

votes
1

answer
38

Views

Slot doesnt exist in connect function in C++/Qt project? (already reran make)

I am adding a slider bar to easyPaint, which will enable a zoom function. I have the slider appearing where I want it on the screen, and the function I built for it shouldn't have any issues, but when I run it, I get a runtime error that the slot doesn't exist, when it clearly does. I have already t...
Chris
1

votes
2

answer
76

Views

Qt signal-slot duplication code avoidance

I would like to share signals and possibly slot implementations among different classes, but it seems Qt does not allow this. Basically I would like to have something like: class CommonSignals { signals: void mysignal(); }; class A : public QObject, public CommonSignals { Q_OBJECT public: void doS...
Saturnu
1

votes
1

answer
4.9k

Views

How to check whether value in QTable widget changed

HI, I have some data there in my tablewidget and it is editable. My intention is to take data from edited row and column. IS it possible. Is it possible to check the edited row and column. Any specific signal is there?
Sijith
1

votes
2

answer
2.2k

Views

Qt - How to open a website in a particular browser

I am coding one project, which needs to launch some webbrowsers with the given url. I saw some QT examples, but they explained how to launch the default browser, not a particular browser. Any helping suggestions will be appreciated. Edit1: Below is the code I use currently QString temp='C:/Program F...
prabhakaran
1

votes
2

answer
3.4k

Views

Changing from stylesheet to default style

I need to change between two styles in my app: custom, stylesheet and default one. I tried to change it by: qApp->setStyle(new QCleanlooksStyle); but it doesn't change the colors, images, etc.
user988311
1

votes
1

answer
878

Views

QAbstractTableModel data return html code to display

I want my AbstracttableModel subclass data() method to return html i.e. PreTextTextPostText And this text must be displayed int table as in html: PreTextTextPostText How can I do this?
zabulus
1

votes
0

answer
336

Views

AMD GPU not recognised with OpenCL - Ubuntu

I'm trying to recognize my AMD FirePro W5100 GPU with OpenCl on Ubuntu 16.04. I'm using: AMD APP SDK 3.0 https://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/ GPU latest driver for Ubuntu 16.04 http://support.amd.com/en-us/download/workstation?os=Linux%20x86_64#pro-driver Running cl...
Izzy88
1

votes
0

answer
75

Views

PyQt4 not found, despite file existing on the backend folder.

I am trying to run a code to get an interactive GUI. However, I get the following error while trying to use %matplotlib qt: So, I tried using %matplotlib qt5 and the problem still persists. I've checked the backends folder. I seem to have both backend_qt4agg and backend_qt5agg. I am using Conda 4....
hegdep
1

votes
0

answer
151

Views

Dynamically add PropertyChanges to a State in QML

Is it possible to extend or dynamically add property changes to a qml state? For example Item { id: myItem; state: 'opened'; states: [ State { name: 'opened'; PropertyChanges { target: myItem; height: 100; } }, State { name: 'closed'; PropertyChanges { target: myItem; height: 10; } } ] } but later I...
Brian

View additional questions