Hi ,
I am looking how I could use a QShortcut to make my main QWidget appear and disappear. I tried this but it only hide the widget I can't show() it again by the same shortcut:
void ULmain::upShwHide()
{
if(m_visible)
{
//this->QWidget::hide();
setVisible(true);
m_visible = false;
}
else
{
//this->QWidget::show();
setVisible(true);
m_visible = true;
}
}
void ULmain::upShwHide()
{
if(m_visible)
{
//this->QWidget::hide();
setVisible(true);
m_visible = false;
}
else
{
//this->QWidget::show();
setVisible(true);
m_visible = true;
}
}
To copy to clipboard, switch view to plain text mode
I declared in my class constructor:
QShortcut * shwHide = new QShortcut(QKeySequence("Ctrl+Space"), this);
To copy to clipboard, switch view to plain text mode
and connect:
QObject::connect(shwHide,
SIGNAL(activated
()),
this,
SLOT(upShwHide
()));
QObject::connect(shwHide, SIGNAL(activated()), this, SLOT(upShwHide()));
To copy to clipboard, switch view to plain text mode
I thought about a systemtray application but it doesn't seems to work.
Bookmarks