[qt] Fixed window size issue. Allow screenshoter for Linux.

This commit is contained in:
Daria Volvenkova 2019-11-25 14:57:41 +03:00 committed by gmoryes
parent 51140bd695
commit 38cb634646
3 changed files with 8 additions and 10 deletions

View file

@ -170,6 +170,7 @@ int main(int argc, char * argv[])
#if defined(OMIM_OS_MAC)
apiOpenGLES3 = a.arguments().contains("es3", Qt::CaseInsensitive);
#endif
if (!FLAGS_lang.empty())
(void)::setenv("LANGUAGE", FLAGS_lang.c_str(), 1);
@ -201,7 +202,7 @@ int main(int argc, char * argv[])
if (FLAGS_dpi_scale >= df::VisualParams::kMdpiScale && FLAGS_dpi_scale <= df::VisualParams::kXxxhdpiScale)
screenshotParams->m_dpiScale = FLAGS_dpi_scale;
}
#endif
qt::MainWindow::SetDefaultSurfaceFormat(apiOpenGLES3);
FrameworkParams frameworkParams;

View file

@ -177,19 +177,16 @@ MainWindow::MainWindow(Framework & framework, bool apiOpenGLES3,
m_pDrawWidget = new DrawWidget(framework, apiOpenGLES3, std::move(screenshotParams), this);
setCentralWidget(m_pDrawWidget);
if (m_screenshotMode)
{
QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setSizePolicy(policy);
QSize size(static_cast<int>(screenshotParams->m_width), static_cast<int>(screenshotParams->m_height));
m_pDrawWidget->resize(size);
size.setHeight(size.height() + statusBar()->height());
setMaximumSize(size);
setMinimumSize(size);
m_pDrawWidget->setFixedSize(size);
setFixedSize(size);
}
setCentralWidget(m_pDrawWidget);
QObject::connect(m_pDrawWidget, SIGNAL(BeforeEngineCreation()), this, SLOT(OnBeforeEngineCreation()));
CreateCountryStatusControls();

View file

@ -75,7 +75,7 @@ bool ParsePointsStr(std::string const & pointsStr, std::list<std::pair<m2::Point
int zoom;
while (tupleIter)
{
if (ParsePoint(*tupleIter, ",", pt, zoom))
if (ParsePoint(*tupleIter, ", \t", pt, zoom))
{
points.emplace_back(pt, zoom);
}
@ -95,7 +95,7 @@ bool ParseRectsStr(std::string const & rectsStr, std::list<m2::RectD> & rects)
m2::RectD rect;
while (tupleIter)
{
if (ParseRect(*tupleIter, ",", rect))
if (ParseRect(*tupleIter, ", \t", rect))
{
rects.push_back(rect);
}