Inital commit

This commit is contained in:
Andrew Lee 2020-02-10 17:08:51 -05:00
commit ddde8a4aa1
Signed by: andrew
GPG key ID: 4DCE67C47836D125
6 changed files with 267 additions and 0 deletions

73
.gitignore vendored Normal file
View file

@ -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

31
AleeBrowser.pro Normal file
View file

@ -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

11
main.cpp Normal file
View file

@ -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();
}

31
mainbrowser.cpp Normal file
View file

@ -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!";
}

26
mainbrowser.h Normal file
View file

@ -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

95
mainbrowser.ui Normal file
View file

@ -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>