Коммит cb1d1f92 создал по автору Леляев Петр Алексеевич's avatar Леляев Петр Алексеевич
Просмотр файлов

Кнопки нормального вида

владелец ffb628b9
......@@ -5,6 +5,7 @@
#include <QWebEngineView>
#include <QMenu>
#include <QFile>
#include <QTimer>
#include <QMenuBar>
#include <QStyle>
......@@ -51,6 +52,11 @@ MainWindow::MainWindow(QWidget *parent)
file.close();
connect(ui->webEngineView, &QWebEngineView::loadFinished, this, &MainWindow::finishLoading);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(MainWindow::rotateImages()));
timer->setInterval(100);
timer->start(); // Не повторяется :(
// connect(ui->webEngineView, &QWebEngineView::loadFinished, this, &MainWindow::adjustTitle);
// connect(ui->webEngineView, &QWebEngineView::urlChanged, this, &MainWindow::adjustTitle);
}
......@@ -95,12 +101,10 @@ void MainWindow::finishLoading(bool)
void MainWindow::rotateImages()
{
QString code;
// code = QStringLiteral("qt.jQuery('ActionsMenuAction__title').each( function () { console.log(($this).html()); } )");
// code = QStringLiteral("qt.jQuery('ActionsMenuAction__title').each( function () { qt.jQuery(this).css('color', 'red') } )");
code = QStringLiteral("qt.jQuery('.ActionsMenuAction--secondary').each( function () { qt.jQuery(this).css('background-color', 'yellow') } )");
ui->webEngineView->page()->runJavaScript(code);
code = QStringLiteral("qt.jQuery('.ActionsMenuAction--danger').each( function () { qt.jQuery(this).css('background-color', 'yellow') } )");
code = QStringLiteral("qt.jQuery('.ActionsMenuAction--secondary, .ActionsMenuAction--danger').each( function () { qt.jQuery(this).css('background-color', 'yellow') } ); ");
code += QStringLiteral("qt.jQuery('.ActionsMenuAction--secondary, .ActionsMenuAction--danger').closest('button').each( function () { qt.jQuery(this).css('width', '300'); qt.jQuery(this).css('height', '50')} ); ");
ui->webEngineView->page()->runJavaScript(code);
qWarning("Rotate images!");
}
void MainWindow::adjustTitle()
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать