added ability to scroll

This commit is contained in:
leo 2021-06-16 00:37:18 +02:00
parent 18e732449c
commit d898916818
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
3 changed files with 11 additions and 1 deletions

View File

@ -37,6 +37,8 @@ void DisplayArea::resizeImage(QImage *image, const QSize &newSize)
{
if(image->size()==newSize) return;
resize(newSize);
QImage newImage(newSize,QImage::Format_ARGB32);
newImage.fill(qRgba(255,255,255,0));
QPainter painter(&newImage);

View File

@ -10,16 +10,22 @@
#include <QDir>
#include <QFileDialog>
#include <QMenuBar>
#include <QGuiApplication>
#include <QScreen>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),displayArea(new DisplayArea(this))
{
setCentralWidget(displayArea);
displayArea->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
scrollArea = new QScrollArea();
scrollArea->setWidget(displayArea);
setCentralWidget(scrollArea);
createActions();
createMenus();
setWindowTitle(tr("LivePow"));
resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5);
}
MainWindow::~MainWindow()

View File

@ -3,6 +3,7 @@
#include <QMainWindow>
#include <QCommandLineParser>
#include <QScrollArea>
class DisplayArea;
class InputParser;
@ -20,6 +21,7 @@ public:
InputParser *parser;
private:
QScrollArea *scrollArea;
DisplayArea *displayArea;
void createActions();
void createMenus();