Сообщение от Код
#ifndef QTPSPX_H
#define QTPSPX_H
#include <QWidget>
#include <QPushButton>
#include <QtWebKit>
class qtpspx : public QWidget {
Q_OBJECT
protected:
QPushButton *fwd, *bwd, *ref, *cabinet, *pm;
QWebView *view;
public:
qtpspx(QWidget *parent = 0, Qt::WFlags flags = 0) {
setFixedSize(1100, 900);
fwd = new QPushButton("<", this);
ref = new QPushButton("Ref", this);
bwd = new QPushButton(">", this);
cabinet = new QPushButton("Cabinet", this);
pm = new QPushButton("Personal messages", this);
fwd->move( 10, 10);
ref->move( 100, 10);
bwd->move( 200, 10);
cabinet->move(10, 50);
pm->move(100, 50);
view = new QWebView(this);
view->setGeometry(0, 100, 1100, 800);
view->load(QUrl("http://pspx.ru/forum/"));
view->show();
QWidget::connect(fwd, SIGNAL(clicked()), this, SLOT(cmd_fwd()));
QWidget::connect(bwd, SIGNAL(clicked()), this, SLOT(cmd_bwd()));
QWidget::connect(ref, SIGNAL(clicked()), this, SLOT(cmd_ref()));
QWidget::connect(cabinet, SIGNAL(clicked()), this, SLOT(cmd_cabinet()));
QWidget::connect(pm, SIGNAL(clicked()), this, SLOT(cmd_pm()));
}
~qtpspx() {};
public slots:
void cmd_fwd() { view->back(); }
void cmd_bwd() { view->forward(); }
void cmd_ref() { view->reload(); }
void cmd_cabinet() { view->load(QUrl("https://www.pspx.ru/forum/usercp.php")); }
void cmd_pm() { view->load(QUrl("https://www.pspx.ru/forum/private.php")); }
};
#endif // QTPSPX_H
|