forked from organicmaps/organicmaps
Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
226846b39f |
26 changed files with 56 additions and 58 deletions
|
@ -229,13 +229,10 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
|
|||
list(APPEND qt_components Widgets)
|
||||
endif()
|
||||
if (NOT SKIP_DESKTOP)
|
||||
list(APPEND qt_components Gui Xml Svg)
|
||||
endif()
|
||||
# PATHS are hard-coded hints where to look for qt5 in addition to other places.
|
||||
find_package(Qt5 COMPONENTS REQUIRED ${qt_components} PATHS /usr/local/opt/qt@5)
|
||||
if (Qt5_VERSION VERSION_LESS 5.5.0)
|
||||
message(FATAL_ERROR "Minimum supported Qt5 version is 5.5")
|
||||
list(APPEND qt_components Gui Xml Svg OpenGL OpenGLWidgets)
|
||||
endif()
|
||||
# PATHS are hard-coded hints where to look for qt6 in addition to other places.
|
||||
find_package(Qt6 COMPONENTS REQUIRED ${qt_components} PATHS /usr/local/opt/qt@6)
|
||||
endif()
|
||||
|
||||
find_library(LIBZ NAMES z)
|
||||
|
|
|
@ -109,7 +109,7 @@ endfunction()
|
|||
function(omim_add_test_with_qt_event_loop executable)
|
||||
omim_add_test_impl(NO ${executable} ${ARGN})
|
||||
target_compile_definitions(${executable} PRIVATE OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP)
|
||||
target_link_libraries(${executable} Qt5::Widgets)
|
||||
target_link_libraries(${executable} Qt6::Widgets)
|
||||
endfunction()
|
||||
|
||||
function(omim_add_test_no_platform_init executable)
|
||||
|
|
|
@ -37,5 +37,4 @@ target_link_libraries(${PROJECT_NAME}
|
|||
indexer # For StyleReader in static_texture_tests
|
||||
drape
|
||||
gmock
|
||||
Qt5::Core
|
||||
)
|
||||
|
|
|
@ -280,8 +280,8 @@ QVariant TrafficMode::headerData(int section, Qt::Orientation orientation,
|
|||
|
||||
void TrafficMode::OnItemSelected(QItemSelection const & selected, QItemSelection const &)
|
||||
{
|
||||
CHECK(!selected.empty(), ("The selection should not be empty. RTFM for qt5."));
|
||||
CHECK(!m_segments.empty(), ("No segments are loaded, can't select."));
|
||||
ASSERT(!selected.empty(), ());
|
||||
ASSERT(!m_segments.empty(), ());
|
||||
|
||||
auto const row = selected.front().top();
|
||||
|
||||
|
|
|
@ -148,8 +148,8 @@ endif()
|
|||
target_link_libraries(${PROJECT_NAME}
|
||||
geometry # mercator::YToLat
|
||||
coding
|
||||
$<$<BOOL:${PLATFORM_DESKTOP}>:Qt5::Core>
|
||||
$<$<BOOL:${PLATFORM_LINUX}>:Qt5::Network>
|
||||
$<$<BOOL:${PLATFORM_DESKTOP}>:Qt6::Core>
|
||||
$<$<BOOL:${PLATFORM_LINUX}>:Qt6::Network>
|
||||
$<$<BOOL:${PLATFORM_MAC}>:-framework\ Foundation -framework\ SystemConfiguration -framework\ CoreLocation -framework\ CFNetwork>
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
project(desktop)
|
||||
|
||||
QT5_ADD_RESOURCES(RES_SOURCES res/resources.qrc)
|
||||
QT6_ADD_RESOURCES(RES_SOURCES res/resources.qrc)
|
||||
|
||||
set(SRC
|
||||
about.cpp
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
#include "base/file_name_utils.hpp"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QProcessEnvironment>
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
#include <exception>
|
||||
#include <iomanip> // std::quoted
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
QString ExecProcess(QString const & program, std::initializer_list<QString> args, QProcessEnvironment const * env)
|
||||
|
@ -23,7 +25,7 @@ QString ExecProcess(QString const & program, std::initializer_list<QString> args
|
|||
QProcess p;
|
||||
if (nullptr != env)
|
||||
p.setProcessEnvironment(*env);
|
||||
|
||||
|
||||
p.start(program, qargs, QIODevice::ReadOnly);
|
||||
p.waitForFinished(-1);
|
||||
|
||||
|
@ -111,11 +113,12 @@ QString GetExternalPath(QString const & name, QString const & primaryPath,
|
|||
// Special case for looking for in application folder.
|
||||
if (!QFileInfo::exists(path) && secondaryPath.isEmpty())
|
||||
{
|
||||
QString const appPath = QCoreApplication::applicationDirPath();
|
||||
QRegExp rx("(/[^/]*\\.app)", Qt::CaseInsensitive);
|
||||
int i = rx.indexIn(appPath);
|
||||
if (i >= 0)
|
||||
path = JoinPathQt({appPath.left(i), name});
|
||||
std::string const appPath = QCoreApplication::applicationDirPath().toStdString();
|
||||
|
||||
std::regex re("(/[^/]*\\.app)");
|
||||
std::smatch m;
|
||||
if (std::regex_search(appPath, m, re) && m.size() > 0)
|
||||
path.fromStdString(base::JoinPath(m[0], name.toStdString()));
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
class QStringList;
|
||||
class QProcessEnvironment;
|
||||
|
||||
// Returns stdout output of the program, throws std::runtime_error in case of non-zero exit code.
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QDesktopWidget>
|
||||
#include <QtWidgets/QDialogButtonBox>
|
||||
#include <QtWidgets/QMenu>
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#endif // BUILD_DESIGNER
|
||||
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtWidgets/QDesktopWidget>
|
||||
#include <QtWidgets/QDockWidget>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
|
@ -207,7 +206,7 @@ MainWindow::MainWindow(Framework & framework, bool apiOpenGLES3,
|
|||
#endif // NO_DOWNLOADER
|
||||
|
||||
m_pDrawWidget->UpdateAfterSettingsChanged();
|
||||
|
||||
|
||||
RoutingSettings::LoadSession(m_pDrawWidget->GetFramework());
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtWidgets/QToolButton>
|
||||
|
||||
#include <vector>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
project(qt_common)
|
||||
|
||||
QT5_ADD_RESOURCES(RESOURCES res/resources_common.qrc)
|
||||
QT6_ADD_RESOURCES(RESOURCES res/resources_common.qrc)
|
||||
|
||||
set_property(SOURCE qrc_resources_common.cpp PROPERTY SKIP_AUTOGEN ON)
|
||||
|
||||
|
@ -33,6 +33,8 @@ target_compile_options(${PROJECT_NAME}
|
|||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
map
|
||||
Qt5::Gui
|
||||
Qt5::Widgets
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
Qt6::OpenGL
|
||||
Qt6::OpenGLWidgets
|
||||
)
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QOpenGLFunctions>
|
||||
#include <QtGui/QOpenGLShaderProgram>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtWidgets/QMenu>
|
||||
|
||||
#include <QtGui/QOpenGLBuffer>
|
||||
#include <QtGui/QOpenGLVertexArrayObject>
|
||||
|
||||
namespace qt
|
||||
{
|
||||
namespace common
|
||||
|
@ -443,7 +443,12 @@ void MapWidget::wheelEvent(QWheelEvent * e)
|
|||
return;
|
||||
|
||||
QOpenGLWidget::wheelEvent(e);
|
||||
m_framework.Scale(exp(e->delta() / 360.0), m2::PointD(L2D(e->x()), L2D(e->y())), false);
|
||||
|
||||
QPointF const pos = e->position();
|
||||
|
||||
// https://doc-snapshots.qt.io/qt6-dev/qwheelevent.html#angleDelta, angleDelta() returns in eighths of a degree.
|
||||
/// @todo Here you can tune the speed of zooming.
|
||||
m_framework.Scale(exp(e->angleDelta().y() / 3.0 / 360.0), m2::PointD(L2D(pos.x()), L2D(pos.y())), false);
|
||||
}
|
||||
|
||||
search::ReverseGeocoder::Address GetFeatureAddressInfo(Framework const & framework,
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
|
||||
#include "indexer/feature.hpp"
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtWidgets/QOpenGLWidget>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
#include "drape/oglcontext.hpp"
|
||||
|
||||
#include <QOpenGLFramebufferObject>
|
||||
|
||||
#include <QtGui/QOffscreenSurface>
|
||||
#include <QtGui/QOpenGLFramebufferObject>
|
||||
#include <QtGui/QOpenGLContext>
|
||||
|
||||
#include <atomic>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "qt/qt_common/qtoglcontext.hpp"
|
||||
|
||||
#include <QtGui/QOpenGLContext>
|
||||
#include <QtGui/QOpenGLFramebufferObject>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "geometry/rect2d.hpp"
|
||||
|
||||
#include <QtWidgets/QOpenGLWidget>
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
|
|
@ -142,14 +142,14 @@ void SearchPanel::OnEverywhereSearchResults(uint64_t timestamp, search::Results
|
|||
for (size_t r = 0; r < res.GetHighlightRangesCount(); ++r)
|
||||
{
|
||||
std::pair<uint16_t, uint16_t> const & range = res.GetHighlightRange(r);
|
||||
strHigh.append(name.midRef(pos, range.first - pos));
|
||||
strHigh.append(name.mid(pos, range.first - pos));
|
||||
strHigh.append("<font color=\"green\">");
|
||||
strHigh.append(name.midRef(range.first, range.second));
|
||||
strHigh.append(name.mid(range.first, range.second));
|
||||
strHigh.append("</font>");
|
||||
|
||||
pos = range.first + range.second;
|
||||
}
|
||||
strHigh.append(name.midRef(pos));
|
||||
strHigh.append(name.mid(pos));
|
||||
|
||||
int const rowCount = m_pTable->rowCount();
|
||||
m_pTable->insertRow(rowCount);
|
||||
|
|
|
@ -14,6 +14,6 @@ target_compile_options(${PROJECT_NAME}
|
|||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
Qt5::Core
|
||||
Qt5::Widgets
|
||||
)
|
||||
Qt6::Core
|
||||
Qt6::Widgets
|
||||
)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QPushButton>
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <QtGui/QIntValidator>
|
||||
#include <QtGui/QKeySequence>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QDesktopWidget>
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QtWidgets/QDialogButtonBox>
|
||||
#include <QtWidgets/QDockWidget>
|
||||
|
@ -543,7 +542,7 @@ void MainView::AddSelectedFeature(QPoint const & p)
|
|||
QDockWidget * MainView::CreateDock(QWidget & widget)
|
||||
{
|
||||
auto * dock = new QDockWidget(QString(), this /* parent */, Qt::Widget);
|
||||
dock->setFeatures(QDockWidget::DockWidgetClosable |
|
||||
dock->setFeatures(QDockWidget::DockWidgetClosable |
|
||||
QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable);
|
||||
dock->setWidget(&widget);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QtGui/QStandardItem>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QMenu>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ omim_add_executable(${PROJECT_NAME} ${SRC})
|
|||
target_link_libraries(${PROJECT_NAME}
|
||||
geometry
|
||||
gflags::gflags
|
||||
Qt5::Xml
|
||||
Qt5::Svg
|
||||
Qt5::Widgets
|
||||
Qt6::Xml
|
||||
Qt6::Svg
|
||||
Qt6::Widgets
|
||||
)
|
||||
|
|
|
@ -241,8 +241,8 @@ bool SkinGenerator::WriteToFileNewStyle(std::string const &skinName)
|
|||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate))
|
||||
return false;
|
||||
QTextStream ts(&file);
|
||||
ts.setCodec("UTF-8");
|
||||
ts.setEncoding(QStringConverter::Utf8);
|
||||
ts << doc.toString();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // namespace tools
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSize>
|
||||
#include <QtSvg/QSvgRenderer>
|
||||
#include <QtXml/QXmlContentHandler>
|
||||
#include <QtXml/QXmlDefaultHandler>
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
#include <QtCore/QString>
|
||||
#include <QtCore/QHash>
|
||||
|
||||
#include <QtXml/QXmlSimpleReader>
|
||||
#include <QtXml/QXmlInputSource>
|
||||
|
||||
#include "gflags/gflags.h"
|
||||
|
||||
DEFINE_string(fontFileName, "../../data/01_dejavusans.ttf", "path to TrueType font file");
|
||||
|
|
Loading…
Add table
Reference in a new issue