Relative Content

Tag Archive for c++qt

QHBoxLayout not showing all the widgets

I´ m trying to code a simple chess stopwatch in Qt (2 buttons with a stopwatch on each, pressing one button activate the stopwatch of the other). I´ m using QHBoxLayout in order to have the 2 grouped together, this are the files so far

Qt HoverEnter event only works when the widget is clicked

I am trying to change the icon of a QPushButton at the hover event.
The issue is Qt HoverEnter event only works when the widget is clicked.
This code work with my config : https://gist.github.com/peteristhegreat/d6564cd0992351f98aa94f869be36f77
(from How do I implement QHoverEvent in Qt?)
So I don’t get why it doesn’t work in my case, maybe I’m missing a event propagation flag between my QGraphicsScene and my QPushButton.
It is confusing because I already succesfully made a code to handle QEvent::HoverEnter but for a scrollarea.

How to draw on an image using QImage?

I need to paint staright lines on a image in a widget in .ui file, but when i click it disappers. If you need more info, i can provide you with that. Could you help with that, please? Here is the code on pastebin: [Google Disk] https://drive.google.com/file/d/1RexMW3MkNvvNDZzE0qdA5EM2v6bAHepO/view?usp=sharing

Qt gif is not valid

I created a .gif file https://drive.google.com/file/d/18wHorsxHpfXZc2xm-iEuMG4McsOT-f85/view?usp=sharing

Why did I fail to compress files using the library?

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.Thanks in advance.I am using miniz library, want to compress several files into a compression package, but has been prompted file compression failure, do not know whether my parameter Settings are wrong, the following is my code

QT calls getOpenFileName but the operating system error occurs?

currently I use QT .I call QFileDialog::getOpenFileName,but I can’t get the path of file.after I try to change the code to GB2312 buf I still cant get Chinese Path;And every call the function the out window show a lot of Garbled.Here is the code and picture