remove QT4 references
This commit is contained in:
@@ -175,11 +175,6 @@ macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
|
||||
endmacro(generate_from_any)
|
||||
|
||||
|
||||
# generates the ui -> cpp h files
|
||||
#macro(qt4_wrap_ui infiles )
|
||||
#
|
||||
#endmacro(qt4_wrap_ui)
|
||||
|
||||
|
||||
MACRO(ADD_MSVC_PRECOMPILED_HEADER TargetName PrecompiledHeader PrecompiledSource SourcesVar)
|
||||
IF(MSVC)
|
||||
|
||||
@@ -7,14 +7,7 @@ set(OCE_DIR ${FREECAD_LIBPACK_DIR}/lib/cmake CACHE PATH "" FORCE)
|
||||
|
||||
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/swig/swig.exe CACHE FILEPATH "Swig" FORCE)
|
||||
|
||||
#set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe CACHE FILEPATH "" FORCE)
|
||||
#set(PYTHON_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27.lib CACHE FILEPATH "" FORCE)
|
||||
#set(PYTHON_DEBUG_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27_d.lib CACHE FILEPATH "" FORCE)
|
||||
#set(PYTHON_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/python2.7 CACHE PATH "" FORCE)
|
||||
|
||||
if (BUILD_QT5)
|
||||
|
||||
# default Qt5 stuff
|
||||
# Set paths to cmake config files for each Qt module
|
||||
set(Qt5_ROOT_DIR ${FREECAD_LIBPACK_DIR} CACHE PATH "")
|
||||
|
||||
@@ -48,8 +41,6 @@ set (Qt5Widgets_DIR ${Qt5_ROOT_DIR}/lib/cmake/Qt5Widgets CACHE PATH "")
|
||||
set (Qt5Xml_DIR ${Qt5_ROOT_DIR}/lib/cmake/Qt5Xml CACHE PATH "")
|
||||
set (Qt5XmlPatterns_DIR ${Qt5_ROOT_DIR}/lib/cmake/Qt5XmlPatterns CACHE PATH "")
|
||||
|
||||
endif (BUILD_QT5)
|
||||
|
||||
find_library(XercesC_LIBRARY_RELEASE xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(XercesC_LIBRARY_DEBUG xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
|
||||
set (XercesC_LIBRARIES debug ${XercesC_LIBRARY_DEBUG} optimized ${XercesC_LIBRARY_RELEASE})
|
||||
|
||||
@@ -118,8 +118,6 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
boldFont.setBold(true);
|
||||
defaultColor = paramGroup->topLevelItem(0)->foreground(0);
|
||||
|
||||
// set a placeholder text to inform the user
|
||||
// (QLineEdit has no placeholderText property in Qt4)
|
||||
ui->findGroupLE->setPlaceholderText(tr("Search Group"));
|
||||
}
|
||||
|
||||
|
||||
@@ -547,7 +547,6 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
//shouldn't happen. Gestures are not expected to start in the middle of navigation.
|
||||
//we'll consume it, without reacting.
|
||||
processed=true;
|
||||
//This does, unfortunately, happen on regular basis for pan gesture on Windows8.1+Qt4.8
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@ TreeWidget::TreeWidget(const char* name, QWidget* parent)
|
||||
this->rootItem->setFlags(Qt::ItemIsEnabled);
|
||||
this->expandItem(this->rootItem);
|
||||
this->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
// causes unexpected drop events (possibly only with Qt4.1.x)
|
||||
|
||||
this->setMouseTracking(true); // needed for itemEntered() to work
|
||||
|
||||
|
||||
|
||||
@@ -172,39 +172,14 @@ Py::Object PySideUicModule::loadUi(const Py::Tuple& args)
|
||||
|
||||
QString cmd;
|
||||
QTextStream str(&cmd);
|
||||
#if 0
|
||||
// https://github.com/lunaryorn/snippets/blob/master/qt4/designer/pyside_dynamic.py
|
||||
str << "from PySide import QtCore, QtGui, QtUiTools\n"
|
||||
<< "import FreeCADGui"
|
||||
<< "\n"
|
||||
<< "class UiLoader(QtUiTools.QUiLoader):\n"
|
||||
<< " def __init__(self, baseinstance):\n"
|
||||
<< " QtUiTools.QUiLoader.__init__(self, baseinstance)\n"
|
||||
<< " self.baseinstance = baseinstance\n"
|
||||
<< " self.ui = FreeCADGui.UiLoader()\n"
|
||||
<< "\n"
|
||||
<< " def createWidget(self, class_name, parent=None, name=''):\n"
|
||||
<< " if parent is None and self.baseinstance:\n"
|
||||
<< " return self.baseinstance\n"
|
||||
<< " else:\n"
|
||||
<< " widget = self.ui.createWidget(class_name, parent, name)\n"
|
||||
<< " if not widget:\n"
|
||||
<< " widget = QtUiTools.QUiLoader.createWidget(self, class_name, parent, name)\n"
|
||||
<< " if self.baseinstance:\n"
|
||||
<< " setattr(self.baseinstance, name, widget)\n"
|
||||
<< " return widget\n"
|
||||
<< "\n"
|
||||
<< "loader = UiLoader(globals()[\"base_\"])\n"
|
||||
<< "widget = loader.load(globals()[\"uiFile_\"])\n"
|
||||
<< "\n";
|
||||
#else
|
||||
|
||||
str << "from PySide2 import QtCore, QtGui, QtWidgets\n"
|
||||
<< "import FreeCADGui"
|
||||
<< "\n"
|
||||
<< "loader = FreeCADGui.UiLoader()\n"
|
||||
<< "widget = loader.load(globals()[\"uiFile_\"])\n"
|
||||
<< "\n";
|
||||
#endif
|
||||
|
||||
|
||||
PyObject* result = PyRun_String((const char*)cmd.toLatin1(), Py_file_input, d.ptr(), d.ptr());
|
||||
if (result) {
|
||||
|
||||
@@ -52,19 +52,17 @@ if(HOMEBREW_PREFIX)
|
||||
endforeach(PTH_FILE)
|
||||
endif()
|
||||
|
||||
if(BUILD_QT5)
|
||||
set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins")
|
||||
execute_process(COMMAND "xcode-select" "--print-path"
|
||||
OUTPUT_VARIABLE XCODE_PATH
|
||||
ERROR_QUIET
|
||||
)
|
||||
string(STRIP ${XCODE_PATH} XCODE_PATH)
|
||||
set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins")
|
||||
execute_process(COMMAND "xcode-select" "--print-path"
|
||||
OUTPUT_VARIABLE XCODE_PATH
|
||||
ERROR_QUIET
|
||||
)
|
||||
string(STRIP ${XCODE_PATH} XCODE_PATH)
|
||||
|
||||
set(XCTEST_PATH "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/Current")
|
||||
set(XCTEST_PATH "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/Current")
|
||||
|
||||
# add qt assistant to bundle
|
||||
install(PROGRAMS "${Qt5Core_DIR}/../../../libexec/Assistant.app/Contents/MacOS/Assistant" DESTINATION ${CMAKE_INSTALL_PREFIX}/MacOS)
|
||||
endif(BUILD_QT5)
|
||||
# add qt assistant to bundle
|
||||
install(PROGRAMS "${Qt5Core_DIR}/../../../libexec/Assistant.app/Contents/MacOS/Assistant" DESTINATION ${CMAKE_INSTALL_PREFIX}/MacOS)
|
||||
|
||||
# add QtWebEngineProcess to bundle
|
||||
if(BUILD_WEB)
|
||||
|
||||
@@ -28,7 +28,6 @@ if(MSVC)
|
||||
importlib_umfpackamd.lib
|
||||
${SMSH_LIBRARIES}
|
||||
${SMESH_LIBRARIES}
|
||||
#OCCAdaptMesh
|
||||
)
|
||||
else(MSVC)
|
||||
set(CamGui_LIBS
|
||||
@@ -47,7 +46,7 @@ SOURCE_GROUP("Moc" FILES ${CamGui_MOC_SRCS})
|
||||
set(CamGui_UIC_SRCS
|
||||
Cutting.ui
|
||||
)
|
||||
qt4_wrap_ui(CamGui_UIC_HDRS ${CamGui_UIC_SRCS})
|
||||
qt5_wrap_ui(CamGui_UIC_HDRS ${CamGui_UIC_SRCS})
|
||||
|
||||
SET(CamGui_SRCS
|
||||
${CamGui_UIC_HDRS}
|
||||
|
||||
@@ -168,16 +168,6 @@ class TaskPanelCircularArray:
|
||||
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
|
||||
self.form.checkbox_link.stateChanged.connect(self.set_link)
|
||||
|
||||
# Old style for Qt4, avoid!
|
||||
# QtCore.QObject.connect(self.form.button_reset,
|
||||
# QtCore.SIGNAL("clicked()"),
|
||||
# self.reset_point)
|
||||
# QtCore.QObject.connect(self.form.checkbox_fuse,
|
||||
# QtCore.SIGNAL("stateChanged(int)"),
|
||||
# self.set_fuse)
|
||||
# QtCore.QObject.connect(self.form.checkbox_link,
|
||||
# QtCore.SIGNAL("stateChanged(int)"),
|
||||
# self.set_link)
|
||||
|
||||
def accept(self):
|
||||
"""Execute when clicking the OK button or Enter key."""
|
||||
|
||||
@@ -167,10 +167,6 @@ class TaskPanelOrthoArray:
|
||||
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
|
||||
self.form.checkbox_link.stateChanged.connect(self.set_link)
|
||||
|
||||
# Old style for Qt4, avoid!
|
||||
# QtCore.QObject.connect(self.form.button_reset,
|
||||
# QtCore.SIGNAL("clicked()"),
|
||||
# self.reset_point)
|
||||
|
||||
def accept(self):
|
||||
"""Execute when clicking the OK button or Enter key."""
|
||||
|
||||
@@ -156,10 +156,6 @@ class TaskPanelPolarArray:
|
||||
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
|
||||
self.form.checkbox_link.stateChanged.connect(self.set_link)
|
||||
|
||||
# Old style for Qt4, avoid!
|
||||
# QtCore.QObject.connect(self.form.button_reset,
|
||||
# QtCore.SIGNAL("clicked()"),
|
||||
# self.reset_point)
|
||||
|
||||
def accept(self):
|
||||
"""Execute when clicking the OK button or Enter key."""
|
||||
|
||||
@@ -38,10 +38,6 @@ import six
|
||||
|
||||
Qtranslate = QtCore.QCoreApplication.translate
|
||||
|
||||
# This property only exists in Qt4, which is normally paired
|
||||
# with Python 2.
|
||||
# But if Python 2 is used with Qt5 (rare),
|
||||
# this assignment will fail.
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
except AttributeError:
|
||||
@@ -115,35 +111,7 @@ def translate(context, text, utf8_decode=False):
|
||||
# the translate function doesn't use the 4th parameter
|
||||
if six.PY3:
|
||||
return Qtranslate(context, text, None)
|
||||
# Python 2
|
||||
elif QtCore.qVersion() > "4":
|
||||
# Python 2 and Qt5
|
||||
if utf8_decode:
|
||||
# The text is a utf8 string, and since it is Qt5
|
||||
# the translate function doesn't use the 4th parameter
|
||||
return Qtranslate(context, text, None)
|
||||
else:
|
||||
# The text is not a unicode string, and since it is Qt5
|
||||
# the translate function doesn't use the 4th parameter.
|
||||
# Therefore the output string needs to be encoded manually
|
||||
# as utf8 bytes before returning.
|
||||
return Qtranslate(context, text, None).encode("utf8")
|
||||
else:
|
||||
# Python 2 and Qt4
|
||||
if utf8_decode:
|
||||
# The text is a utf8 string, and since it is Qt4
|
||||
# the translate function uses the 4th parameter
|
||||
# to handle the input encoding.
|
||||
return Qtranslate(context, text, None, _encoding)
|
||||
else:
|
||||
# The text is not a unicode string, and since it is Qt4
|
||||
# the translate function uses the 4th parameter
|
||||
# to handle the encoding.
|
||||
# In this case, the `encoding` is `None`, therefore
|
||||
# the output string needs to be encoded manually
|
||||
# as utf8 bytes before returning.
|
||||
return Qtranslate(context, text, None, _encoding).encode("utf8")
|
||||
|
||||
|
||||
|
||||
# Original code no longer used. It is listed here for reference
|
||||
# to show how the different pairings Py2/Qt4, Py3/Qt5, Py2/Qt5, Py3/Qt4
|
||||
|
||||
@@ -228,7 +228,6 @@ void TaskRichAnno::setUiPrimary()
|
||||
MRichTextEdit mre;
|
||||
ui->teAnnoText->setFontPointSize(mre.getDefFontSizeNum());
|
||||
// set a placeholder text to inform the user
|
||||
// (QTextEdit has no placeholderText property in Qt4)
|
||||
ui->teAnnoText->setPlaceholderText(tr("Input the annotation text directly or start the rich text editor"));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ set(APP_VERSION "1.0")
|
||||
|
||||
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
||||
|
||||
find_package(Qt4)
|
||||
find_package(Qt5)
|
||||
|
||||
include_directories(
|
||||
${QT_INCLUDE_DIR}
|
||||
@@ -16,11 +16,11 @@ link_directories(${QT_LIBRARY_DIR})
|
||||
|
||||
add_definitions(-D_UNICODE)
|
||||
|
||||
QT4_WRAP_CPP(RegExp_MOC_SRCS
|
||||
QT5_WRAP_CPP(RegExp_MOC_SRCS
|
||||
regexpdialog.h
|
||||
)
|
||||
|
||||
QT4_WRAP_UI(RegExp_UIC_HDRS
|
||||
QT5_WRAP_UI(RegExp_UIC_HDRS
|
||||
regexpdialog.ui
|
||||
)
|
||||
|
||||
|
||||
@@ -93,8 +93,6 @@ def find_tools(noobsolete=True):
|
||||
QMAKE = "qmake"
|
||||
elif (os.system("qmake-qt5 -version") == 0):
|
||||
QMAKE = "qmake-qt5"
|
||||
elif (os.system("qmake-qt4 -version") == 0):
|
||||
QMAKE = "qmake-qt4"
|
||||
else:
|
||||
raise Exception("Cannot find qmake")
|
||||
if (os.system("lupdate -version") == 0):
|
||||
@@ -106,10 +104,6 @@ def find_tools(noobsolete=True):
|
||||
LUPDATE = "lupdate-qt5"
|
||||
if noobsolete:
|
||||
LUPDATE += " -no-obsolete"
|
||||
elif (os.system("lupdate-qt4 -version") == 0):
|
||||
LUPDATE = "lupdate-qt4"
|
||||
if noobsolete:
|
||||
LUPDATE += " -noobsolete"
|
||||
else:
|
||||
raise Exception("Cannot find lupdate")
|
||||
if (os.system("pyside2-lupdate -version") == 0):
|
||||
|
||||
Reference in New Issue
Block a user