summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-12 19:21:35 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-12 19:21:35 (GMT)
commit7a45927166ae9d29e7f440b255f3463d5350c220 (patch)
tree1a4d1e4a0405280af999f59c15ba8e8cc9f87ab0 /src/corelib/kernel
parente9a0067ef4b272f1893522959dc15561970590ea (diff)
parent8576aa104528f9a2863fd097abc8bac5c956fdb8 (diff)
downloadQt-7a45927166ae9d29e7f440b255f3463d5350c220.zip
Qt-7a45927166ae9d29e7f440b255f3463d5350c220.tar.gz
Qt-7a45927166ae9d29e7f440b255f3463d5350c220.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (44 commits) QSlider and StyleSheet: fix one pixel error while drawing the SliderAddPage accelerate QWindowsPipeWriter for bigger chunks of data Fix antialiasing with transformed text in OpenGL2 paint engine Fix flattening of largely scaled, thin, dashed beziers. Increased the precision used to flatten beziers Fix QT_NO_MOVIE Fix compile error with QT_NO_ACTION in QtGui Fix QT_NO_COMPLETER Fix QT_NO_FSCOMPLETER Fix QT_NO_FILESYSTEMMODEL Build fix Safeguard ourselves against corrupt registry values for cleartype gamma fix cetest build properly qdrawhelper: optimize the fetch transformed bilinear functions Compile fix for WinCE Make sure the selectionChanged signal is not called too much Implement heightForWidth support for QTabWidget and QStackedLayout. Fix the doc for QFrame::frameStyle Don't use texture-from-pixmap if the target isn't GL_TEXTURE_2D Add runtime check for GLX >= 1.3 before using glXCreatePixmap ...
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp7
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp51
2 files changed, 17 insertions, 41 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 1a1f978..bf2e2e4 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -523,8 +523,6 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
}
-extern void set_winapp_name();
-
// ### move to QCoreApplicationPrivate constructor?
void QCoreApplication::init()
{
@@ -535,11 +533,6 @@ void QCoreApplication::init()
qt_locale_initialized = true;
#endif
-#ifdef Q_WS_WIN
- // Get the application name/instance if qWinMain() was not invoked
- set_winapp_name();
-#endif
-
Q_ASSERT_X(!self, "QCoreApplication", "there should be only one application object");
QCoreApplication::self = this;
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index c1925e7..320f801 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -52,26 +52,31 @@
QT_BEGIN_NAMESPACE
-char appFileName[MAX_PATH]; // application file name
-char theAppName[MAX_PATH]; // application name
-HINSTANCE appInst = 0; // handle to app instance
-HINSTANCE appPrevInst = 0; // handle to prev app instance
-int appCmdShow = 0;
bool usingWinMain = false; // whether the qWinMain() is used or not
+int appCmdShow = 0;
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
{
- return appInst;
+ return GetModuleHandle(0);
}
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
{
- return appPrevInst;
+ return 0;
}
Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
{
+#if defined(Q_OS_WINCE)
return appCmdShow;
+#else
+ STARTUPINFO startupInfo;
+ GetStartupInfo(&startupInfo);
+
+ return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
+ ? startupInfo.wShowWindow
+ : SW_SHOWDEFAULT;
+#endif
}
Q_CORE_EXPORT QString qAppFileName() // get application file name
@@ -115,25 +120,6 @@ Q_CORE_EXPORT QString qAppFileName() // get application file name
return res;
}
-void set_winapp_name()
-{
- static bool already_set = false;
- if (!already_set) {
- already_set = true;
-
- QString moduleName = qAppFileName();
-
- QByteArray filePath = moduleName.toLocal8Bit();
- QByteArray fileName = QFileInfo(moduleName).baseName().toLocal8Bit();
-
- memcpy(appFileName, filePath.constData(), filePath.length());
- memcpy(theAppName, fileName.constData(), fileName.length());
-
- if (appInst == 0)
- appInst = GetModuleHandle(0);
- }
-}
-
QString QCoreApplicationPrivate::appName() const
{
return QFileInfo(qAppFileName()).baseName();
@@ -198,20 +184,17 @@ void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
already_called = true;
usingWinMain = true;
- // Install default debug handler
-
+ // Install default debug handler
qInstallMsgHandler(qWinMsgHandler);
- // Create command line
-
+ // Create command line
argv = qWinCmdLine<char>(cmdParam, int(strlen(cmdParam)), argc);
- // Get Windows parameters
- appInst = instance;
- appPrevInst = prevInstance;
appCmdShow = cmdShow;
- set_winapp_name();
+ // Ignore Windows parameters
+ Q_UNUSED(instance);
+ Q_UNUSED(prevInstance);
}
/*!