L
L
Loligan2015-06-07 23:13:45
Qt
Loligan, 2015-06-07 23:13:45

A couple of questions about the Qt GUI?

How can I make it so that when I right-click on the Item-a line in the ListWidget, I can select an action i.e. do something like this:
00bddb0f2cd24289b5a5460b3ae7c601.png
And how do I set that when closing the window (pressing the cross in the window) I performed some function before it closes, for example, saving data to a file

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Taratin, 2015-06-08
@Taraflex

I performed some function before it closes, for example, saving data to a file

doc.crossplatform.ru/qt/4.6.x/eventsandfilters.html

A
Antony, 2015-06-08
@RiseOfDeath

For the first case - it's called "context menu" - google how it's done in Qt.
For the second case, as Alexander Taratin already answered , there are events.

E
EXL, 2015-06-08
@EXL

How can I make it so that when I right-click on the Item-a line in the ListWidget, I can select an action i.e. do something like this:

This can be done with a context menu that is invoked and the concept of signals/slots.
By overloading the closeEvent() method .
I suggest you look at this small example and understand it:
Example source code: dropmefiles.com/wRUFj
Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question