Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3dfc9c673 | |||
eb648e3112 | |||
5495fa06d3 | |||
41e75f10b5 | |||
6b0e4b6767 |
33
appveyor.yml
33
appveyor.yml
@ -1,24 +1,49 @@
|
||||
environment:
|
||||
CMAKE_INSTALL_ROOT: C:\projects\cmake
|
||||
matrix:
|
||||
- build_name: mingw73_32_qt5_12_6
|
||||
QTPATH: C:\Qt\5.12.6\mingw73_32
|
||||
MINGW32: C:\Qt\Tools\mingw730_32
|
||||
|
||||
install:
|
||||
- mkdir %CMAKE_INSTALL_ROOT%
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- git submodule update --init --recursive
|
||||
- set PATH=%PATH%;%QTPATH%\bin;%MINGW32%\bin
|
||||
- set PATH=%PATH%;%CMAKE_INSTALL_ROOT%;%QTPATH%\bin;%MINGW32%\bin
|
||||
|
||||
build_script:
|
||||
# prepare
|
||||
- mkdir 3rdparty
|
||||
- cinst ninja
|
||||
# install ECM so we can build KImageFormats
|
||||
- cd 3rdparty
|
||||
- git clone -q git://anongit.kde.org/extra-cmake-modules.git
|
||||
- cd extra-cmake-modules
|
||||
- cmake -G "Ninja" . -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT%
|
||||
- cmake --build .
|
||||
- cmake --build . --target install
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
# install KImageFormats
|
||||
- cd 3rdparty
|
||||
- git clone git://anongit.kde.org/kimageformats.git
|
||||
- cd kimageformats
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -G "Unix Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX='%cd%' ..\
|
||||
- cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-s" -DCMAKE_MAKE_PROGRAM=mingw32-make -DQT_PLUGIN_INSTALL_DIR=%QTPATH%\plugins
|
||||
- cmake --build . --config Release
|
||||
- cmake --build . --config Release --target install
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
# finally...
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX='%cd%'
|
||||
- mingw32-make
|
||||
- mingw32-make install
|
||||
# fixme: I don't know how to NOT make the binary installed to the ./bin/ folder...
|
||||
- cd bin
|
||||
- windeployqt --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler --release .\ppic.exe
|
||||
- tree
|
||||
- windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler --release .\ppic.exe
|
||||
# for debug..
|
||||
- tree /f
|
||||
|
||||
artifacts:
|
||||
- path: build\bin
|
||||
|
@ -39,8 +39,10 @@ void GraphicsView::showFileFromUrl(const QUrl &url, bool doRequestGallery)
|
||||
QImageReader imageReader(filePath);
|
||||
imageReader.setAutoTransform(true);
|
||||
imageReader.setDecideFormatFromContent(true);
|
||||
QImage::Format imageFormat = imageReader.imageFormat();
|
||||
if (imageFormat == QImage::Format_Invalid) {
|
||||
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
|
||||
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
|
||||
// QImage::Format imageFormat = imageReader.imageFormat();
|
||||
if (imageReader.format().isEmpty()) {
|
||||
showText(tr("File is not a valid image"));
|
||||
} else {
|
||||
showImage(QPixmap::fromImageReader(&imageReader));
|
||||
|
@ -113,6 +113,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(quitAppShorucut, &QShortcut::activated,
|
||||
std::bind(&MainWindow::quitAppAction, this, false));
|
||||
|
||||
QShortcut * quitAppShorucut2 = new QShortcut(QKeySequence(Qt::Key_Escape), this);
|
||||
connect(quitAppShorucut2, &QShortcut::activated,
|
||||
std::bind(&MainWindow::quitAppAction, this, false));
|
||||
|
||||
QShortcut * prevPictureShorucut = new QShortcut(QKeySequence(Qt::Key_PageUp), this);
|
||||
connect(prevPictureShorucut, &QShortcut::activated,
|
||||
this, &MainWindow::galleryPrev);
|
||||
@ -185,12 +189,18 @@ QUrl MainWindow::currentImageFileUrl() const
|
||||
return QUrl();
|
||||
}
|
||||
|
||||
void MainWindow::clearGallery()
|
||||
{
|
||||
m_currentFileIndex = -1;
|
||||
m_files.clear();
|
||||
}
|
||||
|
||||
void MainWindow::loadGalleryBySingleLocalFile(const QString &path)
|
||||
{
|
||||
QFileInfo info(path);
|
||||
QDir dir(info.path());
|
||||
QString currentFileName = info.fileName();
|
||||
QStringList entryList = dir.entryList({"*.jpg", "*.jpeg", "*.png", "*.gif", "*.svg", "*.bmp"},
|
||||
QStringList entryList = dir.entryList({"*.jpg", "*.jpeg", "*.jfif", "*.png", "*.gif", "*.svg", "*.bmp"},
|
||||
QDir::Files | QDir::NoSymLinks, QDir::NoSort);
|
||||
|
||||
QCollator collator;
|
||||
@ -198,8 +208,7 @@ void MainWindow::loadGalleryBySingleLocalFile(const QString &path)
|
||||
|
||||
std::sort(entryList.begin(), entryList.end(), collator);
|
||||
|
||||
m_currentFileIndex = -1;
|
||||
m_files.clear();
|
||||
clearGallery();
|
||||
|
||||
for (int i = 0; i < entryList.count(); i++) {
|
||||
const QString & oneEntry = entryList.at(i);
|
||||
@ -357,6 +366,7 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
|
||||
|
||||
QAction * pasteImage = new QAction(tr("&Paste Image"));
|
||||
connect(pasteImage, &QAction::triggered, this, [ = ](){
|
||||
clearGallery();
|
||||
m_graphicsView->showImage(clipboardImage);
|
||||
});
|
||||
|
||||
|
@ -27,6 +27,7 @@ public:
|
||||
void adjustWindowSizeBySceneRect();
|
||||
QUrl currentImageFileUrl() const;
|
||||
|
||||
void clearGallery();
|
||||
void loadGalleryBySingleLocalFile(const QString &path);
|
||||
void galleryPrev();
|
||||
void galleryNext();
|
||||
|
Reference in New Issue
Block a user