2017-08-01 62 views
0

我正在創建一個應用程序,當我釋放我的應用程序時使用QWebEngine我遇到了一個奇怪的問題!是我的基於GUI的應用程序打開控制檯!這project.pro文件控制檯在發佈模式下顯示QT MSVC 2015

#------------------------------------------------- 
# 
# Project created by QtCreator 2017-07-31T18:43:56 
# 
#------------------------------------------------- 

QT  += core gui webenginewidgets testlib 

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 

TARGET = Clicker 
TEMPLATE = app 

# The following define makes your compiler emit warnings if you use 
# any feature of Qt which as been marked as deprecated (the exact warnings 
# depend on your compiler). Please consult the documentation of the 
# deprecated API in order to know how to port your code away from it. 
DEFINES += QT_DEPRECATED_WARNINGS 

# You can also make your code fail to compile if you use deprecated APIs. 
# In order to do so, uncomment the following line. 
# You can also select to disable deprecated APIs only up to a certain version of Qt. 
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 


SOURCES += \ 
     main.cpp \ 
     mainwindow.cpp 

HEADERS += \ 
     mainwindow.h 

FORMS += \ 
     mainwindow.ui 

RESOURCES += \ 
    files.qrc 

win32:RC_ICONS += a.ico 

當控制檯打開它表明,在調試模式控制檯中顯示的一些數據,我想這個問題是使用QWebEngine控制檯顯示此數據來自網站加載在QWebEngineView數據總是與JS開始:這樣

js: Phaser.Cache.isSoundDecoded: Key "dealer_12" not found in Cache. 
[5684:3840:0731/214213.208:INFO:CONSOLE(27)] "Phaser.Cache.isSoundDecoded: Key "loose" not found in Cache.", source: example/libs.js (27) 

這是一些數據出現在控制檯所以問題是如何才能讓當我開始我的應用程序該控制檯不會出現?我不知道是什麼導致這個問題,不知道我應該搜索什麼?
更新
這是我的項目設置 here
的屏幕截圖,這是一個從我的應用程序,當我打開它後,我釋放的申請,並且所有的DLL文件複製到該文件夾​​目錄here

+0

如何構建您的應用程序? – vahancho

+0

我同意@vahancho。請向我們展示項目設置(屏幕截圖將執行)以及您正在使用的配置文件(默認,調試,發佈,發佈最小大小或發佈調試信息)。 – rbaleksandar

+1

這個問題看起來類似:https://stackoverflow.com/questions/760323/why-does-my-qt4-5-app-open-a-console-window-under-windows。您可以嘗試應用那裏描述的解決方案。 – vahancho

回答

0

感謝Vahancho截圖誰給我一個類似的問題的鏈接
來解決我在.pro文件中添加此到我的Qt工程Windows,這個問題

QT.testlib.CONFIG -= console 

,它的工作原因是當我在Qt中使用QTest庫時,它顯示默認情況下的控制檯
所以問題不在於使用QtWebEngine,因爲我期望的是