mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-20 22:04:13 +02:00
Merge pull request #515 from ispyisail/fix/valgrind-uninit-machineinfo-firstshow
Thank you @ispyisail
This commit is contained in:
@@ -75,11 +75,11 @@ class MachineInfo
|
|||||||
{
|
{
|
||||||
struct Screen
|
struct Screen
|
||||||
{
|
{
|
||||||
int32_t count;
|
int32_t count = 0;
|
||||||
int32_t width[10];
|
int32_t width[10] = {};
|
||||||
int32_t height[10];
|
int32_t height[10]= {};
|
||||||
int32_t Max_width;
|
int32_t Max_width = 0;
|
||||||
int32_t Max_height;
|
int32_t Max_height= 0;
|
||||||
}screen;
|
}screen;
|
||||||
struct Built
|
struct Built
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,6 +241,11 @@ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFacto
|
|||||||
QObject::connect(&app, &SingleApplication::receivedMessage,
|
QObject::connect(&app, &SingleApplication::receivedMessage,
|
||||||
&qetapp, &QETApp::receiveMessage);
|
&qetapp, &QETApp::receiveMessage);
|
||||||
|
|
||||||
|
// Pre-initialise on the main (GUI) thread: the constructor calls
|
||||||
|
// qApp->screens() which is not thread-safe in Qt5 — calling instance()
|
||||||
|
// here guarantees the singleton is fully built before the worker runs.
|
||||||
|
MachineInfo::instance();
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
// for debugging
|
// for debugging
|
||||||
|
|||||||
@@ -80,6 +80,11 @@ class QETDiagramEditor : public QETMainWindow
|
|||||||
protected:
|
protected:
|
||||||
bool event(QEvent *) override;
|
bool event(QEvent *) override;
|
||||||
private:
|
private:
|
||||||
|
// Declared first so it is initialised before any member whose
|
||||||
|
// constructor may dispatch a Qt event calling event() (e.g. the
|
||||||
|
// QActionGroup members below trigger QObject::setParent events).
|
||||||
|
bool m_first_show = true;
|
||||||
|
|
||||||
QETDiagramEditor(const QETDiagramEditor &);
|
QETDiagramEditor(const QETDiagramEditor &);
|
||||||
void setUpElementsPanel ();
|
void setUpElementsPanel ();
|
||||||
void setUpElementsCollectionWidget();
|
void setUpElementsCollectionWidget();
|
||||||
@@ -253,7 +258,6 @@ class QETDiagramEditor : public QETMainWindow
|
|||||||
QUndoGroup undo_group;
|
QUndoGroup undo_group;
|
||||||
AutoNumberingDockWidget *m_autonumbering_dock;
|
AutoNumberingDockWidget *m_autonumbering_dock;
|
||||||
int activeSubWindowIndex;
|
int activeSubWindowIndex;
|
||||||
bool m_first_show = true;
|
|
||||||
SearchAndReplaceWidget m_search_and_replace_widget;
|
SearchAndReplaceWidget m_search_and_replace_widget;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user