double click show picture in fullscreen

This commit is contained in:
Rafael 2016-04-01 21:06:09 +02:00
parent ea2b9046e7
commit 7b0b67c6ad
4 changed files with 102 additions and 68 deletions

View file

@ -21,7 +21,9 @@
#include "ui_PictureDialog.h"
#include "SidebarGenerator.h"
#include "StandardPaths.h"
#include "UiModLabel.h"
#include <QDesktopWidget>
#include <QJsonDocument>
#include <QFileDialog>
#include <QMessageBox>
@ -347,3 +349,25 @@ fileDialogPreSave:
settings.setValue("CopyPicture", fileDialog.saveState());
settings.endGroup();
}
void PictureDialog::on_labPicture_mouseDoubleClicked()
{
QDialog *pictureWidget = new QDialog(this);
QRect rec = QApplication::desktop()->screenGeometry();
UiModLabel *pictureLabel = new UiModLabel(pictureWidget);
pictureLabel->setPixmap(ui->labPicture->pixmap()->scaled(rec.width(), rec.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
QObject::connect(pictureLabel, SIGNAL(mouseDoubleClicked()), pictureWidget, SLOT(close()));
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::WindowContextHelpButtonHint);
pictureWidget->setWindowTitle(tr("Show picture"));
pictureWidget->setStyleSheet("background-color: black;");
pictureWidget->showFullScreen();
pictureWidget->setModal(true);
pictureWidget->exec();
pictureLabel->deleteLater();
delete pictureLabel;
pictureWidget->deleteLater();
delete pictureWidget;
}

View file

@ -42,6 +42,7 @@ private slots:
void on_cmdClose_clicked();
void on_cmdExport_clicked();
void on_cmdCopy_clicked();
void on_labPicture_mouseDoubleClicked();
private:
ProfileDatabase *profileDB;

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>960</width>
<height>536</height>
<height>572</height>
</rect>
</property>
<property name="windowTitle">
@ -28,26 +28,32 @@
</property>
<item>
<widget class="UiModLabel" name="labPicture">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="vsDialog">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QFrame" name="jsonFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="hlJSON">
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="hlJson">
<property name="leftMargin">
<number>4</number>
</property>
@ -107,6 +113,7 @@
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

View file

@ -88,6 +88,8 @@ DISTFILES += res/app.rc \
lang/gta5sync_ru.ts \
lang/qt_ru.qm
INCLUDEPATH += ./uimod
win32: RC_FILE += res/app.rc
# QT4 ONLY STUFF