Migrate deprecated APIs (#418)
* migrate deprecated QLayout::setMargin -> QLayout::setContentMargins * migrate deprecated QRegExp -> QRegularExpression * remove deprecated QDesktopWidget header * migrage deprecated QDesktopWidget::width, height -> QScreen::geometry
This commit is contained in:
parent
2e5e68d50d
commit
e67a9992c2
|
@ -35,6 +35,7 @@
|
|||
#include <QJsonObject>
|
||||
#include "widgets/signalmessagedialog.h"
|
||||
#include <QApplication>
|
||||
#include <QRegularExpression>
|
||||
|
||||
Debugger::Debugger(QObject *parent) : QObject(parent),
|
||||
mForceUTF8(false),
|
||||
|
@ -2461,7 +2462,7 @@ MemoryModel::MemoryModel(int dataPerLine, QObject *parent):
|
|||
void MemoryModel::updateMemory(const QStringList &value)
|
||||
{
|
||||
int maxDataPerLine=-1;
|
||||
QRegExp delimiter("(\\s+)");
|
||||
QRegularExpression delimiter("(\\s+)");
|
||||
QList<PMemoryLine> newModel;
|
||||
for (int i=0;i<value.length();i++) {
|
||||
QString line = value[i].trimmed();
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <QMessageBox>
|
||||
#include <QStringList>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDir>
|
||||
#include <QScreen>
|
||||
#include <QLockFile>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <QMessageBox>
|
||||
#include <QStandardPaths>
|
||||
#include <QScreen>
|
||||
#include <QDesktopWidget>
|
||||
#include <QRegularExpression>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
@ -6443,19 +6442,23 @@ void Settings::UI::doLoad()
|
|||
mProblemOrder = intValue("problem_order",6);
|
||||
|
||||
//dialogs
|
||||
mCPUDialogWidth = intValue("cpu_dialog_width",977*qApp->desktop()->width()/1920);
|
||||
mCPUDialogHeight = intValue("cpu_dialog_height",622*qApp->desktop()->height()/1080);
|
||||
mCPUDialogSplitterPos = intValue("cpu_dialog_splitter",500*qApp->desktop()->width()/1920);
|
||||
mSettingsDialogWidth = intValue("settings_dialog_width",977*qApp->desktop()->width()/1920);
|
||||
mSettingsDialogHeight = intValue("settings_dialog_height",622*qApp->desktop()->height()/1080);
|
||||
mSettingsDialogSplitterPos = intValue("settings_dialog_splitter",300*qApp->desktop()->width()/1920);
|
||||
QRect geometry = qApp->primaryScreen()->geometry();
|
||||
int width = geometry.width();
|
||||
int height = geometry.height();
|
||||
|
||||
mNewProjectDialogWidth = intValue("new_project_dialog_width", 900*qApp->desktop()->width()/1920);
|
||||
mNewProjectDialogHeight = intValue("new_project_dialog_height", 600*qApp->desktop()->height()/1080);
|
||||
mNewClassDialogWidth = intValue("new_class_dialog_width", 642*qApp->desktop()->width()/1920);
|
||||
mNewClassDialogHeight = intValue("new_class_dialog_height", 300*qApp->desktop()->height()/1080);
|
||||
mNewHeaderDialogWidth = intValue("new_header_dialog_width", 642*qApp->desktop()->width()/1920);
|
||||
mNewHeaderDialogHeight = intValue("new_header_dialog_height", 300*qApp->desktop()->height()/1080);
|
||||
mCPUDialogWidth = intValue("cpu_dialog_width", 977 * width / 1920);
|
||||
mCPUDialogHeight = intValue("cpu_dialog_height", 622 * height / 1080);
|
||||
mCPUDialogSplitterPos = intValue("cpu_dialog_splitter", 500 * width / 1920);
|
||||
mSettingsDialogWidth = intValue("settings_dialog_width", 977 * width / 1920);
|
||||
mSettingsDialogHeight = intValue("settings_dialog_height", 622 * height / 1080);
|
||||
mSettingsDialogSplitterPos = intValue("settings_dialog_splitter", 300 * width / 1920);
|
||||
|
||||
mNewProjectDialogWidth = intValue("new_project_dialog_width", 900 * width / 1920);
|
||||
mNewProjectDialogHeight = intValue("new_project_dialog_height", 600 * height / 1080);
|
||||
mNewClassDialogWidth = intValue("new_class_dialog_width", 642 * width / 1920);
|
||||
mNewClassDialogHeight = intValue("new_class_dialog_height", 300 * height / 1080);
|
||||
mNewHeaderDialogWidth = intValue("new_header_dialog_width", 642 * width / 1920);
|
||||
mNewHeaderDialogHeight = intValue("new_header_dialog_height", 300 * height / 1080);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_VCS
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QModelIndex>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
|
|
@ -44,7 +44,7 @@ CodeCompletionPopup::CodeCompletionPopup(QWidget *parent) :
|
|||
mListView->setItemDelegate(mDelegate);
|
||||
setLayout(new QVBoxLayout());
|
||||
layout()->addWidget(mListView);
|
||||
layout()->setMargin(0);
|
||||
layout()->setContentsMargins(0, 0, 0, 0);
|
||||
mListView->setFocus();
|
||||
|
||||
mShowKeywords=true;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <QDesktopWidget>
|
||||
#include <qsynedit/document.h>
|
||||
#include "cpudialog.h"
|
||||
#include "ui_cpudialog.h"
|
||||
|
|
|
@ -39,7 +39,7 @@ HeaderCompletionPopup::HeaderCompletionPopup(QWidget* parent):QWidget(parent)
|
|||
mListView->setItemDelegate(mDelegate);
|
||||
setLayout(new QVBoxLayout());
|
||||
layout()->addWidget(mListView);
|
||||
layout()->setMargin(0);
|
||||
layout()->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
mListView->setFocus();
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <QMessageBox>
|
||||
#include <QDrag>
|
||||
#include <QMimeData>
|
||||
#include <QDesktopWidget>
|
||||
#include <QTextEdit>
|
||||
#include <QMimeData>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
#include "regexsearcher.h"
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace QSynedit {
|
||||
|
||||
|
|
Loading…
Reference in New Issue