Commit 5b54450d authored by dogmaphobic's avatar dogmaphobic

Changed all fonts to pixel sizes

parent 0ac8e637
...@@ -2,12 +2,16 @@ ...@@ -2,12 +2,16 @@
This is the master style sheet as well as the dark style. This style sheet should contain both This is the master style sheet as well as the dark style. This style sheet should contain both
color and size/positioning information for all styled controls. This sheet is always loaded first color and size/positioning information for all styled controls. This sheet is always loaded first
Then the user specified style sheet is loaded after it to override and color settings. Then the user specified style sheet is loaded after it to override and color settings.
Font sizes are defined with tokens, which are parsed and replaced at run time.
*/ */
* { * {
background-color: #222; background-color: #222;
color: #FFF; color: #FFF;
font-size: 12pt; font-size: FONT_NORMAL;
font-weight: lighter;
} }
QWidget#viewModeWidget { QWidget#viewModeWidget {
...@@ -128,7 +132,7 @@ QGroupBox::title { ...@@ -128,7 +132,7 @@ QGroupBox::title {
subcontrol-position: top center; subcontrol-position: top center;
margin: 0 3px 0 3px; margin: 0 3px 0 3px;
padding: 0 3px 0 0; padding: 0 3px 0 0;
font: bold 8px; font: bold FONT_SMALL;
color: #DDD; color: #DDD;
} }
...@@ -149,7 +153,7 @@ QLabel:disabled { ...@@ -149,7 +153,7 @@ QLabel:disabled {
} }
QLabel#noUas { QLabel#noUas {
font-size: 30pt; font-size: FONT_LARGE;
} }
QMessageBox { QMessageBox {
...@@ -158,7 +162,7 @@ QMessageBox { ...@@ -158,7 +162,7 @@ QMessageBox {
} }
QLabel#tabTitleLabel { QLabel#tabTitleLabel {
font-size: 28pt; font-size: FONT_LARGE;
font-weight: lighter; font-weight: lighter;
margin-top: 16px; margin-top: 16px;
margin-bottom: 8px; margin-bottom: 8px;
...@@ -166,7 +170,7 @@ QLabel#tabTitleLabel { ...@@ -166,7 +170,7 @@ QLabel#tabTitleLabel {
QLabel#instructionLabel { QLabel#instructionLabel {
color: #FEC654; color: #FEC654;
font-size: 26pt; font-size: FONT_LARGE;
} }
QLineEdit { QLineEdit {
...@@ -226,7 +230,7 @@ QPlainTextEdit { ...@@ -226,7 +230,7 @@ QPlainTextEdit {
border: 1px solid #777; border: 1px solid #777;
border-radius: 2px; border-radius: 2px;
font-family: "Monospace"; font-family: "Monospace";
font: large; font: FONT_SMALL;
} }
QProgressBar { QProgressBar {
...@@ -529,11 +533,10 @@ UASQuickViewItem QLabel { ...@@ -529,11 +533,10 @@ UASQuickViewItem QLabel {
padding: 0; padding: 0;
margin: 0; margin: 0;
min-height: 1em; min-height: 1em;
font-weight: bold;
} }
UASQuickViewItem QLabel#value { UASQuickViewItem QLabel#value {
font-size: 20pt; font-size: FONT_LARGE;
} }
UASView { UASView {
......
...@@ -97,7 +97,7 @@ QGCView { ...@@ -97,7 +97,7 @@ QGCView {
QGCLabel { QGCLabel {
id: header id: header
width: parent.width width: parent.width
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
text: "AIRFRAME CONFIG" text: "AIRFRAME CONFIG"
} }
...@@ -225,4 +225,4 @@ QGCView { ...@@ -225,4 +225,4 @@ QGCView {
} // Flow - summary boxes } // Flow - summary boxes
} // Scroll View - summary boxes } // Scroll View - summary boxes
} // QGCViewPanel } // QGCViewPanel
} // QGCView } // QGCView
\ No newline at end of file
...@@ -384,7 +384,7 @@ Item { ...@@ -384,7 +384,7 @@ Item {
QGCLabel { QGCLabel {
text: "FLIGHT MODES CONFIG" text: "FLIGHT MODES CONFIG"
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -973,7 +973,7 @@ Item { ...@@ -973,7 +973,7 @@ Item {
QGCLabel { QGCLabel {
text: "FLIGHT MODES CONFIG" text: "FLIGHT MODES CONFIG"
font.pointSize: ScreenTools.fontPointFactor * (20); font.pixelSize: ScreenTools.font20;
} }
QGCLabel { QGCLabel {
......
...@@ -115,12 +115,12 @@ QGCView { ...@@ -115,12 +115,12 @@ QGCView {
QGCLabel { QGCLabel {
text: "POWER CONFIG" text: "POWER CONFIG"
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
} }
QGCLabel { QGCLabel {
text: "Battery" text: "Battery"
font.pointSize: ScreenTools.mediumFontPointSize font.pixelSize: ScreenTools.mediumFontPixelSize
} }
Rectangle { Rectangle {
...@@ -234,7 +234,7 @@ QGCView { ...@@ -234,7 +234,7 @@ QGCView {
QGCLabel { QGCLabel {
text: "ESC Calibration" text: "ESC Calibration"
font.pointSize: ScreenTools.mediumFontPointSize font.pixelSize: ScreenTools.mediumFontPixelSize
} }
Rectangle { Rectangle {
...@@ -269,7 +269,7 @@ QGCView { ...@@ -269,7 +269,7 @@ QGCView {
width: (parent.width / 2) - 5 width: (parent.width / 2) - 5
QGCLabel { QGCLabel {
text: "Propeller Function" text: "Propeller Function"
font.pointSize: ScreenTools.fontPointFactor * (20); font.pixelSize: ScreenTools.font20;
} }
Rectangle { Rectangle {
width: parent.width width: parent.width
...@@ -282,7 +282,7 @@ QGCView { ...@@ -282,7 +282,7 @@ QGCView {
width: (parent.width / 2) - 5 width: (parent.width / 2) - 5
QGCLabel { QGCLabel {
text: "Magnetometer Distortion" text: "Magnetometer Distortion"
font.pointSize: ScreenTools.fontPointFactor * (20); font.pixelSize: ScreenTools.font20;
} }
Rectangle { Rectangle {
width: parent.width width: parent.width
...@@ -301,7 +301,7 @@ QGCView { ...@@ -301,7 +301,7 @@ QGCView {
} }
QGCLabel { QGCLabel {
text: "Advanced Power Settings" text: "Advanced Power Settings"
font.pointSize: ScreenTools.fontPointFactor * (20); font.pixelSize: ScreenTools.font20;
visible: showAdvanced.checked visible: showAdvanced.checked
} }
Rectangle { Rectangle {
......
...@@ -258,7 +258,7 @@ QGCView { ...@@ -258,7 +258,7 @@ QGCView {
QGCLabel { QGCLabel {
id: header id: header
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
text: "RADIO CONFIG" text: "RADIO CONFIG"
} }
......
...@@ -52,7 +52,7 @@ FactPanel { ...@@ -52,7 +52,7 @@ FactPanel {
QGCLabel { QGCLabel {
text: "SAFETY CONFIG" text: "SAFETY CONFIG"
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -60,7 +60,7 @@ FactPanel { ...@@ -60,7 +60,7 @@ FactPanel {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Return Home Triggers //-- Return Home Triggers
QGCLabel { text: "Triggers For Return Home"; font.pointSize: ScreenTools.mediumFontPointSize; } QGCLabel { text: "Triggers For Return Home"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
Item { height: 10; width: 10 } // spacer Item { height: 10; width: 10 } // spacer
...@@ -119,7 +119,7 @@ FactPanel { ...@@ -119,7 +119,7 @@ FactPanel {
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Return Home Settings //-- Return Home Settings
QGCLabel { text: "Return Home Settings"; font.pointSize: ScreenTools.mediumFontPointSize; } QGCLabel { text: "Return Home Settings"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
Item { height: 10; width: 10 } // spacer Item { height: 10; width: 10 } // spacer
...@@ -290,7 +290,7 @@ FactPanel { ...@@ -290,7 +290,7 @@ FactPanel {
QGCLabel { QGCLabel {
width: parent.width width: parent.width
font.pointSize: ScreenTools.mediumFontPointSize font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply."; text: "Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0 visible: fact.value !== 0
wrapMode: Text.Wrap wrapMode: Text.Wrap
...@@ -300,7 +300,7 @@ FactPanel { ...@@ -300,7 +300,7 @@ FactPanel {
QGCLabel { QGCLabel {
width: parent.width width: parent.width
font.pointSize: ScreenTools.mediumFontPointSize font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply."; text: "Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0 visible: fact.value !== 0
wrapMode: Text.Wrap wrapMode: Text.Wrap
......
...@@ -57,8 +57,8 @@ QGCView { ...@@ -57,8 +57,8 @@ QGCView {
// Used to pass help text to the preCalibrationDialog dialog // Used to pass help text to the preCalibrationDialog dialog
property string preCalibrationDialogHelp property string preCalibrationDialogHelp
readonly property int sideBarH1PointSize: (ScreenTools.defaultFontPointSize * 1.3 + 0.5) readonly property int sideBarH1PointSize: (ScreenTools.defaultFontPizelSize * 1.3 + 0.5)
readonly property int mainTextH1PointSize: (ScreenTools.defaultFontPointSize * 1.5 + 0.5) readonly property int mainTextH1PointSize: (ScreenTools.defaultFontPizelSize * 1.5 + 0.5)
readonly property int rotationColumnWidth: 250 readonly property int rotationColumnWidth: 250
readonly property var rotations: [ readonly property var rotations: [
...@@ -213,7 +213,7 @@ QGCView { ...@@ -213,7 +213,7 @@ QGCView {
id: compass0ComponentLabel id: compass0ComponentLabel
QGCLabel { QGCLabel {
font.pointSize: sideBarH1PointSize font.pixelSize: sideBarH1PointSize
text: "External Compass Orientation" text: "External Compass Orientation"
} }
...@@ -280,7 +280,7 @@ QGCView { ...@@ -280,7 +280,7 @@ QGCView {
QGCLabel { QGCLabel {
text: "SENSORS CONFIG" text: "SENSORS CONFIG"
font.pointSize: ScreenTools.largeFontPointSize font.pixelSize: ScreenTools.largeFontPixelSize
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
...@@ -408,7 +408,7 @@ QGCView { ...@@ -408,7 +408,7 @@ QGCView {
id: orientationCalAreaHelpText id: orientationCalAreaHelpText
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pointSize: ScreenTools.fontPointFactor * (22); font.pixelSize: ScreenTools.font22;
anchors.top: orientationCalArea.top anchors.top: orientationCalArea.top
anchors.left: orientationCalArea.left anchors.left: orientationCalArea.left
anchors.topMargin: 15 anchors.topMargin: 15
...@@ -480,7 +480,7 @@ QGCView { ...@@ -480,7 +480,7 @@ QGCView {
spacing: 5 spacing: 5
QGCLabel { QGCLabel {
font.pointSize: sideBarH1PointSize font.pixelSize: sideBarH1PointSize
text: "Autopilot Orientation" text: "Autopilot Orientation"
} }
...@@ -506,7 +506,7 @@ QGCView { ...@@ -506,7 +506,7 @@ QGCView {
id: compass0ComponentLabel2 id: compass0ComponentLabel2
QGCLabel { QGCLabel {
font.pointSize: sideBarH1PointSize font.pixelSize: sideBarH1PointSize
text: "External Compass Orientation" text: "External Compass Orientation"
} }
} }
...@@ -531,7 +531,7 @@ QGCView { ...@@ -531,7 +531,7 @@ QGCView {
id: compass1ComponentLabel2 id: compass1ComponentLabel2
QGCLabel { QGCLabel {
font.pointSize: sideBarH1PointSize font.pixelSize: sideBarH1PointSize
text: "External Compass 1 Orientation" text: "External Compass 1 Orientation"
} }
} }
...@@ -556,7 +556,7 @@ QGCView { ...@@ -556,7 +556,7 @@ QGCView {
id: compass2ComponentLabel2 id: compass2ComponentLabel2
QGCLabel { QGCLabel {
font.pointSize: sidebarH1PointSize font.pixelSize: sidebarH1PointSize
text: "Compass 2 Orientation" text: "Compass 2 Orientation"
} }
} }
......
...@@ -655,33 +655,16 @@ void QGCApplication::_loadCurrentStyle(void) ...@@ -655,33 +655,16 @@ void QGCApplication::_loadCurrentStyle(void)
} }
} }
// Now that we have the styles loaded we need to dpi adjust the font point sizes // Now that we have the styles loaded we need to adjust the font sizes.
QString dpiAdjustedStyles;
if (success) {
QTextStream styleStream(&styles, QIODevice::ReadOnly);
QRegularExpression regex("font-size:.+(\\d\\d)pt;");
while (!styleStream.atEnd()) {
QString adjustedLine;
QString line = styleStream.readLine();
QRegularExpressionMatch match = regex.match(line);
if (match.hasMatch()) {
//qDebug() << "found:" << line << match.captured(1);
adjustedLine = QString("font-size: %1pt;").arg(ScreenTools::adjustFontPointSize_s(match.captured(1).toDouble()));
//qDebug() << "adjusted:" << adjustedLine;
} else {
adjustedLine = line;
}
dpiAdjustedStyles += adjustedLine;
}
}
if (!dpiAdjustedStyles.isEmpty()) { QString fSmall = QString("%1px;").arg(ScreenTools::font10_s());
setStyleSheet(dpiAdjustedStyles); QString fNormal = QString("%1px;").arg(ScreenTools::defaultFontPizelSize_s());
} QString fLarge = QString("%1px;").arg(ScreenTools::largeFontPixelSize_s());
styles.replace("FONT_SMALL", fSmall);
styles.replace("FONT_NORMAL", fNormal);
styles.replace("FONT_LARGE", fLarge);
setStyleSheet(styles);
if (!success) { if (!success) {
// Fall back to plastique if we can't load our own // Fall back to plastique if we can't load our own
......
...@@ -66,7 +66,7 @@ QGCView { ...@@ -66,7 +66,7 @@ QGCView {
height: defaultTextHeight + (ScreenTools.pixelSizeFactor * (9)) height: defaultTextHeight + (ScreenTools.pixelSizeFactor * (9))
text: group text: group
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pointSize: ScreenTools.fontPointFactor * (16); font.pixelSize: ScreenTools.font16;
} }
Rectangle { Rectangle {
...@@ -142,7 +142,7 @@ QGCView { ...@@ -142,7 +142,7 @@ QGCView {
height: firstButton.height height: firstButton.height
QGCLabel { QGCLabel {
font.pointSize: ScreenTools.fontPointFactor * (20) font.pixelSize: ScreenTools.font20;
visible: fullMode visible: fullMode
text: "PARAMETER EDITOR" text: "PARAMETER EDITOR"
} }
...@@ -202,7 +202,7 @@ QGCView { ...@@ -202,7 +202,7 @@ QGCView {
height: contentHeight + (ScreenTools.pixelSizeFactor * (9)) height: contentHeight + (ScreenTools.pixelSizeFactor * (9))
text: "Component #: " + componentId.toString() text: "Component #: " + componentId.toString()
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pointSize: ScreenTools.fontPointFactor * (16); font.pixelSize: ScreenTools.font16;
} }
Repeater { Repeater {
...@@ -357,4 +357,4 @@ QGCView { ...@@ -357,4 +357,4 @@ QGCView {
} }
} // Rectangle - editorDialog } // Rectangle - editorDialog
} // Component - Editor Dialog } // Component - Editor Dialog
} // QGCView } // QGCView
\ No newline at end of file
...@@ -104,7 +104,7 @@ Button { ...@@ -104,7 +104,7 @@ Button {
id: text id: text
antialiasing: true antialiasing: true
text: control.text text: control.text
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
......
...@@ -29,7 +29,7 @@ CheckBox { ...@@ -29,7 +29,7 @@ CheckBox {
id: text id: text
text: control.text text: control.text
antialiasing: true antialiasing: true
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
anchors.centerIn: parent anchors.centerIn: parent
......
...@@ -11,7 +11,7 @@ ComboBox { ...@@ -11,7 +11,7 @@ ComboBox {
property bool __showHighlight: pressed | hovered property bool __showHighlight: pressed | hovered
style: ComboBoxStyle { style: ComboBoxStyle {
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
textColor: __showHighlight ? textColor: __showHighlight ?
control.__qgcPal.buttonHighlightText : control.__qgcPal.buttonHighlightText :
control.__qgcPal.buttonText control.__qgcPal.buttonText
......
...@@ -10,7 +10,7 @@ Text { ...@@ -10,7 +10,7 @@ Text {
property bool enabled: true property bool enabled: true
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
color: __qgcPal.text color: __qgcPal.text
antialiasing: true antialiasing: true
} }
...@@ -28,7 +28,7 @@ RadioButton { ...@@ -28,7 +28,7 @@ RadioButton {
Text { Text {
id: text id: text
text: control.text text: control.text
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
antialiasing: true antialiasing: true
anchors.centerIn: parent anchors.centerIn: parent
......
...@@ -50,7 +50,7 @@ TextField { ...@@ -50,7 +50,7 @@ TextField {
width: unitsLabelWidthGenerator.width width: unitsLabelWidthGenerator.width
text: control.unitsLabel text: control.unitsLabel
font.pointSize: ScreenTools.defaultFontPointSize font.pixelSize: ScreenTools.defaultFontPizelSize
antialiasing: true antialiasing: true
color: control.textColor color: control.textColor
......
...@@ -483,5 +483,37 @@ Rectangle { ...@@ -483,5 +483,37 @@ Rectangle {
} }
} }
} }
Row {
Column {
Text { font.pixelSize: 8; color: "white"; text: "Text Test 8px"; }
Text { font.pixelSize: 9; color: "white"; text: "Text Test 9px"; }
Text { font.pixelSize: 10; color: "white"; text: "Text Test 10px"; }
Text { font.pixelSize: 11; color: "white"; text: "Text Test 11px"; }
Text { font.pixelSize: 12; color: "white"; text: "Text Test 12px"; }
Text { font.pixelSize: 13; color: "white"; text: "Text Test 13px"; }
Text { font.pixelSize: 14; color: "white"; text: "Text Test 14px"; }
Text { font.pixelSize: 15; color: "white"; text: "Text Test 15px"; }
Text { font.pixelSize: 16; color: "white"; text: "Text Test 16px"; }
Text { font.pixelSize: 17; color: "white"; text: "Text Test 17px"; }
Text { font.pixelSize: 18; color: "white"; text: "Text Test 18px"; }
Text { font.pixelSize: 19; color: "white"; text: "Text Test 19px"; }
Text { font.pixelSize: 20; color: "white"; text: "Text Test 20px"; }
}
Column {
Text { font.pixelSize: 8; color: "white"; text: "Text Test 8pt"; }
Text { font.pixelSize: 9; color: "white"; text: "Text Test 9pt"; }
Text { font.pixelSize: 10; color: "white"; text: "Text Test 10pt"; }
Text { font.pixelSize: 11; color: "white"; text: "Text Test 11pt"; }
Text { font.pixelSize: 12; color: "white"; text: "Text Test 12pt"; }
Text { font.pixelSize: 13; color: "white"; text: "Text Test 13pt"; }
Text { font.pixelSize: 14; color: "white"; text: "Text Test 14pt"; }
Text { font.pixelSize: 15; color: "white"; text: "Text Test 15pt"; }
Text { font.pixelSize: 16; color: "white"; text: "Text Test 16pt"; }
Text { font.pixelSize: 17; color: "white"; text: "Text Test 17pt"; }
Text { font.pixelSize: 18; color: "white"; text: "Text Test 18pt"; }
Text { font.pixelSize: 19; color: "white"; text: "Text Test 19pt"; }
Text { font.pixelSize: 20; color: "white"; text: "Text Test 20pt"; }
}
}
} }
} }
...@@ -27,35 +27,55 @@ ...@@ -27,35 +27,55 @@
#include "ScreenTools.h" #include "ScreenTools.h"
#include "MainWindow.h" #include "MainWindow.h"
#include <QFont> // Pixel size, instead of a physical thing is actually a philosophical question when
#include <QFontMetrics> // it comes to Qt. Fonts are that and some heavy Kabalistic Voodoo added to the mix.
// The values below came from actually measuring the elements on the screen on these
const double ScreenTools::_defaultFontPointSize = 13; // devices. I have yet to find a constant from Qt so these things can be properly
const double ScreenTools::_mediumFontPointSize = 16; // computed at runtime.
const double ScreenTools::_largeFontPointSize = 20;
#if defined(Q_OS_OSX)
double ScreenTools::_pixelFactor = 1.0;
#elif defined(__ios__)
double ScreenTools::_pixelFactor = 0.75;
#elif defined(Q_OS_WIN)
double ScreenTools::_pixelFactor = 0.86;
#elif defined(__android__)
double ScreenTools::_pixelFactor = 2.5;
#elif defined(Q_OS_LINUX)
double ScreenTools::_pixelFactor = 1.0;
#endif
#if defined(__android__)
#define FONT_FACTOR 2
#else
#define FONT_FACTOR 1
#endif
int ScreenTools::_font8 = 8 * FONT_FACTOR;
int ScreenTools::_font9 = 9 * FONT_FACTOR;
int ScreenTools::_font10 = 10 * FONT_FACTOR;
int ScreenTools::_font11 = 11 * FONT_FACTOR;
int ScreenTools::_font12 = 12 * FONT_FACTOR;
int ScreenTools::_font13 = 13 * FONT_FACTOR;
int ScreenTools::_font14 = 14 * FONT_FACTOR;
int ScreenTools::_font15 = 15 * FONT_FACTOR;
int ScreenTools::_font16 = 16 * FONT_FACTOR;
int ScreenTools::_font17 = 17 * FONT_FACTOR;
int ScreenTools::_font18 = 18 * FONT_FACTOR;
int ScreenTools::_font19 = 19 * FONT_FACTOR;
int ScreenTools::_font20 = 20 * FONT_FACTOR;
int ScreenTools::_font21 = 21 * FONT_FACTOR;
int ScreenTools::_font22 = 22 * FONT_FACTOR;
ScreenTools::ScreenTools() ScreenTools::ScreenTools()
{ {
MainWindow* mainWindow = MainWindow::instance(); MainWindow* mainWindow = MainWindow::instance();