|
|
|
@ -28,12 +28,12 @@ MainWindow::~MainWindow()
|
|
|
|
void MainWindow::SetUserInfo(UserInfo user)
|
|
|
|
void MainWindow::SetUserInfo(UserInfo user)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_UserInfo = user;
|
|
|
|
m_UserInfo = user;
|
|
|
|
ui->trends->SetUserInfo(user);
|
|
|
|
ui->trendsPage->SetUserInfo(user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::LoadTrendsData()
|
|
|
|
void MainWindow::LoadTrendsData()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ui->trends->LoadTrendsData();
|
|
|
|
ui->trendsPage->LoadTrendsData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::Init()
|
|
|
|
void MainWindow::Init()
|
|
|
|
@ -71,7 +71,7 @@ void MainWindow::Init()
|
|
|
|
connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick()));
|
|
|
|
connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ui->btnMain->click();
|
|
|
|
ui->tradeRecordBtn->click();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::InitStyle()
|
|
|
|
void MainWindow::InitStyle()
|
|
|
|
@ -141,15 +141,15 @@ void MainWindow::getQssColor(const QString &qss, const QString &flag, QString &c
|
|
|
|
//qDebug() << TIMEMS << flag << color;
|
|
|
|
//qDebug() << TIMEMS << flag << color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
|
|
|
//bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
if (watched == ui->widgetTitle) {
|
|
|
|
// if (watched == ui->widgetTitle) {
|
|
|
|
if (event->type() == QEvent::MouseButtonDblClick) {
|
|
|
|
// if (event->type() == QEvent::MouseButtonDblClick) {
|
|
|
|
on_btnMenu_Max_clicked();
|
|
|
|
// on_btnMenu_Max_clicked();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return QWidget::eventFilter(watched, event);
|
|
|
|
// return QWidget::eventFilter(watched, event);
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::getQssColor(const QString &qss, QString &textColor, QString &panelColor,
|
|
|
|
void MainWindow::getQssColor(const QString &qss, QString &textColor, QString &panelColor,
|
|
|
|
QString &borderColor, QString &normalColorStart, QString &normalColorEnd,
|
|
|
|
QString &borderColor, QString &normalColorStart, QString &normalColorEnd,
|
|
|
|
@ -168,22 +168,27 @@ void MainWindow::getQssColor(const QString &qss, QString &textColor, QString &pa
|
|
|
|
void MainWindow::buttonClick()
|
|
|
|
void MainWindow::buttonClick()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QAbstractButton *b = (QAbstractButton *)sender();
|
|
|
|
QAbstractButton *b = (QAbstractButton *)sender();
|
|
|
|
QString name = b->text();
|
|
|
|
QString name = b->objectName();
|
|
|
|
|
|
|
|
|
|
|
|
QList<QAbstractButton *> tbtns = ui->widgetTop->findChildren<QAbstractButton *>();
|
|
|
|
QList<QAbstractButton *> tbtns = ui->widgetTop->findChildren<QAbstractButton *>();
|
|
|
|
foreach (QAbstractButton *btn, tbtns) {
|
|
|
|
foreach (QAbstractButton *btn, tbtns) {
|
|
|
|
btn->setChecked(btn == b);
|
|
|
|
btn->setChecked(btn == b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (name == "交易记录") {
|
|
|
|
if (name == "tradeRecordBtn")
|
|
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
|
|
{
|
|
|
|
} else if (name == "动量趋势") {
|
|
|
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
|
|
|
|
} else if (name == "ddd") {
|
|
|
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
|
|
} else if (name == "vvv") {
|
|
|
|
} else if (name == "trendsBtn")
|
|
|
|
|
|
|
|
{
|
|
|
|
ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
} else if (name == "aaa") {
|
|
|
|
} else if (name == "limitBtn")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(2);
|
|
|
|
|
|
|
|
} else if (name == "newRecordBtn")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(3);
|
|
|
|
|
|
|
|
} else if (name == "logouBtn")
|
|
|
|
|
|
|
|
{
|
|
|
|
exit(0);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -214,3 +219,40 @@ void MainWindow::on_btnMenu_Close_clicked()
|
|
|
|
close();
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QWidget *w = (QWidget *)watched;
|
|
|
|
|
|
|
|
if(w->property("form") != "title")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return QObject::eventFilter(watched, event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!w->property("canMove").toBool())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return QObject::eventFilter(watched, event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static QPoint mousePoint;
|
|
|
|
|
|
|
|
static bool mousePressed = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
|
|
|
|
|
|
|
if (mouseEvent->type() == QEvent::MouseButtonPress) {
|
|
|
|
|
|
|
|
if (mouseEvent->button() == Qt::LeftButton) {
|
|
|
|
|
|
|
|
mousePressed = true;
|
|
|
|
|
|
|
|
mousePoint = mouseEvent->globalPos() - this->pos();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (mouseEvent->type() == QEvent::MouseButtonRelease) {
|
|
|
|
|
|
|
|
mousePressed = false;
|
|
|
|
|
|
|
|
} else if (mouseEvent->type() == QEvent::MouseMove) {
|
|
|
|
|
|
|
|
if (mousePressed) {
|
|
|
|
|
|
|
|
this->move(mouseEvent->globalPos() - mousePoint);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (event->type() == QEvent::MouseButtonDblClick) {
|
|
|
|
|
|
|
|
on_btnMenu_Max_clicked();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return QObject::eventFilter(watched, event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|