Compare commits

...

3 Commits

Author SHA1 Message Date
e4278a25e3 modified window 2025-11-13 22:53:55 +08:00
44b3fb6dbe Merge branch 'new_osg' of http://brigecode.icu:16623/PM/DYTSrouce into new_osg 2025-11-13 22:18:23 +08:00
6cf2b5921e modified z 2025-11-13 22:18:18 +08:00
7 changed files with 38 additions and 21 deletions

View File

@ -39,6 +39,7 @@ int main(int argc, char* argv[]) {
SpdLogger logger("logs/log.txt", 5);
Application::setAttribute(Qt::AA_EnableHighDpiScaling);
Application::setAttribute(Qt::AA_UseHighDpiPixmaps);
Application app(argc, argv);
app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);

View File

@ -850,19 +850,22 @@ bool GraphicsWindowQt::releaseContextImplementation()
void GraphicsWindowQt::swapBuffersImplementation()
{
_widget->swapBuffers();
if (_widget->isVisible())
{
_widget->swapBuffers();
// FIXME: the processDeferredEvents should really be executed in a GUI (main) thread context but
// I couln't find any reliable way to do this. For now, lets hope non of *GUI thread only operations* will
// be executed in a QGLWidget::event handler. On the other hand, calling GUI only operations in the
// QGLWidget event handler is an indication of a Qt bug.
if (_widget->getNumDeferredEvents() > 0)
_widget->processDeferredEvents();
// FIXME: the processDeferredEvents should really be executed in a GUI (main) thread context but
// I couln't find any reliable way to do this. For now, lets hope non of *GUI thread only operations* will
// be executed in a QGLWidget::event handler. On the other hand, calling GUI only operations in the
// QGLWidget event handler is an indication of a Qt bug.
if (_widget->getNumDeferredEvents() > 0)
_widget->processDeferredEvents();
// We need to call makeCurrent here to restore our previously current context
// which may be changed by the processDeferredEvents function.
if (QGLContext::currentContext() != _widget->context())
_widget->makeCurrent();
// We need to call makeCurrent here to restore our previously current context
// which may be changed by the processDeferredEvents function.
if (QGLContext::currentContext() != _widget->context())
_widget->makeCurrent();
}
}
void GraphicsWindowQt::requestWarpPointer( float x, float y )

View File

@ -2235,17 +2235,17 @@
<translation></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="143"/>
<location filename="../ui/FrameTitleBar.cpp" line="149"/>
<source>default</source>
<translation></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="143"/>
<location filename="../ui/FrameTitleBar.cpp" line="149"/>
<source>silver</source>
<translation></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="143"/>
<location filename="../ui/FrameTitleBar.cpp" line="149"/>
<source>blue</source>
<translation></translation>
</message>
@ -2309,7 +2309,7 @@
<translation></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="110"/>
<location filename="../ui/MainWindow.cpp" line="112"/>
<source>Main View</source>
<translation></translation>
</message>
@ -2435,12 +2435,12 @@
<context>
<name>OsgWidget</name>
<message>
<location filename="../viewer/OsgWidget.cpp" line="131"/>
<location filename="../viewer/OsgWidget.cpp" line="144"/>
<source>warning</source>
<translation></translation>
</message>
<message>
<location filename="../viewer/OsgWidget.cpp" line="132"/>
<location filename="../viewer/OsgWidget.cpp" line="145"/>
<source>open dyt file failed</source>
<translation>dyt文件失败</translation>
</message>
@ -2463,8 +2463,8 @@
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="26"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="55"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="160"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="167"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="166"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="173"/>
<source>play</source>
<translation></translation>
</message>
@ -2529,7 +2529,7 @@
<message>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="48"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="52"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="157"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="163"/>
<source>pause</source>
<translation></translation>
</message>

View File

@ -186,3 +186,9 @@ void FrameTitleBar::SetSysButton(unsigned int sysBtn) {
ui->sys_max->setVisible(static_cast<bool>(ftbButton_ & FTB_MAX));
ui->sys_close->setVisible(static_cast<bool>(ftbButton_ & FTB_CLOSE));
}
void FrameTitleBar::showEvent(QShowEvent * event)
{
OnMaxBtnClicked();
}

View File

@ -46,6 +46,8 @@ protected:
void mouseMoveEvent(QMouseEvent* event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;
virtual void showEvent(QShowEvent *event) override;
protected:
void OnMinBtnClicked();
void OnMaxBtnClicked();

View File

@ -40,7 +40,7 @@ MainFrame::MainFrame(QWidget *parent) :
assert(nullptr == s_instance);
s_instance = this;
ui->titleFrame->SetMainWidget(this);
ui->titleFrame->SetMainWidget(this);
ui->titleFrame->SetTitle(tr("Dyt"));
ui->titleFrame->InitMenuWidget();

View File

@ -285,6 +285,11 @@ void OsgWidget::OnPresetModelDropped(const QString& modelType, const QString& mo
height = 0.0;
}
if (height < 0.0)
{
height = 0.0;
}
bool success = false;
ModelInfo modelInfo = PresetModelConfigParser::Get().GetModelInfo(modelType, modelName, &success);
if (!success) {