Compare commits

...
3 Commits
Author SHA1 Message Date
Mikaël Capelle 1bfa64842e Merge pull request #9 from ModOrganizer2/update-cmake-common-qt6
Update following cmake_common changes.
2022-04-28 17:50:08 +02:00
Mikaël Capelle bdd4397c8f Update following cmake_common changes. 2022-04-19 23:56:03 +02:00
Jeremy Rimpo 69fa4b8a3d Changes to compile with Qt6 + Boost 1.77 2021-12-05 03:42:49 -06:00
5 changed files with 10 additions and 49 deletions
+4 -5
View File
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 3.16)
project(preview_base)
set(project_type plugin)
if(DEFINED DEPENDENCIES_DIR)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/project.cmake)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
else()
include(../cmake_common/project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
endif()
project(preview_base)
add_subdirectory(src)
+4 -5
View File
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.16)
if(DEFINED DEPENDENCIES_DIR)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/src.cmake)
else()
include(../../cmake_common/src.cmake)
endif()
add_library(preview_base SHARED)
mo2_configure_plugin(preview_base WARNINGS OFF)
mo2_install_target(preview_base)
-11
View File
@@ -1,11 +0,0 @@
Import('qt_env')
env = qt_env.Clone()
env.AppendUnique(CPPDEFINES = [ 'PREVIEWBASE_LIBRARY' ])
lib = env.SharedLibrary('previewBase', env.Glob('*.cpp'))
env.InstallModule(lib)
res = env['QT_USED_MODULES']
Return('res')
-26
View File
@@ -1,26 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2014-01-14T19:50:56
#
#-------------------------------------------------
TARGET = previewBase
TEMPLATE = lib
CONFIG += plugins
CONFIG += dll
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets gui
DEFINES += PREVIEWBASE_LIBRARY
SOURCES += previewbase.cpp
HEADERS += previewbase.h
include(../plugin_template.pri)
OTHER_FILES += \
previewbase.json\
SConscript
+2 -2
View File
@@ -26,7 +26,7 @@ along with Base Preview plugin. If not, see <http://www.gnu.org/licenses/>.
#include <QTextEdit>
#include <QtPlugin>
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
using namespace MOBase;
@@ -130,7 +130,7 @@ QWidget *PreviewBase::genImagePreview(const QString &fileName, const QSize&) con
{
QLabel *label = new QLabel();
QPixmap pic = QPixmap(fileName);
QSize screenSize = QApplication::desktop()->screenGeometry().size();
QSize screenSize = QApplication::primaryScreen()->geometry().size();
// ensure the output image is no more than 80% of the screen height.
// If the aspect ratio is higher than that of the screen this would still allow the image to extend
// beyond the screen but it ensures you can drag the window and close it