Main window raise on Dataflow-widget click fixed.

This commit is contained in:
cora48 2015-03-13 17:07:53 +03:00
parent 140abd9027
commit c7a149efeb

View File

@ -1574,12 +1574,14 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
}; };
return false; return false;
} }
else if (obj == ui->widgetIRC) else if (obj == qwm)
{ {
if(MapWidgetOpened) //auto qwe = event->type();
{ if(MapWidgetOpened && event->type() == QEvent::WindowActivate)
qwm->raise(); {
}; //qwm->raise();
this->raise();
};
if (event->type() == QEvent::KeyPress) if (event->type() == QEvent::KeyPress)
{ {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
@ -1598,18 +1600,7 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
return true; return true;
}; };
return false; return false;
} }
// else if (obj == qwm)
// {
// ///TODO: raise parent window with qwm
// if(event->type() == QEvent::MouseButtonPress)
// {
// Qt::WindowFlags eFlags = windowFlags ();
// eFlags |= Qt::WindowStaysOnTopHint;
// setWindowFlags(eFlags);
// return true;
// };
// }
else else
{ {
if (event->type() == QEvent::KeyPress) if (event->type() == QEvent::KeyPress)
@ -1628,7 +1619,11 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
privateMsgFlag = false; privateMsgFlag = false;
event->accept(); event->accept();
return true; return true;
}; }
else if(MapWidgetOpened && event->type() == QEvent::WindowActivate)
{
qwm->raise();
};
return false; return false;
}; };
} }
@ -2057,7 +2052,7 @@ void nesca_3::slotShowDataflow()
{ {
MapWidgetOpened = true; MapWidgetOpened = true;
ui->DataflowModeBut->setStyleSheet("background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(0, 214, 0, 40);color: rgb(0, 214, 0);"); ui->DataflowModeBut->setStyleSheet("background-color: rgba(2, 2, 2, 0);border: 1px solid rgba(0, 214, 0, 40);color: rgb(0, 214, 0);");
qwm = new QWidget(); qwm = new QWidget();
qwm->setWindowFlags(Qt::FramelessWindowHint|Qt::SubWindow); qwm->setWindowFlags(Qt::FramelessWindowHint|Qt::SubWindow);
qwm->installEventFilter(this); qwm->installEventFilter(this);
qwm->setStyleSheet( qwm->setStyleSheet(
@ -3198,7 +3193,7 @@ void CreateVerFile()
}; };
} }
char GetVer() const char *GetVer()
{ {
int dver = 0; int dver = 0;
int tver = 0; int tver = 0;
@ -3241,7 +3236,7 @@ char GetVer()
char db[32] = {0}; char db[32] = {0};
sprintf(db, "%X-%X", dver, tver); sprintf(db, "%X-%X", dver, tver);
return *db; return std::string(db).c_str();
} }
void nesca_3::slotShowRedVersion() void nesca_3::slotShowRedVersion()
@ -3262,9 +3257,8 @@ void _startMsgCheck()
nesca_3::nesca_3(QWidget *parent) : QMainWindow(parent) nesca_3::nesca_3(QWidget *parent) : QMainWindow(parent)
{ {
setWindowFlags ( Qt::FramelessWindowHint ); setWindowFlags ( Qt::FramelessWindowHint );
this->hide();
gthis = this; gthis = this;
ui->setupUi(this); ui->setupUi(this);
ui->widgetIRC->installEventFilter(this); ui->widgetIRC->installEventFilter(this);
ui->shoutBox->installEventFilter(this); ui->shoutBox->installEventFilter(this);
@ -3275,7 +3269,7 @@ void _startMsgCheck()
ui->rVerLabel->hide(); ui->rVerLabel->hide();
setSceneArea(); setSceneArea();
tray = new QSystemTrayIcon(QIcon(":/nesca_3/Z:/nesca.ico"), this); tray = new QSystemTrayIcon(QIcon(":/nesca_3/nesca.ico"), this);
tray->hide(); tray->hide();
SetValidators(); SetValidators();
@ -3286,9 +3280,8 @@ void _startMsgCheck()
ui->ircNickBox->setText("nsa_" + QString::number(qrand() % 8999 + 1000)); ui->ircNickBox->setText("nsa_" + QString::number(qrand() % 8999 + 1000));
const char &rVer = GetVer(); const char *rVer = GetVer();
QString QVER((const char *)rVer); QString QVER(rVer);
QVER += QString(rVer + 1);
strcpy(gVER, QVER.toLatin1().data()); strcpy(gVER, QVER.toLatin1().data());
ui->logoLabel->setToolTip("v3-" + QVER); ui->logoLabel->setToolTip("v3-" + QVER);
ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;"); ui->logoLabel->setStyleSheet("color:white; border: none;background-color:black;");