mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-20 13:44:12 +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
|
||||
{
|
||||
int32_t count;
|
||||
int32_t width[10];
|
||||
int32_t height[10];
|
||||
int32_t Max_width;
|
||||
int32_t Max_height;
|
||||
int32_t count = 0;
|
||||
int32_t width[10] = {};
|
||||
int32_t height[10]= {};
|
||||
int32_t Max_width = 0;
|
||||
int32_t Max_height= 0;
|
||||
}screen;
|
||||
struct Built
|
||||
{
|
||||
|
||||
@@ -241,6 +241,11 @@ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFacto
|
||||
QObject::connect(&app, &SingleApplication::receivedMessage,
|
||||
&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([=]()
|
||||
{
|
||||
// for debugging
|
||||
|
||||
@@ -80,6 +80,11 @@ class QETDiagramEditor : public QETMainWindow
|
||||
protected:
|
||||
bool event(QEvent *) override;
|
||||
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 &);
|
||||
void setUpElementsPanel ();
|
||||
void setUpElementsCollectionWidget();
|
||||
@@ -253,7 +258,6 @@ class QETDiagramEditor : public QETMainWindow
|
||||
QUndoGroup undo_group;
|
||||
AutoNumberingDockWidget *m_autonumbering_dock;
|
||||
int activeSubWindowIndex;
|
||||
bool m_first_show = true;
|
||||
SearchAndReplaceWidget m_search_and_replace_widget;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user