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;
|
||||
|
||||
resize(newSize);
|
||||
|
||||
QImage newImage(newSize,QImage::Format_ARGB32);
|
||||
newImage.fill(qRgba(255,255,255,0));
|
||||
QPainter painter(&newImage);
|
||||
|
@ -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()
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user