Main window raise on Dataflow-widget click fixed.

This commit is contained in:
cora48 2015-03-13 17:07:53 +03:00
parent ebf61f1568
commit 633a081c28

View File

@ -1574,11 +1574,13 @@ 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)
{ {
@ -1599,17 +1601,6 @@ bool nesca_3::eventFilter(QObject* obj, QEvent *event)
}; };
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,6 +1619,10 @@ 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;
}; };
@ -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,7 +3257,6 @@ 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);
@ -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;");