c++ - Does each QT widget have a 'show' signal? -
i wanted action when dialog shows when opens or when maximizes minimal status or moves out of screen.
does qt have such signal? not sure find if qt has list of signals defined.
does each qt widget have 'show' signal?
if @ qt source code find qwidget::show slot:
public q_slots: // widget management functions virtual void setvisible(bool visible); void sethidden(bool hidden); void show();
the slot us, programmers make able connect signals specific purposes clicking button created widget. windows or mac os, have app serving events coming system via event loop. , qwidget reacts on 'signals' in form of system events coming , yes, may, execute show()
or showmaximized()
or showminimized
slots then.
but can assume want overload
virtual void showevent(qshowevent *); virtual void hideevent(qhideevent *);
like:
void mywidget::showevent(qshowevent *e) { if (ismaximized()) { if (e->spontaneous()) { // author know // if event issued system } ; // action maximized } else { ; // action normal show } } void mywidget::hideevent(qhideevent *) { if (isminimized()) { ; // action minimized } else { ; // action hide } }
for recognizing cases when system operates widget can use qevent::spontaneous().
please refer show , hide event doc pages: http://doc.qt.io/qt-5/qshowevent-members.html http://doc.qt.io/qt-5/qhideevent.html
Comments
Post a Comment