This commit is contained in:
ArsenArsen 2017-04-26 22:42:11 +02:00
parent 2ef75d7576
commit f6dea1e046
3 changed files with 2 additions and 80 deletions

View File

@ -38,8 +38,7 @@ SOURCES += main.cpp\
formatter.cpp \ formatter.cpp \
uploaders/customuploader.cpp \ uploaders/customuploader.cpp \
notifications.cpp \ notifications.cpp \
hotkeying.cpp \ hotkeying.cpp
sequencedialog.cpp
HEADERS += mainwindow.hpp \ HEADERS += mainwindow.hpp \
cropeditor/cropeditor.hpp \ cropeditor/cropeditor.hpp \
@ -56,8 +55,7 @@ HEADERS += mainwindow.hpp \
formatter.hpp \ formatter.hpp \
uploaders/customuploader.hpp \ uploaders/customuploader.hpp \
notifications.hpp \ notifications.hpp \
hotkeying.hpp \ hotkeying.hpp
sequencedialog.hpp
FORMS += mainwindow.ui FORMS += mainwindow.ui

View File

@ -1,53 +0,0 @@
#include "rendererwindow.hpp"
RendererWindow::RendererWindow(QRect &size, QWindow *parent) :
QWindow(*parent)
{
create();
backingStore = new QBackingStore(this);
setGeometry(size);
}
bool RasterWindow::event(QEvent *event)
{
if (event->type() == QEvent::UpdateRequest) {
renderNow();
return true;
}
return QWindow::event(event);
}
void RendererWindow::renderLater() {
requestUpdate();
}
void RasterWindow::resizeEvent(QResizeEvent *resizeEvent)
{
m_backingStore->resize(resizeEvent->size());
if (isExposed())
renderNow();
}
void RasterWindow::exposeEvent(QExposeEvent *)
{
if (isExposed())
renderNow();
}
void RasterWindow::renderNow()
{
if (!isExposed())
return;
QRect rect(0, 0, width(), height());
m_backingStore->beginPaint(rect);
QPaintDevice *device = m_backingStore->paintDevice();
QPainter painter(device);
painter.fillRect(0, 0, width(), height(), Qt::white);
render(&painter);
m_backingStore->endPaint();
m_backingStore->flush(rect);
}

View File

@ -1,23 +0,0 @@
#ifndef RENDERERWINDOW_HPP
#define RENDERERWINDOW_HPP
#include <QtGui>
class RendererWindow : public QWindow
{
Q_OBJECT
public:
RendererWindow(QRect &size, QWindow *parent = 0);
virtual void render(QPainter *painter);
public slots:
void renderLater();
void renderNow();
protected:
bool event(QEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void exposeEvent(QExposeEvent *event) override;
private:
QBackingStore *backingStore;
};
#endif // RENDERERWINDOW_HPP