mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
UI: Fix warnings for Qt 5.15
AllDockWidgetFeatures is now deprecated. Use underlying values instead. Use default QFlags constructor instead of nullptr/0. Use QWheelEvent::angleDelta() in place of orientation() and delta(), and position() in place of x() and y().
This commit is contained in:
parent
b1d03ae367
commit
c2ddc428b0
@ -431,7 +431,7 @@
|
||||
<widget class="OBSBasicStatusBar" name="statusbar"/>
|
||||
<widget class="OBSDock" name="scenesDock">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Basic.Main.Scenes</string>
|
||||
@ -566,7 +566,7 @@
|
||||
</widget>
|
||||
<widget class="OBSDock" name="sourcesDock">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Basic.Main.Sources</string>
|
||||
@ -702,7 +702,7 @@
|
||||
</widget>
|
||||
<widget class="OBSDock" name="mixerDock">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Mixer</string>
|
||||
@ -842,7 +842,7 @@
|
||||
</widget>
|
||||
<widget class="OBSDock" name="transitionsDock">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Basic.SceneTransitions</string>
|
||||
@ -1089,7 +1089,7 @@
|
||||
</widget>
|
||||
<widget class="OBSDock" name="controlsDock">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Basic.Main.Controls</string>
|
||||
|
@ -1686,7 +1686,7 @@ bool WidgetInfo::ColorChanged(const char *setting)
|
||||
long long val = obs_data_get_int(view->settings, setting);
|
||||
QColor color = color_from_int(val);
|
||||
|
||||
QColorDialog::ColorDialogOptions options = 0;
|
||||
QColorDialog::ColorDialogOptions options;
|
||||
|
||||
/* The native dialog on OSX has all kinds of problems, like closing
|
||||
* other open QDialogs on exit, and
|
||||
|
@ -24,7 +24,7 @@ signals:
|
||||
|
||||
public:
|
||||
OBSQTDisplay(QWidget *parent = nullptr,
|
||||
Qt::WindowFlags flags = nullptr);
|
||||
Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
|
||||
virtual QPaintEngine *paintEngine() const override;
|
||||
|
||||
|
@ -264,7 +264,7 @@ void ExecuteFuncSafeBlockMsgBox(std::function<void()> func,
|
||||
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowCloseButtonHint);
|
||||
dlg.setWindowTitle(title);
|
||||
dlg.setText(text);
|
||||
dlg.setStandardButtons(0);
|
||||
dlg.setStandardButtons(QMessageBox::StandardButtons());
|
||||
|
||||
auto wait = [&]() {
|
||||
func();
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
OBSSignal destroyedSignal;
|
||||
|
||||
OBSSourceLabel(const obs_source_t *source, QWidget *parent = nullptr,
|
||||
Qt::WindowFlags f = 0)
|
||||
Qt::WindowFlags f = Qt::WindowFlags())
|
||||
: QLabel(obs_source_get_name(source), parent, f),
|
||||
renamedSignal(obs_source_get_signal_handler(source), "rename",
|
||||
&OBSSourceLabel::SourceRenamed, this),
|
||||
|
@ -830,7 +830,7 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
|
||||
streamPage->ui->preferHardware->setChecked(preferHardware);
|
||||
}
|
||||
|
||||
setOptions(0);
|
||||
setOptions(QWizard::WizardOptions());
|
||||
setButtonText(QWizard::FinishButton,
|
||||
QTStr("Basic.AutoConfig.ApplySettings"));
|
||||
setButtonText(QWizard::BackButton, QTStr("Back"));
|
||||
|
@ -314,22 +314,32 @@ bool OBSBasicInteraction::HandleMouseWheelEvent(QWheelEvent *event)
|
||||
int xDelta = 0;
|
||||
int yDelta = 0;
|
||||
|
||||
const QPoint angleDelta = event->angleDelta();
|
||||
if (!event->pixelDelta().isNull()) {
|
||||
if (event->orientation() == Qt::Horizontal)
|
||||
if (angleDelta.x())
|
||||
xDelta = event->pixelDelta().x();
|
||||
else
|
||||
yDelta = event->pixelDelta().y();
|
||||
} else {
|
||||
if (event->orientation() == Qt::Horizontal)
|
||||
xDelta = event->delta();
|
||||
if (angleDelta.x())
|
||||
xDelta = angleDelta.x();
|
||||
else
|
||||
yDelta = event->delta();
|
||||
yDelta = angleDelta.y();
|
||||
}
|
||||
|
||||
if (GetSourceRelativeXY(event->x(), event->y(), mouseEvent.x,
|
||||
mouseEvent.y))
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
const QPointF position = event->position();
|
||||
const int x = position.x();
|
||||
const int y = position.y();
|
||||
#else
|
||||
const int x = event->x();
|
||||
const int y = event->y();
|
||||
#endif
|
||||
|
||||
if (GetSourceRelativeXY(x, y, mouseEvent.x, mouseEvent.y)) {
|
||||
obs_source_send_mouse_wheel(source, &mouseEvent, xDelta,
|
||||
yDelta);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -221,7 +221,9 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
|
||||
statsDock = new OBSDock();
|
||||
statsDock->setObjectName(QStringLiteral("statsDock"));
|
||||
statsDock->setFeatures(QDockWidget::AllDockWidgetFeatures);
|
||||
statsDock->setFeatures(QDockWidget::DockWidgetClosable |
|
||||
QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable);
|
||||
statsDock->setWindowTitle(QTStr("Basic.Stats"));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, statsDock);
|
||||
statsDock->setVisible(false);
|
||||
@ -6982,7 +6984,9 @@ void OBSBasic::on_lockUI_toggled(bool lock)
|
||||
{
|
||||
QDockWidget::DockWidgetFeatures features =
|
||||
lock ? QDockWidget::NoDockWidgetFeatures
|
||||
: QDockWidget::AllDockWidgetFeatures;
|
||||
: (QDockWidget::DockWidgetClosable |
|
||||
QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable);
|
||||
|
||||
QDockWidget::DockWidgetFeatures mainFeatures = features;
|
||||
mainFeatures &= ~QDockWidget::QDockWidget::DockWidgetClosable;
|
||||
@ -7652,7 +7656,9 @@ QAction *OBSBasic::AddDockWidget(QDockWidget *dock)
|
||||
bool lock = ui->lockUI->isChecked();
|
||||
QDockWidget::DockWidgetFeatures features =
|
||||
lock ? QDockWidget::NoDockWidgetFeatures
|
||||
: QDockWidget::AllDockWidgetFeatures;
|
||||
: (QDockWidget::DockWidgetClosable |
|
||||
QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable);
|
||||
|
||||
dock->setFeatures(features);
|
||||
|
||||
|
@ -495,13 +495,15 @@ void OBSBasicPreview::keyReleaseEvent(QKeyEvent *event)
|
||||
|
||||
void OBSBasicPreview::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (scrollMode && IsFixedScaling() &&
|
||||
event->orientation() == Qt::Vertical) {
|
||||
if (event->delta() > 0)
|
||||
SetScalingLevel(scalingLevel + 1);
|
||||
else if (event->delta() < 0)
|
||||
SetScalingLevel(scalingLevel - 1);
|
||||
emit DisplayResized();
|
||||
if (scrollMode && IsFixedScaling()) {
|
||||
const int delta = event->angleDelta().y();
|
||||
if (delta != 0) {
|
||||
if (delta > 0)
|
||||
SetScalingLevel(scalingLevel + 1);
|
||||
else
|
||||
SetScalingLevel(scalingLevel - 1);
|
||||
emit DisplayResized();
|
||||
}
|
||||
}
|
||||
|
||||
OBSQTDisplay::wheelEvent(event);
|
||||
|
@ -105,7 +105,8 @@ private:
|
||||
void ProcessClick(const vec2 &pos);
|
||||
|
||||
public:
|
||||
OBSBasicPreview(QWidget *parent, Qt::WindowFlags flags = 0);
|
||||
OBSBasicPreview(QWidget *parent,
|
||||
Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
~OBSBasicPreview();
|
||||
|
||||
static OBSBasicPreview *Get();
|
||||
|
Loading…
Reference in New Issue
Block a user