Qt6 port:

* QApplication::setFallbackSessionManagementEnabled has been removed
* QString::medRef() has been removed. Use QString::mid() again.
* QTextStream::setCodec has been removed
* Use operator QVariant of the QFont class to make code Qt5 and Qt6 compatible
* Signature of QTreeWidget::mimeData() has changed in Qt6. Remove TreeWidget::mimeData() because it doesn't change the implementation
* QLayout::setMargin() is deprecated in Qt5 and has been removed in Qt6. Use QLayout::setContentsMargins()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QDesktopWidget is deprecated in Qt5 and has been removed in Qt6. Use QScreen
This commit is contained in:
wmayer
2022-11-01 16:55:40 +01:00
parent 1337203415
commit af0a014cf2
31 changed files with 50 additions and 52 deletions

View File

@@ -22,6 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <algorithm>
# include <Bnd_Box.hxx>
# include <BRep_Builder.hxx>
# include <BRep_Tool.hxx>

View File

@@ -429,7 +429,7 @@ void DlgFilletEdges::onSelectEdge(const QString& subelement, int type)
void DlgFilletEdges::onSelectEdgesOfFace(const QString& subelement, int type)
{
bool ok;
int index = subelement.midRef(4).toInt(&ok);
int index = subelement.mid(4).toInt(&ok);
if (ok) {
try {
const TopoDS_Shape& face = d->all_faces.FindKey(index);

View File

@@ -735,9 +735,7 @@ void TaskExtrudeParameters::translateFaceName()
if (ok) {
ui->lineFaceName->setText(QString::fromLatin1("%1:%2%3")
.arg(parts[0],
tr("Face"),
QString(faceId)));
.arg(parts[0], tr("Face")).arg(faceId));
}
else {
ui->lineFaceName->setText(parts[0]);

View File

@@ -51,7 +51,7 @@ SketcherSettings::SketcherSettings(QWidget* parent)
ui->setupUi(this);
QGridLayout* gridLayout = new QGridLayout(ui->placeholder);
gridLayout->setSpacing(0);
gridLayout->setMargin(0);
gridLayout->setContentsMargins(0, 0, 0, 0);
form = new SketcherGeneralWidget(ui->placeholder);
gridLayout->addWidget(form, 0, 0, 1, 1);
}

View File

@@ -36,7 +36,6 @@
# include <cfloat>
# include <algorithm>
# include <QFontMetrics>
# include <QGLWidget>
# include <QPainter>
# include <QPen>
# include <Inventor/SoPrimitiveVertex.h>
@@ -113,7 +112,7 @@ void SoDatumLabel::drawImage()
return;
}
QFont font(QString::fromLatin1(name.getValue()), size.getValue());
QFont font(QString::fromLatin1(name.getValue(), -1), size.getValue());
QFontMetrics fm(font);
QString str = QString::fromUtf8(s[0].getString());

View File

@@ -39,13 +39,13 @@
# include <QAction>
# include <QApplication>
# include <QColor>
# include <QDesktopWidget>
# include <QDialog>
# include <QFont>
# include <QKeyEvent>
# include <QMenu>
# include <QMessageBox>
# include <QPainter>
# include <QScreen>
# include <QTextStream>
#endif
@@ -3629,7 +3629,7 @@ int ViewProviderSketch::defaultFontSizePixels() const
}
int ViewProviderSketch::getApplicationLogicalDPIX() const {
return QApplication::desktop()->logicalDpiX();
return int(QApplication::primaryScreen()->logicalDotsPerInchX());
}
int ViewProviderSketch::getViewOrientationFactor() const {

View File

@@ -46,7 +46,7 @@
****************************************************************************/
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
#include <QPainter>
#include <QPushButton>
#include <QColorDialog>
@@ -315,7 +315,7 @@ void QtColorPicker::buttonPressed(bool toggled)
if (!toggled)
return;
const QRect desktop = QApplication::activeWindow()->geometry();
const QRect desktop = QApplication::primaryScreen()->geometry();
// Make sure the popup is inside the desktop.
QPoint pos = mapToGlobal(rect().bottomLeft());
@@ -872,7 +872,7 @@ void ColorPickerPopup::regenerateGrid()
// one.
if (grid) delete grid;
grid = new QGridLayout(this);
grid->setMargin(1);
grid->setContentsMargins(1, 1, 1, 1);
grid->setSpacing(0);
int ccol = 0, crow = 0;