1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/qqtwebkittest/qqtwindow.cpp

54 lines
1.1 KiB
C++
Raw Normal View History

2017-09-05 18:07:05 +08:00
#include "qqtwindow.h"
#include "ui_qqtwindow.h"
2018-04-22 16:17:15 +08:00
#include "qqtobjectmanager.h"
2017-10-22 12:21:19 +08:00
#include "qqt-qt.h"
2017-09-05 18:07:05 +08:00
#include "qqtcore.h"
#include "qqtwidgets.h"
#include "QtWebKit/QWebView"
#include <QFile>
2017-11-27 20:15:23 +08:00
QQTWindow::QQTWindow ( QWidget* parent ) :
QStackedWidget ( parent ),
ui ( new Ui::QQTWindow )
2017-09-05 18:07:05 +08:00
{
2017-11-27 20:15:23 +08:00
ui->setupUi ( this );
2017-09-05 18:07:05 +08:00
QQtObjectManager::registerObject ( this );
2017-09-05 18:07:05 +08:00
#ifdef __EMBEDDED_LINUX__
2017-09-05 18:07:05 +08:00
/*
* frameless足够
*/
2017-11-27 20:15:23 +08:00
setWindowFlags ( Qt::FramelessWindowHint );
2017-09-05 18:07:05 +08:00
/*
*
*/
2017-11-27 20:15:23 +08:00
setAttribute ( Qt::WA_TranslucentBackground, true );
2017-09-05 18:07:05 +08:00
#endif
//setFixedSize(1024, 600);
2017-11-27 20:15:23 +08:00
moveCenter ( this );
2017-09-05 18:07:05 +08:00
2017-11-27 20:15:23 +08:00
connect ( ui->lineEdit, SIGNAL ( btnClicked() ),
this, SLOT ( brow() ) );
2017-09-05 18:07:05 +08:00
2017-11-27 20:15:23 +08:00
connect ( ui->textEdit, SIGNAL ( textChanged() ),
this, SLOT ( refresh() ) );
2017-09-05 18:07:05 +08:00
2017-11-27 20:15:23 +08:00
ui->textEdit->setMinimumWidth ( 500 );
2017-09-05 18:07:05 +08:00
}
QQTWindow::~QQTWindow()
{
delete ui;
}
void QQTWindow::brow()
{
2017-11-27 20:15:23 +08:00
ui->widget->load ( QUrl ( ui->lineEdit->text() ) );
2017-09-05 18:07:05 +08:00
}
void QQTWindow::refresh()
{
2017-11-27 20:15:23 +08:00
ui->widget_2->setHtml ( ui->textEdit->toPlainText() );
2017-09-05 18:07:05 +08:00
}