multi deploy
other qt6 patches
This commit is contained in:
@@ -26,11 +26,18 @@ LogView::Category::Category() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LogView::Category::makeIcon(QSize size, QSize size_icon) {
|
void LogView::Category::makeIcon(QSize size, QSize size_icon, qreal ratio) {
|
||||||
icon_image = QImage();
|
icon_image = QImage();
|
||||||
if (!image.isNull())
|
if (!image.isNull()) {
|
||||||
icon_image = image.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
icon_image = image.scaled(size * ratio, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap px = QPixmap::fromImage(image.scaled(size_icon, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
icon_image.setDevicePixelRatio(ratio);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
QPixmap px = QPixmap::fromImage(image.scaled(size_icon * ratio, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
px.setDevicePixelRatio(ratio);
|
||||||
|
#endif
|
||||||
icon.addPixmap(px, QIcon::Active);
|
icon.addPixmap(px, QIcon::Active);
|
||||||
icon.addPixmap(px, QIcon::Disabled);
|
icon.addPixmap(px, QIcon::Disabled);
|
||||||
icon.addPixmap(px, QIcon::Normal);
|
icon.addPixmap(px, QIcon::Normal);
|
||||||
@@ -119,7 +126,11 @@ void LogView::registerCategory(const QString & label, QRegularExpression regexp,
|
|||||||
c.text_brush = text_brush;
|
c.text_brush = text_brush;
|
||||||
c.background = background;
|
c.background = background;
|
||||||
c.bold = bold;
|
c.bold = bold;
|
||||||
c.makeIcon(iconImageSize(), preferredIconSize(1., this));
|
c.makeIcon(iconImageSize(), preferredIconSize(1., this)
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
, devicePixelRatioF()
|
||||||
|
#endif
|
||||||
|
);
|
||||||
categories.append(c);
|
categories.append(c);
|
||||||
ui->comboCategory->addItem(c.icon, label, QVariant(regexp));
|
ui->comboCategory->addItem(c.icon, label, QVariant(regexp));
|
||||||
}
|
}
|
||||||
@@ -204,7 +215,11 @@ void LogView::changeEvent(QEvent * e) {
|
|||||||
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
|
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
|
||||||
QSize is = iconImageSize(), is_i = preferredIconSize(1., this);
|
QSize is = iconImageSize(), is_i = preferredIconSize(1., this);
|
||||||
for (int i = 0; i < categories.size(); ++i)
|
for (int i = 0; i < categories.size(); ++i)
|
||||||
categories[i].makeIcon(is, is_i);
|
categories[i].makeIcon(is, is_i
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
, devicePixelRatioF()
|
||||||
|
#endif
|
||||||
|
);
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
struct QAD_APPLICATION_EXPORT Category {
|
struct QAD_APPLICATION_EXPORT Category {
|
||||||
Category();
|
Category();
|
||||||
void makeIcon(QSize size, QSize size_icon);
|
void makeIcon(QSize size, QSize size_icon, qreal ratio = 1.);
|
||||||
QString label;
|
QString label;
|
||||||
QRegularExpression regexp;
|
QRegularExpression regexp;
|
||||||
QImage image, icon_image;
|
QImage image, icon_image;
|
||||||
|
|||||||
@@ -303,9 +303,7 @@ QPIConfig::QPIConfig(const QString & path, QStringList dirs) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dev->close();
|
dev->close();
|
||||||
#if QT_VERSION_MAJOR > 5
|
setupCodec();
|
||||||
stream.setEncoding(QStringConverter::Utf8);
|
|
||||||
#endif
|
|
||||||
setFileName(cp);
|
setFileName(cp);
|
||||||
open(QIODevice::ReadOnly);
|
open(QIODevice::ReadOnly);
|
||||||
parse();
|
parse();
|
||||||
@@ -350,16 +348,22 @@ void QPIConfig::setString(QString * str) {
|
|||||||
|
|
||||||
void QPIConfig::setCodec(const char * codecName) {
|
void QPIConfig::setCodec(const char * codecName) {
|
||||||
codec = codecName;
|
codec = codecName;
|
||||||
|
setupCodec();
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QPIConfig::setupCodec() {
|
||||||
#if QT_VERSION_MAJOR <= 5
|
#if QT_VERSION_MAJOR <= 5
|
||||||
stream.setCodec(codecName);
|
stream.setCodec(codec.toLatin1().data());
|
||||||
#else
|
#else
|
||||||
QString cn = QString(codecName).toLower().remove(' ').remove('-').trimmed();
|
QString cn = codec.toLower().remove(' ').remove('-').trimmed();
|
||||||
QStringConverter::Encoding sc = QStringConverter::System;
|
QStringConverter::Encoding sc = QStringConverter::System;
|
||||||
if (cn == "utf8" ) sc = QStringConverter::Utf8 ;
|
if (cn == "utf8" ) sc = QStringConverter::Utf8 ;
|
||||||
else if (cn == "utf16") sc = QStringConverter::Utf16;
|
else if (cn == "utf16") sc = QStringConverter::Utf16;
|
||||||
stream.setEncoding(sc);
|
stream.setEncoding(sc);
|
||||||
#endif
|
#endif
|
||||||
parse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -606,10 +610,7 @@ void QPIConfig::writeAll() {
|
|||||||
stream.setString(buffer);
|
stream.setString(buffer);
|
||||||
buffer->clear();
|
buffer->clear();
|
||||||
}
|
}
|
||||||
#if QT_VERSION_MAJOR <= 5
|
setupCodec();
|
||||||
if (!codec.isEmpty())
|
|
||||||
stream.setCodec(codec.toLatin1().data());
|
|
||||||
#endif
|
|
||||||
stream.seek(0);
|
stream.seek(0);
|
||||||
buildFullNames(&root);
|
buildFullNames(&root);
|
||||||
Branch b = allLeaves();
|
Branch b = allLeaves();
|
||||||
@@ -782,13 +783,10 @@ void QPIConfig::parse(QString content) {
|
|||||||
} else {
|
} else {
|
||||||
stream.setString(&content);
|
stream.setString(&content);
|
||||||
}
|
}
|
||||||
|
setupCodec();
|
||||||
stream.seek(0);
|
stream.seek(0);
|
||||||
other.clear();
|
other.clear();
|
||||||
lines = centry = 0;
|
lines = centry = 0;
|
||||||
#if QT_VERSION_MAJOR <= 5
|
|
||||||
if (!codec.isEmpty())
|
|
||||||
stream.setCodec(codec.toLatin1().data());
|
|
||||||
#endif
|
|
||||||
while (!stream.atEnd()) {
|
while (!stream.atEnd()) {
|
||||||
other.push_back(QString());
|
other.push_back(QString());
|
||||||
src = str = parseLine(stream.readLine());
|
src = str = parseLine(stream.readLine());
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ private:
|
|||||||
void updateIncludes();
|
void updateIncludes();
|
||||||
QString parseLine(QString v);
|
QString parseLine(QString v);
|
||||||
void parse(QString content = QString());
|
void parse(QString content = QString());
|
||||||
|
void setupCodec();
|
||||||
|
|
||||||
int centry;
|
int centry;
|
||||||
bool internal;
|
bool internal;
|
||||||
|
|||||||
@@ -132,7 +132,11 @@ bool ImageView::eventFilter(QObject * o, QEvent * e) {
|
|||||||
|
|
||||||
|
|
||||||
void ImageView::adjustView() {
|
void ImageView::adjustView() {
|
||||||
int nw = map.size().boundedTo(size()).width();
|
QSize ws = size();
|
||||||
|
#if QT_VERSION_MAJOR >= 5
|
||||||
|
ws *= devicePixelRatio();
|
||||||
|
#endif
|
||||||
|
int nw = map.size().boundedTo(ws).width();
|
||||||
item.setScale(1.);
|
item.setScale(1.);
|
||||||
if (nw > 0) {
|
if (nw > 0) {
|
||||||
qreal mp = map.width() / nw;
|
qreal mp = map.width() / nw;
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ endif()
|
|||||||
set(APP_INFO "Editor for BlockView Blocks")
|
set(APP_INFO "Editor for BlockView Blocks")
|
||||||
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_blockview")
|
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_blockview")
|
||||||
if (NOT DEFINED ANDROID_PLATFORM)
|
if (NOT DEFINED ANDROID_PLATFORM)
|
||||||
if (Qt5_FOUND)
|
foreach (_qv_ IN ITEMS 5 6)
|
||||||
import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
|
if (${LOCAL_FOUND${_qv_}})
|
||||||
import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
|
import_version(${PROJECT_NAME}${_qv_} ${PROJECT_NAME})
|
||||||
deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release ADD_MANIFEST)
|
import_deploy_properties(${PROJECT_NAME}${_qv_} ${PROJECT_NAME})
|
||||||
endif()
|
deploy_target(${PROJECT_NAME}${_qv_} DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release ADD_MANIFEST)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ if (PIP_FOUND)
|
|||||||
set(APP_INFO "Small calculator ang grapher")
|
set(APP_INFO "Small calculator ang grapher")
|
||||||
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_graphic;qad_piqt")
|
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_graphic;qad_piqt")
|
||||||
if (NOT DEFINED ANDROID_PLATFORM)
|
if (NOT DEFINED ANDROID_PLATFORM)
|
||||||
if (Qt5_FOUND)
|
foreach (_qv_ IN ITEMS 5 6)
|
||||||
import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
|
if (${LOCAL_FOUND${_qv_}})
|
||||||
import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
|
import_version(${PROJECT_NAME}${_qv_} ${PROJECT_NAME})
|
||||||
deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release ADD_MANIFEST)
|
import_deploy_properties(${PROJECT_NAME}${_qv_} ${PROJECT_NAME})
|
||||||
endif()
|
deploy_target(${PROJECT_NAME}${_qv_} DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release ADD_MANIFEST)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user