Skip to content

Commit 27ee11b

Browse files
committed
Qt6 Changes
1 parent 2137ac4 commit 27ee11b

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

qtfred/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int main(int argc, char* argv[]) {
103103
QCoreApplication::setApplicationName("qtFRED");
104104

105105
QApplication app(argc, argv);
106-
QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
106+
//QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton); //No longer needed set by default
107107

108108
// Use Fusion style unconditionally — required for reliable dynamic palette switching
109109
QApplication::setStyle(QStyleFactory::create("Fusion"));

qtfred/src/ui/FredView.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ void FredView::on_actionRun_FreeSpace_2_Open_triggered(bool) {
738738

739739
QString args = QString::fromStdString(cmdline_build_string());
740740

741-
if (!QProcess::startDetached(exePath, args.split(' ', QString::SkipEmptyParts))) {
741+
if (!QProcess::startDetached(exePath, args.split(' ', Qt::SkipEmptyParts))) {
742742
QMessageBox::warning(this, tr("Run FreeSpace"),
743743
tr("Failed to launch: %1").arg(exePath));
744744
}
@@ -1903,13 +1903,16 @@ void FredView::initializePopupMenus() {
19031903
if (fred->cur_waypoint != nullptr) {
19041904
waypoint_instance = Objects[fred->cur_waypoint->get_objnum()].instance;
19051905
}
1906-
_viewport->createWaypointAtScreenPos(_lastContextMenuLocalPos.x(), _lastContextMenuLocalPos.y(), waypoint_instance);
1906+
_viewport->createWaypointAtScreenPos(_lastContextMenuLocalPos.x() * this->devicePixelRatio(),
1907+
_lastContextMenuLocalPos.y() * this->devicePixelRatio(),
1908+
waypoint_instance);
19071909
});
19081910
createOtherSubmenu->addAction(createWaypointAction);
19091911

19101912
auto* createJumpNodeAction = new QAction(tr("Jump Node"), createOtherSubmenu);
19111913
connect(createJumpNodeAction, &QAction::triggered, this, [this]() {
1912-
_viewport->createJumpNodeAtScreenPos(_lastContextMenuLocalPos.x(), _lastContextMenuLocalPos.y());
1914+
_viewport->createJumpNodeAtScreenPos(_lastContextMenuLocalPos.x() * this->devicePixelRatio(),
1915+
_lastContextMenuLocalPos.y() * this->devicePixelRatio());
19131916
});
19141917
createOtherSubmenu->addAction(createJumpNodeAction);
19151918

@@ -1989,7 +1992,8 @@ void FredView::populateCreateShipSubmenu() {
19891992
}
19901993
auto* action = new QAction(QString::fromUtf8(Ship_info[i].name), _createShipSubmenu);
19911994
connect(action, &QAction::triggered, this, [this, i]() {
1992-
_viewport->createShipAtScreenPos(_lastContextMenuLocalPos.x(), _lastContextMenuLocalPos.y(), i);
1995+
_viewport->createShipAtScreenPos(_lastContextMenuLocalPos.x() * this->devicePixelRatio(),
1996+
_lastContextMenuLocalPos.y() * this->devicePixelRatio(), i);
19931997
});
19941998
_createShipSubmenu->addAction(action);
19951999
}
@@ -2002,7 +2006,9 @@ void FredView::populateCreatePropSubmenu() {
20022006
}
20032007
auto* action = new QAction(QString::fromStdString(Prop_info[i].name), _createPropSubmenu);
20042008
connect(action, &QAction::triggered, this, [this, i]() {
2005-
_viewport->createPropAtScreenPos(_lastContextMenuLocalPos.x(), _lastContextMenuLocalPos.y(), i);
2009+
_viewport->createPropAtScreenPos(_lastContextMenuLocalPos.x() * this->devicePixelRatio(),
2010+
_lastContextMenuLocalPos.y() * this->devicePixelRatio(),
2011+
i);
20062012
});
20072013
_createPropSubmenu->addAction(action);
20082014
}
@@ -3037,6 +3043,5 @@ void FredView::on_actionWaypointPathGenerator_triggered(bool) {
30373043
dialog->setAttribute(Qt::WA_DeleteOnClose);
30383044
dialog->show();
30393045
}
3040-
30413046
} // namespace fred
30423047
} // namespace fso

0 commit comments

Comments
 (0)