Questions tagged [qt]

23847 questions
1

votes
2

answer
64

Views

Printing to an element of MainWindow from an outside class

I have created a set of watcher/helper classes that monitor an outside application, and I would like these to print to a log window inside my MainWindow's ui when changes are made. My idea was to create this watcher inside a thread in main, but I am not sure the best way to link it to my MainWindow....
c0nn
1

votes
3

answer
2.7k

Views

Qt: Ambiguous shortcut issue

I've implemented a dialog with two customized text-editor inside(Two editor objects with same class) This custom widget is an inherited class from QWidget and it has two widgets inside, one is a actions-tool-bar and second is a QTextEdit. I set some shortcuts to this custom widget for some actions l...
Mostafa
1

votes
1

answer
1.3k

Views

QTableView editing mode

When editing a cell of QTableView it opens empty entry. I have seen some tables that inserts the previous text in new opened entry and selects it when editing the cell, but cant find its implementation. Is there standard option for QTableview or it should be achieved manually.
Ashot
1

votes
1

answer
3.3k

Views

How to generate a Visual Studio project file when I build my qmake project?

I like to do most development using Qt Creator, and the builds are driven with qmake and jom. I occasionally want to use Visual Studio for debugging. I'd like to know what magic to put into the .pro file to automatically generate a Visual Studio project file during the project build, every time the...
Kuba Ober
1

votes
1

answer
534

Views

How to detect a QGraphicsItem moving performing by mouse?

I have a child class of QGraphicsItem with Selectable and Movable flags. When I select many items and moving them, all recieves itemChange event. Is there any way to detect in itemChanged that mouse's button is still pressed?
Vladimir
0

votes
0

answer
26

Views

Segmentation Fault - QVector<QPair<double,double>>::apend()

Usecase : I am working on a Qt application (Qt5.12.0) to process every frame buffer of a video file, get some data from a 3rd party API for every frame and display them on the UI along with the frame. The UI is designed using QML, and for processing every frame I am using QVideoFilterRunnable::run()...
Rahul Chowdhury
1

votes
1

answer
967

Views

Qt is successfully creating a file but not writing to it with QTextStream

Hey I'm trying to mess around with Qt and for some reason the following code will create the desired text file, but never writes anything to it. Am I doing something wrong? I believe I've copied the example in the documentation pretty accurately. qDebug()
druckermanly
1

votes
3

answer
1.3k

Views

shared library in Qt Creator with mingw gives undefined reference error

Resolved. When I add my library as a normal internal library everything is fine. What I had failed to do was use the MY_LIBRARY_EXPORT macro on some free functions defined in a namespace. Somehow I had manipulated the library import in such a way to get those functions working, but it broke in ot...
onezeno
1

votes
2

answer
1.8k

Views

QListWidget causes crash when clear() is called while items are selected

My application crashes, when I try to clear() all items from a QListWidget and at least one item is selected. Calling clearSelection() first causes the program to crash, too (at the clearSelection() call). Removing the items in a while loop, leads also to a crash. The error-message is ASSERT: "!isE...
Simon Oelmann
1

votes
1

answer
1.4k

Views

link to libpq failed with unresolved symbol _PQconnectdb

I use Qt5, msvc2010, windows7 64bit. I want to test if i can link libpq.lib. http://www.postgresql.org/docs/9.2/static/libpq-example.html I build the above example in QtCreator. And get error LNK2019: unresolved external symbol _PQconnectdb in function "_main" I check my libpq.lib use dumpbin libp...
Aylwyn Lake
1

votes
1

answer
72

Views

Ending a thread properly in QT [closed]

How do I ensure that my thread is deleted in QT after I run it. I have tried to connect the finished signal with a delete slot I created but it is not working.
Alkorizm
1

votes
1

answer
2k

Views

Paste in the field of QTableView

I need to implement a function in python which handles the "paste" when "ctrl+v" is pressed. I have a QTableView, i need to copy a field of the table and paste it to another field of the table. I have tried the following code, but the problem is that i don't know how to read the copied item (from th...
Orcl User
1

votes
1

answer
1.8k

Views

How to force QActionGroup to allow uncheck?

I have a number of actions put together in a QActionGroup, because I want them to be exclusive (if one is checked, all the others should be unchecked). However, I also want to be able to uncheck all of them. At the moment if I check action1, and then click the button again, it will not uncheck, the...
1

votes
2

answer
987

Views

How to make app looks nice in Qt?

I want to know is it possible to make application fully skinned/styled in Qt I mean by that not only controls inside the application window but the mainwindow itself! like close button/maximize button/minimize button and the bar, and the mainwindow border!, is it possible to do that in Qt? and how t...
1

votes
2

answer
4.6k

Views

Qt is not available error while compiling a wireshark plugin

I am trying to built a wireshark plugin code on my RHEL5 Virtual machine and while I am trying to compile it, I am getting the below error. On ./configure command , below is the error message I receive and the make file is not being generated. checking for Qt5Core - version >= 4.6.0... no checking f...
Sindhu
1

votes
1

answer
671

Views

JSON classes in Qt vs other JSON parsers in C++

I'm developing a server/client application in C++ and im using Qt as my IDE as well as some of its libraries. Performance-wise i was told that one of the best ways to transfer data between a server and client was via JSON. However i would like to know the performance differences between the default...
TheDillo
0

votes
0

answer
5

Views

error in qml type converting while qml styling

first , I found two post and want to try their skinnable idea as follows : Dynamically change QML theme at runtime Qt 5 Styling: dynamically load qml files I almost copied their code , but failed and errors occurs: while code running , it reports error showing "Unable to assign AbstractStyle_QMLTYPE...
Peng.Song
1

votes
2

answer
7.7k

Views

QT QMainWindow fullscreen without borders

How to do a fullscreen without borders using QMainWindow ? I got a fullscreen including window borders all around the screen. I would like to have a "real" fullscreen like video games. Not a windowed fullscreen. I tried: MainWindow mainWindow; mainWindow.setWindowState(Qt::WindowFullScreen); mainWin...
Erwan Douaille
1

votes
1

answer
8.4k

Views

PyQt: get the current QTreeWidget item

I presently have a QTreeWidget named 'treeWidget', and for the life of me, cannot figure out how to get the index value or the text of the selected treeWidget branch. self.treeWidget looks like: User -Inbox -Sent -Drafts -Trash I need to know which branch is selected so I can display folders in the...
Ang
1

votes
1

answer
547

Views

Set the orientation of an ellipse in Qt

I am drawing an ellipse using QPainterPath using three mouse clicks. The major and minor axis of the ellipse remain parallel to the principal coordinate axis. The first click determines the center of the ellipse. The second click's position is used to compute length of major axis and that of third c...
Kamalpreet Grewal
1

votes
2

answer
2.8k

Views

QML TableView + QAbstractTableModel - how edit model data from QML?

I have C++ class inherited from QAbstractTableModel with next functions overriden: virtual QHash roleNames() const noexcept override; virtual Qt::ItemFlags flags(const QModelIndex& index) const noexcept override; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const noexcept override...
Anton
1

votes
1

answer
458

Views

Qt output pdf is empty

I used the most simplistic code I could find on Qt pdf printing, and it works fine without any errors. However when I attempt to open the produced pdf it complains that the pdf is empty and cant be opened. I have no clue as to what aspect of the code is wrong OR possibly outdated ? I though it might...
MrSSS16
1

votes
1

answer
1.1k

Views

Remove text from qt progress bar

How can I remove the text (i.e. 24%) from the progress bar? I only want to show a plain progress bar without any text. Is that possible?
gartenriese
0

votes
1

answer
20

Views

OpenGL is leaking memory. Which object is not being released?

I'm having problems with my OpenGL rendering. The RAM memory grows absurdly up to the point the entire system freezes. I've identified that if I comment the entire render function, no memory grows at all. Therefore the problem is that my OpenGL render function might be allocating memory for somethin...
Lucas Zanella
0

votes
1

answer
19

Views

Adding Qt to a C-Socket program?

I am working on a simple socket application written in C, which allows two members to communicate over the internet using basic command line prompt. I would like to add a proper GUI to it, just to use a decent UI and not basic standard input/output. Right now I am developing with Cygwin to use POSIX...
ilmu011
1

votes
1

answer
747

Views

close button on qDialog only closing on second click

I'm trying to generate a dialog that contains an ad-on tool that is separate from my main program, it its triggered from an action within the menus. I've got the following code: void MainWindow::on_actionCalibration_Tool_triggered() { QGridLayout *grid = new QGridLayout; NewDialog.setLayout(grid); N...
Mitchell D
0

votes
1

answer
22

Views

How I can close dialog, from another thread? Qt

I want to handle my button in this way: Change text on label (somethink like "Please wait...") Download some data from database When downloading is done, close dialog where is this button. When I do this: void LoadingDialog::on_pushButton_clicked() { m_ui->labelStatus->setText("Pobieranie wysyłek.....
krecha07
1

votes
1

answer
812

Views

LNK2001: Unresolved external symbol when using qwt plot in Qt creator

I am subclassing QwtPlot. I have the following error: moc_myplot.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" ([email protected]@@[email protected]@B) I have tried to the following things: run qmake, rebuild, clean, delet...
lnk
1

votes
3

answer
1.1k

Views

Convert std::vector<uint8_t> to QImage

I am trying to create QImage from std::vector. I tried; void FaceCutThread::convertImage(std::vector &buf) { QImage img(&buf[0], 300, 300, QImage::Format_ARGB32); emit isFinisedFaceCut(img); } and void FaceCutThread::convertImage(std::vector &buf) { QImage img(buf.data(), 300, 300, QImage::Format_...
goGud
1

votes
2

answer
1.5k

Views

QT - force an object to process incoming signals

I am wondering how to tell a QObject to process all signals and call the slots associated with them. Here's the concrete problem I am having, for a better description of the question: My program consists of three Qthreads : Main, Communication and Input. The communication thread handles communicatio...
user129186
1

votes
1

answer
1.7k

Views

QCustomPlot: How to set percent on the y-axis? How to change tick label alignment?

I am playing around with the QCustomPlot libary for Qt. I created some plots succesfully. But I got still questions: 1: How can I set my y-axis range from 0% to 100%? 2: My tick labels are centered below the ticks. How can I change that to a left alignment? Thanks for your help. Peter // generate so...
Peter Panne
1

votes
1

answer
2.5k

Views

How to add icons to QMenu in Qt Creator?

I have several *.png icon files like new.png, open.png etc. I added these icons to my main menu in the QtCreator as following: Click on corresponding QAction in desgin mode In that actions property window --> QAction --> icon --> Select file... Select e.g. new.png Enter Now, I can see that icon nex...
Ralf Wickum
0

votes
0

answer
6

Views

Qt Installer Framework how remove title when custom page?

I used QtIFW to make the installation package. Now I want to replace the original installation interface with a custom interface, but I haven't found how to remove the title and the button below.Can someone help me? enter image description here
thiser
1

votes
0

answer
14

Views

How to dynamically change the number of columns while resizing a QTableView?

Is it possible to change the number of columns in a QTableView when user dynamically resize the QTableView? For example I have 9 images of number 1-9, I have a QTableView with custom delegate that paint the image into the cell of the table, I would like the QTableView to behave like the way in follo...
Komgcn
1

votes
2

answer
2k

Views

Qt microseconds timer implementation

In Qt all the Classes are having Milliseconds timer . I need to implement Microsecond timer using hardware timer or any Qt classes will not support for Microsecond timer. Any one please help me how to implement microsecond timer in Qt application code?
ralagappan
1

votes
1

answer
2k

Views

How to calculate Frames per second in Qt Graphics Application

I have an Qt based OpenGLES2.0 application, where I want to capture the FPS. my application draw same geometry for 16 times and then try to know the FPS. How can I make sure glDrawElements() has finished its job ? I want to get the correct FPS. Is there any way to make the glDrawElements()synchronou...
user279505
1

votes
1

answer
341

Views

QML - How to retrieve info from a text edit inside a list view

im a beginner with using Qt and QML and I cant seem to find an answer to my problem. Currently in my program, I have a window that prompts the user with 6 unknowns. In the end, after the user clicks a next button, I want to save what the user put in 6 text edits as integer variables and use them to...
Illiyan
1

votes
1

answer
476

Views

Is this an appropriate time to use QThread with QProcess?

I'm making a render job manager for blender. I have a class that builds up a queue of render jobs and then you click Start and it begins rendering one at a time with a loop. My problem is that the waitForFinished() method holds up my entire program. But I've read that you shouldn't use QThread with...
1

votes
3

answer
1.1k

Views

Non-modal QWidget dialog that stays on top of the window

I want a dialog which stays on top of my main window and not other windows. I derived a class and added some flags. If I call the dialog now with show() the dialog appears and is staying on top as long as I don't press a button or whatever. Then the dialog goes to background again. Dial::Dial(QWidg...
dgrat
3

votes
0

answer
49

Views

Qt EventFilter - Once Event consumed by event filter, control never returns back to MouseArea

I am trying to filter out touch events from multiple touch points. So have installed an EventFilter that react and consumes events with multiple touch points else to return false. When I ran the sample qml, the mouse click initially works with single touch on window and I do multiple touch on the wi...
Keen Learner

View additional questions