diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-02-10 17:08:51 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-02-10 17:08:51 -0500 |
| commit | ddde8a4aa12b24b3d2d6419e326be195435d69b9 (patch) | |
| tree | 0586ecee5600592be258e05317b8058fdcffb72a | |
| download | AleeBrowser-ddde8a4aa12b24b3d2d6419e326be195435d69b9.tar.gz AleeBrowser-ddde8a4aa12b24b3d2d6419e326be195435d69b9.tar.bz2 AleeBrowser-ddde8a4aa12b24b3d2d6419e326be195435d69b9.zip | |
Inital commit
| -rw-r--r-- | .gitignore | 73 | ||||
| -rw-r--r-- | AleeBrowser.pro | 31 | ||||
| -rw-r--r-- | main.cpp | 11 | ||||
| -rw-r--r-- | mainbrowser.cpp | 31 | ||||
| -rw-r--r-- | mainbrowser.h | 26 | ||||
| -rw-r--r-- | mainbrowser.ui | 95 |
6 files changed, 267 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/AleeBrowser.pro b/AleeBrowser.pro new file mode 100644 index 0000000..94b7477 --- /dev/null +++ b/AleeBrowser.pro @@ -0,0 +1,31 @@ +QT += core gui webkitwidgets + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainbrowser.cpp + +HEADERS += \ + mainbrowser.h + +FORMS += \ + mainbrowser.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..7a461a0 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "mainbrowser.h" + +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + mainbrowser w; + w.show(); + return a.exec(); +} diff --git a/mainbrowser.cpp b/mainbrowser.cpp new file mode 100644 index 0000000..4a5a04e --- /dev/null +++ b/mainbrowser.cpp @@ -0,0 +1,31 @@ +#include "mainbrowser.h" +#include "ui_mainbrowser.h" +#include <QtWebKitWidgets/QWebView> +#include <QUrl> +#include <QDebug> + +mainbrowser::mainbrowser(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::mainbrowser) +{ + //QString url = ui->lineEdit->text(); + ui->setupUi(this); + ui->webView->load(QUrl("https://google.com")); + +} + +mainbrowser::~mainbrowser() +{ + delete ui; +} + + +void mainbrowser::on_actionQuit_triggered() +{ + close(); +} + +void mainbrowser::on_searchButton_clicked() +{ + qDebug() << "Search pressed!"; +} diff --git a/mainbrowser.h b/mainbrowser.h new file mode 100644 index 0000000..56dfc56 --- /dev/null +++ b/mainbrowser.h @@ -0,0 +1,26 @@ +#ifndef MAINBROWSER_H +#define MAINBROWSER_H + +#include <QMainWindow> + +QT_BEGIN_NAMESPACE +namespace Ui { class mainbrowser; } +QT_END_NAMESPACE + +class mainbrowser : public QMainWindow +{ + Q_OBJECT + +public: + mainbrowser(QWidget *parent = nullptr); + ~mainbrowser(); + +private slots: + void on_actionQuit_triggered(); + + void on_searchButton_clicked(); + +private: + Ui::mainbrowser *ui; +}; +#endif // MAINBROWSER_H diff --git a/mainbrowser.ui b/mainbrowser.ui new file mode 100644 index 0000000..92e32f1 --- /dev/null +++ b/mainbrowser.ui @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>mainbrowser</class> + <widget class="QMainWindow" name="mainbrowser"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>925</width> + <height>610</height> + </rect> + </property> + <property name="windowTitle"> + <string>AleeBrowser</string> + </property> + <widget class="QWidget" name="centralwidget"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="2"> + <widget class="QPushButton" name="searchButton"> + <property name="text"> + <string>Search</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="3"> + <widget class="QWebView" name="webView"> + <property name="url"> + <url> + <string>about:blank</string> + </url> + </property> + </widget> + </item> + <item row="0" column="0" colspan="2"> + <widget class="QLineEdit" name="lineEdit"> + <property name="text"> + <string>https://www.google.com</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>925</width> + <height>23</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>File</string> + </property> + <addaction name="actionAbout"/> + <addaction name="actionQuit"/> + </widget> + <addaction name="menuFile"/> + </widget> + <widget class="QStatusBar" name="statusbar"/> + <action name="actionQuit"> + <property name="text"> + <string>Quit</string> + </property> + </action> + <action name="actionAbout"> + <property name="text"> + <string>About</string> + </property> + </action> + </widget> + <customwidgets> + <customwidget> + <class>QWebView</class> + <extends>QWidget</extends> + <header location="global">QtWebKitWidgets/QWebView</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> |
