Compare commits
3 Commits
2a05254ffb
...
e4278a25e3
| Author | SHA1 | Date | |
|---|---|---|---|
| e4278a25e3 | |||
| 44b3fb6dbe | |||
| 6cf2b5921e |
@ -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);
|
||||
|
||||
@ -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 )
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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();
|
||||
}
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user