mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 05:15:33 +00:00
29 lines
No EOL
677 B
C++
29 lines
No EOL
677 B
C++
|
|
#include "pushbutton.hpp"
|
|
|
|
#include <QMouseEvent>
|
|
#include <QKeyEvent>
|
|
|
|
void CSVWidget::PushButton::keyPressEvent (QKeyEvent *event)
|
|
{
|
|
if (event->key()!=Qt::Key_Shift)
|
|
mKeepOpen = false;
|
|
|
|
QPushButton::keyPressEvent (event);
|
|
}
|
|
|
|
void CSVWidget::PushButton::mouseReleaseEvent (QMouseEvent *event)
|
|
{
|
|
mKeepOpen = event->button()==Qt::LeftButton && (event->modifiers() & Qt::ShiftModifier);
|
|
QPushButton::mouseReleaseEvent (event);
|
|
}
|
|
|
|
CSVWidget::PushButton::PushButton (const QIcon& icon, const QString& text, QWidget *parent)
|
|
: QPushButton (icon, text, parent), mKeepOpen (false)
|
|
{
|
|
}
|
|
|
|
bool CSVWidget::PushButton::hasKeepOpen() const
|
|
{
|
|
return mKeepOpen;
|
|
} |