migrate to QAD v2
This commit is contained in:
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
||||||
project(cd)
|
project(cd)
|
||||||
set(cd_MAJOR 1)
|
set(cd_MAJOR 1)
|
||||||
set(cd_MINOR 0)
|
set(cd_MINOR 1)
|
||||||
set(cd_REVISION 0)
|
set(cd_REVISION 0)
|
||||||
set(cd_SUFFIX )
|
set(cd_SUFFIX )
|
||||||
set(cd_COMPANY SHS)
|
set(cd_COMPANY SHS)
|
||||||
@@ -29,17 +29,17 @@ if(QAD_FOUND)
|
|||||||
option(UTILS "Build various utils" ${_plugins_default_})
|
option(UTILS "Build various utils" ${_plugins_default_})
|
||||||
|
|
||||||
macro(cd_library NAME _MODULES _LIBS)
|
macro(cd_library NAME _MODULES _LIBS)
|
||||||
shstk_qt_project(cd_${NAME} FALSE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
|
shstk_qad_project(cd_${NAME} FALSE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
|
||||||
shstk_qt_install("cd" FALSE cd_${NAME} "${out_HDR}" "out_QM")
|
shstk_qad_install("cd" FALSE cd_${NAME} "${out_HDR}" "out_QM")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(cd_application NAME _MODULES _LIBS)
|
macro(cd_application NAME _MODULES _LIBS)
|
||||||
shstk_qt_project(${NAME} TRUE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
|
shstk_qad_project(${NAME} TRUE "cd" "${_MODULES}" "${_LIBS}" ${ARGN})
|
||||||
shstk_qt_install("cd" TRUE ${NAME} "" "out_QM")
|
shstk_qad_install("cd" TRUE ${NAME} "" "out_QM")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(cd_plugin NAME _MODULES _LIBS)
|
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()
|
endmacro()
|
||||||
|
|
||||||
shstk_install(cd FALSE "" "${cd_VERSION_FILE}")
|
shstk_install(cd FALSE "" "${cd_VERSION_FILE}")
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ bool QCDCore::bindWidget(QWidget * w, const CDType & k) {
|
|||||||
|
|
||||||
|
|
||||||
void QCDCore::updateBindedWidgets() {
|
void QCDCore::updateBindedWidgets() {
|
||||||
QMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
|
QMultiMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
|
||||||
QWidgetList to_remove;
|
QWidgetList to_remove;
|
||||||
updating = true;
|
updating = true;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@@ -274,10 +274,8 @@ bool QCDCore::unbindWidget(QWidget * w) {
|
|||||||
|
|
||||||
|
|
||||||
void QCDCore::unbindAllWidgets() {
|
void QCDCore::unbindAllWidgets() {
|
||||||
QMap<QWidget * , PIDeque<int> > bwm = binded_widgets;
|
QList<QWidget * > bwk = binded_widgets.keys();
|
||||||
QMapIterator<QWidget * , PIDeque<int> > it(bwm);
|
foreach (QWidget * w, bwk) {
|
||||||
while (it.hasNext()) {
|
|
||||||
QWidget * w = it.next().key();
|
|
||||||
unbindWidget(w);
|
unbindWidget(w);
|
||||||
}
|
}
|
||||||
binded_widgets.clear();
|
binded_widgets.clear();
|
||||||
@@ -285,7 +283,7 @@ void QCDCore::unbindAllWidgets() {
|
|||||||
|
|
||||||
|
|
||||||
void QCDCore::updateBindedWidget(const CDType & k_) {
|
void QCDCore::updateBindedWidget(const CDType & k_) {
|
||||||
QMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
|
QMultiMapIterator<QWidget * , PIDeque<int> > it(binded_widgets);
|
||||||
updating = true;
|
updating = true;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
QWidget * w = it.next().key();
|
QWidget * w = it.next().key();
|
||||||
|
|||||||
@@ -294,7 +294,11 @@ void CDView::calculate() {
|
|||||||
|
|
||||||
|
|
||||||
void CDView::filter(const QString & f) {
|
void CDView::filter(const QString & f) {
|
||||||
|
#if QT_VERSION_MAJOR <= 5
|
||||||
proxy_->setFilterRegExp(QRegExp(f, Qt::CaseInsensitive));
|
proxy_->setFilterRegExp(QRegExp(f, Qt::CaseInsensitive));
|
||||||
|
#else
|
||||||
|
proxy_->setFilterRegularExpression(QRegularExpression(f, QRegularExpression::CaseInsensitiveOption));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
#if QT_VERSION >= 0x050000
|
enableHighDPI();
|
||||||
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
|
||||||
#endif
|
|
||||||
CDPultWindow w;
|
CDPultWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
if (a.arguments().size() > 1)
|
if (a.arguments().size() > 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user