Commit 0efb0517 authored by Daniel Mensinger's avatar Daniel Mensinger

fix deprectation warnings

parent 212ba934
......@@ -25,6 +25,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
#include <QSortFilterProxyModel>
using namespace KDevelop;
......@@ -69,7 +70,7 @@ QSize AsyncTreeView::sizeHint() const
for (int i = 0; i < model()->columnCount(); ++i) {
horizontalSize += columnWidth(i);
}
horizontalSize = qMin(horizontalSize, QApplication::desktop()->screenGeometry().width()*3/4);
horizontalSize = qMin(horizontalSize, QGuiApplication::primaryScreen()->geometry().width()*3/4);
return QSize(horizontalSize, margins.top() + margins.bottom() + sizeHintForRow(0));
}
......
......@@ -23,6 +23,7 @@
#include <QDesktopWidget>
#include <QMenuBar>
#include <QStatusBar>
#include <QScreen>
#include <KConfigGroup>
#include <KLocalizedString>
......@@ -378,11 +379,12 @@ bool MainWindow::queryClose()
QString MainWindow::screenKey() const
{
const int scnum = QApplication::desktop()->screenNumber(parentWidget());
QRect desk = QApplication::desktop()->screenGeometry(scnum);
QList<QScreen *> screens = QApplication::screens();
QRect desk = screens[scnum]->geometry();
// if the desktop is virtual then use virtual screen size
if (QApplication::desktop()->isVirtualDesktop())
desk = QApplication::desktop()->screenGeometry(QApplication::desktop()->screen());
if (QGuiApplication::primaryScreen()->virtualSiblings().size() > 1)
desk = QGuiApplication::primaryScreen()->virtualGeometry();
return QStringLiteral("Desktop %1 %2")
.arg(desk.width()).arg(desk.height());
......
......@@ -29,6 +29,7 @@
#include <QPalette>
#include <QPoint>
#include <QPointer>
#include <QScreen>
#include <QStyleOption>
#include <QStylePainter>
......@@ -104,7 +105,7 @@ void ActiveToolTipManager::doVisibility()
if (!fullGeometry.isEmpty()) {
QRect oldFullGeometry = fullGeometry;
QRect screenGeometry = QApplication::desktop()->screenGeometry(fullGeometry.topLeft());
QRect screenGeometry = QGuiApplication::screenAt(fullGeometry.topLeft())->geometry();
if (fullGeometry.bottom() > screenGeometry.bottom()) {
//Move up, avoiding the mouse-cursor
fullGeometry.moveBottom(fullGeometry.top() - 10);
......
......@@ -23,6 +23,7 @@ void foo() {
++i; int j = i;
noop();
noop();
(void)j; // Supress unused j warning
}
int main(int argc, char **argv) {
std::cout << "Hello, world!" << std::endl;
......@@ -31,7 +32,7 @@ int main(int argc, char **argv) {
(void)argc;(void)argv;
const char *x = "Hello";
std::cout << x << std::endl;
testStruct ts;
ts.a = 0;
ts.b = 1;
......
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