added ability to scroll
This commit is contained in:
parent
18e732449c
commit
d898916818
@ -37,6 +37,8 @@ void DisplayArea::resizeImage(QImage *image, const QSize &newSize)
|
|||||||
{
|
{
|
||||||
if(image->size()==newSize) return;
|
if(image->size()==newSize) return;
|
||||||
|
|
||||||
|
resize(newSize);
|
||||||
|
|
||||||
QImage newImage(newSize,QImage::Format_ARGB32);
|
QImage newImage(newSize,QImage::Format_ARGB32);
|
||||||
newImage.fill(qRgba(255,255,255,0));
|
newImage.fill(qRgba(255,255,255,0));
|
||||||
QPainter painter(&newImage);
|
QPainter painter(&newImage);
|
||||||
|
@ -10,16 +10,22 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent),displayArea(new DisplayArea(this))
|
: QMainWindow(parent),displayArea(new DisplayArea(this))
|
||||||
{
|
{
|
||||||
setCentralWidget(displayArea);
|
displayArea->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||||
|
scrollArea = new QScrollArea();
|
||||||
|
scrollArea->setWidget(displayArea);
|
||||||
|
setCentralWidget(scrollArea);
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
createMenus();
|
createMenus();
|
||||||
|
|
||||||
setWindowTitle(tr("LivePow"));
|
setWindowTitle(tr("LivePow"));
|
||||||
|
resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
#include <QScrollArea>
|
||||||
|
|
||||||
class DisplayArea;
|
class DisplayArea;
|
||||||
class InputParser;
|
class InputParser;
|
||||||
@ -20,6 +21,7 @@ public:
|
|||||||
InputParser *parser;
|
InputParser *parser;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QScrollArea *scrollArea;
|
||||||
DisplayArea *displayArea;
|
DisplayArea *displayArea;
|
||||||
void createActions();
|
void createActions();
|
||||||
void createMenus();
|
void createMenus();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user