#ifndef MYBR_H#define MYBR_H#include <QtGui/QMainWindow>#include "ui_mybr.h"#include "QLineEdit"#include "QPushButton"#include "QProgressBar"#include "QLabel.h"#include <QStatusBar>#include "RizekFoundationClasses/RizekLineEdit/RizekLineEdit.h"class MyBr : public QMainWindow, public Ui::MyBrClass{ Q_OBJECTpublic: MyBr(QWidget *parent = 0, Qt::WFlags flags = 0); ~MyBr();public slots: void load(); void setTitle(bool);signals: void FormResize();protected: void resizeEvent( QResizeEvent* );public: RizekLineEdit * Address; QPushButton * PrevButton; QPushButton * Refresh; QPushButton * NextButton; QPushButton * Go; QPushButton * StopButton; QLabel * StatusBarMainLabel; QProgressBar * Progress; QPixmap * BackMainToolBarImage;};#endif // MYBR_H
MyBr::MyBr(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags){ setupUi(this); this->setWindowTitle("Web-Rizek 2.0"); PrevButton = new QPushButton; PrevButton->setText("<-"); PrevButton->setFixedWidth(30); PrevButton->setToolTip(tr("Go back")); Refresh = new QPushButton; Refresh->setText("(%)"); Refresh->setFixedWidth(30); Refresh->setToolTip(tr("Refresh")); NextButton = new QPushButton; NextButton->setText("->"); NextButton->setFixedWidth(30); NextButton->setToolTip(tr("Go next")); Address = new RizekLineEdit; Address->setFixedWidth(400); Address->setToolTip(tr("Adress of your site")); Go = new QPushButton; Go->setText(tr("Go!")); Go->setFixedWidth(35); Go->setToolTip(tr("Go")); StopButton = new QPushButton; StopButton->setText("X"); StopButton->setFixedWidth(30); StopButton->setToolTip(tr("Stop")); StatusBarMainLabel = new QLabel; StatusBarMainLabel->setText("dfgfdg"); statusBar()->addWidget(StatusBarMainLabel); Progress= new QProgressBar; Progress->setValue(0); Progress->setTextVisible(false); this->setStyleSheet("QToolBar {background-image: url(:/picture/maintoolbar.png) ;}"); this->setStyleSheet("QProgressBar { border: 2px solid grey; border-radius: 5px; background-color: #05B8CC; width: 20px;}" "QProgressBar::chunk { background-color: #CD96CD; width: 10px; margin: 0.5px;}"); //******************* mainToolBar->addWidget(PrevButton); mainToolBar->addWidget(Refresh); mainToolBar->addWidget(NextButton); mainToolBar->addWidget(StopButton); mainToolBar->addWidget(Address); mainToolBar->addWidget(Go); mainToolBar->addWidget(Progress); //******************* //========================== connect(PrevButton, SIGNAL(clicked()), webView , SLOT(back())); connect(NextButton, SIGNAL( clicked()), webView , SLOT(forward())); connect(Refresh , SIGNAL(clicked()), webView, SLOT(Refresh())); connect(StopButton, SIGNAL(clicked()), webView, SLOT(stop())); connect(Go , SIGNAL(clicked()), this , SLOT(load())); connect(webView, SIGNAL(loadProgress(int)), Progress , SLOT(setValue(int))); connect(webView , SIGNAL(loadFinished(bool)), this, SLOT(setTitle(bool))); //========================== }