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 "ui_PictureDialog.h"
#include "SidebarGenerator.h" #include "SidebarGenerator.h"
#include "StandardPaths.h" #include "StandardPaths.h"
#include "UiModLabel.h"
#include <QDesktopWidget>
#include <QJsonDocument> #include <QJsonDocument>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
@ -347,3 +349,25 @@ fileDialogPreSave:
settings.setValue("CopyPicture", fileDialog.saveState()); settings.setValue("CopyPicture", fileDialog.saveState());
settings.endGroup(); 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_cmdClose_clicked();
void on_cmdExport_clicked(); void on_cmdExport_clicked();
void on_cmdCopy_clicked(); void on_cmdCopy_clicked();
void on_labPicture_mouseDoubleClicked();
private: private:
ProfileDatabase *profileDB; ProfileDatabase *profileDB;

View file

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>960</width> <width>960</width>
<height>536</height> <height>572</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -28,85 +28,92 @@
</property> </property>
<item> <item>
<widget class="UiModLabel" name="labPicture"> <widget class="UiModLabel" name="labPicture">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="vsDialog"> <widget class="QFrame" name="jsonFrame">
<property name="orientation"> <property name="frameShape">
<enum>Qt::Vertical</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="frameShadow">
<size> <enum>QFrame::Plain</enum>
<width>0</width>
<height>0</height>
</size>
</property> </property>
</spacer> <property name="lineWidth">
</item> <number>0</number>
<item>
<layout class="QHBoxLayout" name="hlJSON">
<property name="leftMargin">
<number>4</number>
</property> </property>
<property name="topMargin"> <layout class="QHBoxLayout" name="hlJson">
<number>4</number> <property name="leftMargin">
</property> <number>4</number>
<property name="rightMargin"> </property>
<number>4</number> <property name="topMargin">
</property> <number>4</number>
<property name="bottomMargin"> </property>
<number>4</number> <property name="rightMargin">
</property> <number>4</number>
<item> </property>
<widget class="QLabel" name="labJSON"> <property name="bottomMargin">
<property name="sizePolicy"> <number>4</number>
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> <item>
<verstretch>0</verstretch> <widget class="QLabel" name="labJSON">
</sizepolicy> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<string>&lt;span style=&quot; font-weight:600;&quot;&gt;Title: &lt;/span&gt;%6&lt;br&gt; <verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;span style=&quot; font-weight:600;&quot;&gt;Title: &lt;/span&gt;%6&lt;br&gt;
&lt;span style=&quot; font-weight:600;&quot;&gt;Location: &lt;/span&gt;%1, %2, %3 &lt;br&gt; &lt;span style=&quot; font-weight:600;&quot;&gt;Location: &lt;/span&gt;%1, %2, %3 &lt;br&gt;
&lt;span style=&quot; font-weight:600;&quot;&gt;Players: &lt;/span&gt;%4&lt;br&gt; &lt;span style=&quot; font-weight:600;&quot;&gt;Players: &lt;/span&gt;%4&lt;br&gt;
&lt;span style=&quot; font-weight:600;&quot;&gt;Crew ID: &lt;/span&gt;%5</string> &lt;span style=&quot; font-weight:600;&quot;&gt;Crew ID: &lt;/span&gt;%5</string>
</property> </property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdExport"> <widget class="QPushButton" name="cmdExport">
<property name="toolTip"> <property name="toolTip">
<string>Export picture</string> <string>Export picture</string>
</property> </property>
<property name="text"> <property name="text">
<string>Export</string> <string>Export</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdCopy"> <widget class="QPushButton" name="cmdCopy">
<property name="text"> <property name="text">
<string>Copy</string> <string>Copy</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdClose"> <widget class="QPushButton" name="cmdClose">
<property name="toolTip"> <property name="toolTip">
<string>Close</string> <string>Close</string>
</property> </property>
<property name="text"> <property name="text">
<string>Close</string> <string>Close</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View file

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