Commit 9277a0d7 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'Fix_warnings_Qt' into 'master'

Fix warnings qt

See merge request !185
parents b415bedd e246a14e
...@@ -270,7 +270,8 @@ Core::init() { ...@@ -270,7 +270,8 @@ Core::init() {
connect( coreWidget_->logWidget_->openMeshFilterAction_,SIGNAL(toggled(bool)), this, SLOT(enableOpenMeshErrorLog(bool)) ); connect( coreWidget_->logWidget_->openMeshFilterAction_,SIGNAL(toggled(bool)), this, SLOT(enableOpenMeshErrorLog(bool)) );
QRect rect = QApplication::desktop()->screenGeometry(); QScreen *screen = QGuiApplication::primaryScreen();
QRect rect = screen->geometry();
uint width = rect.width(); uint width = rect.width();
if ( width > 1000 ) { if ( width > 1000 ) {
......
...@@ -316,8 +316,12 @@ void Core::loadPlugins() ...@@ -316,8 +316,12 @@ void Core::loadPlugins()
* Remove static plugins from dynamically loaded list. * Remove static plugins from dynamically loaded list.
*/ */
{ {
QSet<QString> staticPlugins = QSet<QString>::fromList( QStringList list = QString::fromUtf8(cmake::static_plugins).split("\n");
QString::fromUtf8(cmake::static_plugins).split("\n")); #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QSet<QString> staticPlugins = QSet<QString>(list.begin(),list.end());
#else
QSet<QString> staticPlugins = QSet<QString>::fromList(list);
#endif
for (int i = 0; i < pluginlist.size(); ) { for (int i = 0; i < pluginlist.size(); ) {
const QString bn = QFileInfo(pluginlist[i]).fileName(); const QString bn = QFileInfo(pluginlist[i]).fileName();
if (staticPlugins.contains(bn)) { if (staticPlugins.contains(bn)) {
......
...@@ -590,7 +590,7 @@ QSurfaceFormat createFormat(QSurfaceFormat::OpenGLContextProfile _profile, int _ ...@@ -590,7 +590,7 @@ QSurfaceFormat createFormat(QSurfaceFormat::OpenGLContextProfile _profile, int _
if(_profile != QSurfaceFormat::CoreProfile) if(_profile != QSurfaceFormat::CoreProfile)
format.setOption(QSurfaceFormat::DeprecatedFunctions); format.setOption(QSurfaceFormat::DeprecatedFunctions);
if (_debugContext) if (_debugContext)
format.setOption(format.options() | QSurfaceFormat::DebugContext); format.setOption(QSurfaceFormat::DebugContext);
return format; return format;
} }
...@@ -739,7 +739,6 @@ int main(int argc, char **argv) ...@@ -739,7 +739,6 @@ int main(int argc, char **argv)
// OpenGL check // OpenGL check
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QApplication::setColorSpec( QApplication::CustomColor );
// Try creating a valid OpenGL context // Try creating a valid OpenGL context
/******************************/ /******************************/
......
...@@ -303,7 +303,7 @@ void QtWheel::redrawPixmap() { ...@@ -303,7 +303,7 @@ void QtWheel::redrawPixmap() {
QPainter paint; QPainter paint;
paint.begin( &pixmap_); paint.begin( &pixmap_);
pixmap_.fill( palette().background().color() ); pixmap_.fill( palette().window().color() );
// coords of wheel frame // coords of wheel frame
QRect contents = contentsRect(); QRect contents = contentsRect();
......
...@@ -504,10 +504,14 @@ void CoreWidget::applicationSnapshotDialog() { ...@@ -504,10 +504,14 @@ void CoreWidget::applicationSnapshotDialog() {
OpenFlipperSettings().setValue("Core/CurrentDir", QFileInfo(newName).absolutePath() ); OpenFlipperSettings().setValue("Core/CurrentDir", QFileInfo(newName).absolutePath() );
snapshotName_ = newName; snapshotName_ = newName;
dialog.hide();
//grabs only the widget (espacially in windows) #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
//todo: deprecated in QT 5.0, use QScreen instead QScreen* screen = window()->screen();
QPixmap pic = QPixmap::grabWindow( winId() ); QPixmap pic = screen->grabWindow( winId() );
#else
QPixmap pic = QPixmap::grabWindow( winId() );
#endif
QPainter painter (&pic); QPainter painter (&pic);
...@@ -534,8 +538,16 @@ void CoreWidget::applicationSnapshotDialog() { ...@@ -534,8 +538,16 @@ void CoreWidget::applicationSnapshotDialog() {
///Take a snapshot of the whole application ///Take a snapshot of the whole application
void CoreWidget::applicationSnapshot() { void CoreWidget::applicationSnapshot() {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QScreen* screen = window()->screen();
QPixmap pix = screen->grabWindow( winId() );
#else
QPixmap pix = QPixmap::grabWindow( winId() );
#endif
// Write image asynchronously // Write image asynchronously
QImage* pic = new QImage(QPixmap::grabWindow( winId() ).toImage()); QImage* pic = new QImage( pix.toImage() );
writeImageAsynchronously(pic, suggestSnapshotFilename(snapshotName_)); writeImageAsynchronously(pic, suggestSnapshotFilename(snapshotName_));
} }
......
...@@ -231,7 +231,7 @@ void HelpWidget::linkActivated(const QUrl& _url) { ...@@ -231,7 +231,7 @@ void HelpWidget::linkActivated(const QUrl& _url) {
void HelpWidget::startSearch() { void HelpWidget::startSearch() {
searchEngine_->search(searchEngine_->queryWidget()->query()); searchEngine_->search(searchEngine_->queryWidget()->searchInput());
} }
void HelpWidget::setHomeSite(const QString& _homeSite) { void HelpWidget::setHomeSite(const QString& _homeSite) {
......
...@@ -217,7 +217,7 @@ void PostProcessorDialog::slotMovePostProcessor(unsigned _from,unsigned _to) ...@@ -217,7 +217,7 @@ void PostProcessorDialog::slotMovePostProcessor(unsigned _from,unsigned _to)
QFrame* frame = createFrame(*postProcessorManager()[activeRowToRow_[_from]]); QFrame* frame = createFrame(*postProcessorManager()[activeRowToRow_[_from]]);
activeItem->setSizeHint(frame->sizeHint()); activeItem->setSizeHint(frame->sizeHint());
activeList->setItemWidget(activeItem,frame); activeList->setItemWidget(activeItem,frame);
activeList->setItemSelected(activeItem,true); activeItem->setSelected(true);
//swap postprocessor //swap postprocessor
const int chainPos = _from; const int chainPos = _from;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment