migrate to QAD v2

This commit is contained in:
2021-03-05 13:06:25 +03:00
parent d6734e1954
commit 5d1e42601a
4 changed files with 15 additions and 15 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(cd)
set(cd_MAJOR 1)
set(cd_MINOR 0)
set(cd_MINOR 1)
set(cd_REVISION 0)
set(cd_SUFFIX )
set(cd_COMPANY SHS)
@@ -29,17 +29,17 @@ if(QAD_FOUND)
option(UTILS "Build various utils" ${_plugins_default_})
macro(cd_library NAME _MODULES _LIBS)
shstk_qt_project(cd_${NAME} FALSE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
shstk_qt_install("cd" FALSE cd_${NAME} "${out_HDR}" "out_QM")
shstk_qad_project(cd_${NAME} FALSE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
shstk_qad_install("cd" FALSE cd_${NAME} "${out_HDR}" "out_QM")
endmacro()
macro(cd_application NAME _MODULES _LIBS)
shstk_qt_project(${NAME} TRUE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
shstk_qt_install("cd" TRUE ${NAME} "" "out_QM")
shstk_qad_project(${NAME} TRUE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
shstk_qad_install("cd" TRUE ${NAME} "" "out_QM")
endmacro()
macro(cd_plugin NAME _MODULES _LIBS)
shstk_qt_plugin(cd_${NAME} "${_MODULES}" "cd_${NAME};${_LIBS}")
shstk_qad_plugin(cd_${NAME} "${_MODULES}" "cd_${NAME};${_LIBS}")
endmacro()
shstk_install(cd FALSE "" "${cd_VERSION_FILE}")

View File

@@ -187,7 +187,7 @@ bool QCDCore::bindWidget(QWidget * w, const CDType & k) {
void QCDCore::updateBindedWidgets() {
QMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
QMultiMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
QWidgetList to_remove;
updating = true;
while (it.hasNext()) {
@@ -274,10 +274,8 @@ bool QCDCore::unbindWidget(QWidget * w) {
void QCDCore::unbindAllWidgets() {
QMap<QWidget * , PIDeque<int> > bwm = binded_widgets;
QMapIterator<QWidget * , PIDeque<int> > it(bwm);
while (it.hasNext()) {
QWidget * w = it.next().key();
QList<QWidget * > bwk = binded_widgets.keys();
foreach (QWidget * w, bwk) {
unbindWidget(w);
}
binded_widgets.clear();
@@ -285,7 +283,7 @@ void QCDCore::unbindAllWidgets() {
void QCDCore::updateBindedWidget(const CDType & k_) {
QMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
QMultiMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
updating = true;
while (it.hasNext()) {
QWidget * w = it.next().key();

View File

@@ -294,7 +294,11 @@ void CDView::calculate() {
void CDView::filter(const QString & f) {
#if QT_VERSION_MAJOR <= 5
proxy_->setFilterRegExp(QRegExp(f, Qt::CaseInsensitive));
#else
proxy_->setFilterRegularExpression(QRegularExpression(f, QRegularExpression::CaseInsensitiveOption));
#endif
}

View File

@@ -3,9 +3,7 @@
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
#if QT_VERSION >= 0x050000
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
enableHighDPI();
CDPultWindow w;
w.show();
if (a.arguments().size() > 1)