1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Add exemple windows build config

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-06-28 22:24:26 +02:00
parent 036827086b
commit b18acb2198
4 changed files with 2843 additions and 2831 deletions

View File

@ -1,73 +1,118 @@
#-------------------------------------------------
#
# Project created by QtCreator 2014-06-22T14:07:35
#
#-------------------------------------------------
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = toxgui
TEMPLATE = app
HEADERS += widget/form/addfriendform.h \
widget/form/chatform.h \
widget/form/groupchatform.h \
widget/form/settingsform.h \
widget/tool/chattextedit.h \
widget/tool/copyableelidelabel.h \
widget/tool/editablelabelwidget.h \
widget/tool/elidelabel.h \
widget/tool/esclineedit.h \
widget/tool/friendrequestdialog.h \
widget/filetransfertwidget.h \
widget/friendwidget.h \
widget/groupwidget.h \
widget/widget.h \
friend.h \
group.h \
grouplist.h \
settings.h \
status.h \
core.h \
friendlist.h \
cdata.h \
cstring.h \
audiobuffer.h
FORMS += widget.ui
CONFIG += c++11
RESOURCES += \
res.qrc
LIBS += -ltoxcore -ltoxav -lsodium
SOURCES += \
widget/form/addfriendform.cpp \
widget/form/chatform.cpp \
widget/form/groupchatform.cpp \
widget/form/settingsform.cpp \
widget/tool/chattextedit.cpp \
widget/tool/copyableelidelabel.cpp \
widget/tool/editablelabelwidget.cpp \
widget/tool/elidelabel.cpp \
widget/tool/esclineedit.cpp \
widget/tool/friendrequestdialog.cpp \
widget/filetransfertwidget.cpp \
widget/friendwidget.cpp \
widget/groupwidget.cpp \
widget/widget.cpp \
core.cpp \
friend.cpp \
friendlist.cpp \
group.cpp \
grouplist.cpp \
main.cpp \
settings.cpp \
status.cpp \
cdata.cpp \
cstring.cpp \
audiobuffer.cpp
#-------------------------------------------------
#
# Project created by QtCreator 2014-06-22T14:07:35
#
#-------------------------------------------------
QT += core gui multimedia multimediawidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = toxgui
TEMPLATE = app
HEADERS += widget/form/addfriendform.h \
widget/form/chatform.h \
widget/form/groupchatform.h \
widget/form/settingsform.h \
widget/tool/chattextedit.h \
widget/tool/copyableelidelabel.h \
widget/tool/editablelabelwidget.h \
widget/tool/elidelabel.h \
widget/tool/esclineedit.h \
widget/tool/friendrequestdialog.h \
widget/filetransfertwidget.h \
widget/friendwidget.h \
widget/groupwidget.h \
widget/widget.h \
friend.h \
group.h \
grouplist.h \
settings.h \
status.h \
core.h \
friendlist.h \
cdata.h \
cstring.h \
audiobuffer.h \
widget/selfcamview.h
FORMS += widget.ui
CONFIG += c++11
RESOURCES += \
res.qrc
LIBS += -ltoxcore -ltoxav -lsodium
SOURCES += \
widget/form/addfriendform.cpp \
widget/form/chatform.cpp \
widget/form/groupchatform.cpp \
widget/form/settingsform.cpp \
widget/tool/chattextedit.cpp \
widget/tool/copyableelidelabel.cpp \
widget/tool/editablelabelwidget.cpp \
widget/tool/elidelabel.cpp \
widget/tool/esclineedit.cpp \
widget/tool/friendrequestdialog.cpp \
widget/filetransfertwidget.cpp \
widget/friendwidget.cpp \
widget/groupwidget.cpp \
widget/widget.cpp \
core.cpp \
friend.cpp \
friendlist.cpp \
group.cpp \
grouplist.cpp \
main.cpp \
settings.cpp \
status.cpp \
cdata.cpp \
cstring.cpp \
audiobuffer.cpp \
widget/selfcamview.cpp
win32: LIBS += -L$$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/ -ltoxcore
INCLUDEPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
DEPENDPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/toxcore.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/libtoxcore.a
win32: LIBS += -L$$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/ -ltoxav
INCLUDEPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
DEPENDPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/toxav.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/libtoxav.a
win32: LIBS += -L$$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/ -lvpx
INCLUDEPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
DEPENDPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/vpx.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/libvpx.a
win32: LIBS += -L$$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/ -lopus
INCLUDEPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
DEPENDPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/opus.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/libopus.a
win32: LIBS += -lws2_32
win32: LIBS += -L$$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/ -lsodium
INCLUDEPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
DEPENDPATH += $$PWD/../../../../Downloads/libtoxcore-win32-i686/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/sodium.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/../../../../Downloads/libtoxcore-win32-i686/lib/libsodium.a

5249
widget.ui

File diff suppressed because it is too large Load Diff

View File

@ -1,80 +1,80 @@
#include "selfcamview.h"
#include <QActionGroup>
#include <QMessageBox>
#include <QCloseEvent>
#include <QShowEvent>
SelfCamView::SelfCamView(QWidget* parent)
: QWidget(parent), camera(nullptr), mainLayout{new QHBoxLayout()}
{
setLayout(mainLayout);
setWindowTitle("Tox video test");
setMinimumSize(320,240);
QByteArray cameraDevice;
/*
QActionGroup *videoDevicesGroup = new QActionGroup(this);
videoDevicesGroup->setExclusive(true);
foreach(const QByteArray &deviceName, QCamera::availableDevices()) {
QString description = camera->deviceDescription(deviceName);
QAction *videoDeviceAction = new QAction(description, videoDevicesGroup);
videoDeviceAction->setCheckable(true);
videoDeviceAction->setData(QVariant(deviceName));
if (cameraDevice.isEmpty()) {
cameraDevice = deviceName;
videoDeviceAction->setChecked(true);
}
ui->menuDevices->addAction(videoDeviceAction);
}
connect(videoDevicesGroup, SIGNAL(triggered(QAction*)), SLOT(updateCameraDevice(QAction*)));
*/
viewfinder = new QCameraViewfinder(this);
mainLayout->addWidget(viewfinder);
viewfinder->show();
setCamera(cameraDevice);
}
SelfCamView::~SelfCamView()
{
delete camera;
}
void SelfCamView::setCamera(const QByteArray &cameraDevice)
{
delete camera;
if (cameraDevice.isEmpty())
camera = new QCamera;
else
camera = new QCamera(cameraDevice);
//connect(camera, SIGNAL(stateChanged(QCamera::State)), this, SLOT(updateCameraState(QCamera::State)));
connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(displayCameraError()));
camera->setViewfinder(viewfinder);
//updateCameraState(camera->state());
camera->setCaptureMode(QCamera::CaptureVideo);
}
void SelfCamView::displayCameraError()
{
QMessageBox::warning(this, tr("Camera error"), camera->errorString());
}
void SelfCamView::closeEvent(QCloseEvent* event)
{
camera->stop();
event->accept();
}
void SelfCamView::showEvent(QShowEvent* event)
{
camera->start();
event->accept();
}
#include "selfcamview.h"
#include <QActionGroup>
#include <QMessageBox>
#include <QCloseEvent>
#include <QShowEvent>
SelfCamView::SelfCamView(QWidget* parent)
: QWidget(parent), camera(nullptr), mainLayout{new QHBoxLayout()}
{
setLayout(mainLayout);
setWindowTitle("Tox video test");
setMinimumSize(320,240);
QByteArray cameraDevice;
/*
QActionGroup *videoDevicesGroup = new QActionGroup(this);
videoDevicesGroup->setExclusive(true);
foreach(const QByteArray &deviceName, QCamera::availableDevices()) {
QString description = camera->deviceDescription(deviceName);
QAction *videoDeviceAction = new QAction(description, videoDevicesGroup);
videoDeviceAction->setCheckable(true);
videoDeviceAction->setData(QVariant(deviceName));
if (cameraDevice.isEmpty()) {
cameraDevice = deviceName;
videoDeviceAction->setChecked(true);
}
ui->menuDevices->addAction(videoDeviceAction);
}
connect(videoDevicesGroup, SIGNAL(triggered(QAction*)), SLOT(updateCameraDevice(QAction*)));
*/
viewfinder = new QCameraViewfinder(this);
mainLayout->addWidget(viewfinder);
viewfinder->show();
setCamera(cameraDevice);
}
SelfCamView::~SelfCamView()
{
delete camera;
}
void SelfCamView::setCamera(const QByteArray &cameraDevice)
{
delete camera;
if (cameraDevice.isEmpty())
camera = new QCamera;
else
camera = new QCamera(cameraDevice);
//connect(camera, SIGNAL(stateChanged(QCamera::State)), this, SLOT(updateCameraState(QCamera::State)));
connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(displayCameraError()));
camera->setViewfinder(viewfinder);
//updateCameraState(camera->state());
camera->setCaptureMode(QCamera::CaptureVideo);
}
void SelfCamView::displayCameraError()
{
QMessageBox::warning(this, tr("Camera error"), camera->errorString());
}
void SelfCamView::closeEvent(QCloseEvent* event)
{
camera->stop();
event->accept();
}
void SelfCamView::showEvent(QShowEvent* event)
{
camera->start();
event->accept();
}

View File

@ -1,37 +1,37 @@
#ifndef SELFCAMVIEW_H
#define SELFCAMVIEW_H
#include <QCamera>
#include <QCameraImageCapture>
#include <QMediaRecorder>
#include <QWidget>
#include <QVideoWidget>
#include <QCameraViewfinder>
#include <QHBoxLayout>
class QCloseEvent;
class QShowEvent;
class SelfCamView : public QWidget
{
Q_OBJECT
public:
SelfCamView(QWidget *parent=0);
~SelfCamView();
private:
void closeEvent(QCloseEvent*);
void showEvent(QShowEvent*);
private slots:
void setCamera(const QByteArray &cameraDevice);
void displayCameraError();
private:
QCamera *camera;
QCameraViewfinder* viewfinder;
QHBoxLayout* mainLayout;
};
#endif // SELFCAMVIEW_H
#ifndef SELFCAMVIEW_H
#define SELFCAMVIEW_H
#include <QCamera>
#include <QCameraImageCapture>
#include <QMediaRecorder>
#include <QWidget>
#include <QVideoWidget>
#include <QCameraViewfinder>
#include <QHBoxLayout>
class QCloseEvent;
class QShowEvent;
class SelfCamView : public QWidget
{
Q_OBJECT
public:
SelfCamView(QWidget *parent=0);
~SelfCamView();
private:
void closeEvent(QCloseEvent*);
void showEvent(QShowEvent*);
private slots:
void setCamera(const QByteArray &cameraDevice);
void displayCameraError();
private:
QCamera *camera;
QCameraViewfinder* viewfinder;
QHBoxLayout* mainLayout;
};
#endif // SELFCAMVIEW_H