git-svn-id: svn://db.shs.com.ru/libs@357 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
project(qad)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
#cmake_policy(SET CMP0017 OLD)
|
||||
#find_package(Qt4 REQUIRED)
|
||||
if (POLICY CMP0017)
|
||||
cmake_policy(SET CMP0017 NEW)
|
||||
endif()
|
||||
if (NOT LIBPROJECT)
|
||||
option(LIB "System install" 1)
|
||||
option(DEBUG "Build with -g3" 0)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
if (POLICY CMP0017)
|
||||
cmake_policy(SET CMP0017 NEW)
|
||||
endif()
|
||||
if (POLICY CMP0011)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
endif()
|
||||
if(NOT LIBPROJECT)
|
||||
include(QtWraps)
|
||||
endif()
|
||||
|
||||
@@ -80,7 +80,6 @@ macro(find_qt)
|
||||
find_package(Qt5 COMPONENTS LinguistTools UiPlugin Widgets ${_QCOMP} ${_QUIET})
|
||||
if (Qt5_FOUND)
|
||||
set(LOCAL_FOUND5 1)
|
||||
#cmake_policy(SET CMP0020 NEW)
|
||||
set(_Qt5Modules)
|
||||
foreach(m ${_QCOMP})
|
||||
if (${Qt5${m}_FOUND})
|
||||
@@ -357,7 +356,6 @@ macro(qt_add_executable _NAME)
|
||||
_qt_split_add_args(_PREF _ARGS ${ARGN})
|
||||
#message("${_PREF}")
|
||||
#message("${_ARGS}")
|
||||
#cmake_policy(SET CMP0020 NEW)
|
||||
set(_TARGET ${_NAME}${TARGET_SUFFIX_Qt${_v}})
|
||||
add_executable(${_TARGET} ${_PREF} ${_ARGS})
|
||||
set(_${_NAME}_is_qt 1)
|
||||
@@ -419,7 +417,6 @@ macro(qt_target_link_libraries _NAME)
|
||||
list(APPEND _ARGS ${_i})
|
||||
endif()
|
||||
endforeach()
|
||||
cmake_policy(SET CMP0020 OLD)
|
||||
target_link_libraries(${_TARGET} ${Qt${_v}_LIBRARIES} ${_ARGS})
|
||||
#message("link ${_TARGET}: ${Qt${_v}_LIBRARIES} ${_ARGS}")
|
||||
endif()
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
Peri4 Paint
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "emainwindow.h"
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
@@ -239,7 +221,7 @@ void EMainWindow::initMenus() {
|
||||
action_hide_all_tools.disconnect();
|
||||
action_show_all_docks.disconnect();
|
||||
action_hide_all_docks.disconnect();
|
||||
|
||||
|
||||
QList<QToolBar * > tools = findChildren<QToolBar * >();
|
||||
foreach (QToolBar * i, tools) {
|
||||
if (i->property("ribbon").toBool()) continue;
|
||||
@@ -247,7 +229,7 @@ void EMainWindow::initMenus() {
|
||||
connect(&action_show_all_tools, SIGNAL(triggered(bool)), i, SLOT(show()));
|
||||
connect(&action_hide_all_tools, SIGNAL(triggered(bool)), i, SLOT(hide()));
|
||||
}
|
||||
|
||||
|
||||
QList<QDockWidget * > docks = findChildren<QDockWidget * >();
|
||||
foreach (QDockWidget * i, docks) {
|
||||
if (i->property("ribbon").toBool()) continue;
|
||||
@@ -255,7 +237,7 @@ void EMainWindow::initMenus() {
|
||||
connect(&action_show_all_docks, SIGNAL(triggered(bool)), i, SLOT(show()));
|
||||
connect(&action_hide_all_docks, SIGNAL(triggered(bool)), i, SLOT(hide()));
|
||||
}
|
||||
|
||||
|
||||
QList<QAction * > actions = findChildren<QAction * >();
|
||||
foreach (QAction * i, actions)
|
||||
i->setIconVisibleInMenu(true);
|
||||
@@ -311,7 +293,7 @@ void EMainWindow::changedDock() {
|
||||
docks_tabs << dock;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (QDockWidget * d, docks) {
|
||||
if (d->titleBarWidget() == 0) continue;
|
||||
QWidget * ctb = d->titleBarWidget();
|
||||
|
||||
@@ -49,7 +49,7 @@ class BlockView: public QGraphicsView
|
||||
Q_PROPERTY(bool traceConsiderBuses READ isTraceConsiderBuses WRITE setTraceConsiderBuses)
|
||||
Q_PROPERTY(bool pinMulticonnect READ isPinMulticonnectEnabled WRITE setPinMulticonnectEnabled)
|
||||
Q_PROPERTY(bool miniMap READ isMiniMapEnabled WRITE setMiniMapEnabled)
|
||||
|
||||
|
||||
Q_PROPERTY(double _thumb READ _thumb WRITE _setThumb DESIGNABLE false SCRIPTABLE false)
|
||||
Q_PROPERTY(QRectF _nav READ _nav WRITE _setNav DESIGNABLE false SCRIPTABLE false)
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
SingleSelection,
|
||||
MultiSelection
|
||||
};
|
||||
|
||||
|
||||
QPen gridPen() const {return grid_pen;}
|
||||
bool isGridVisible() const {return grid_visible;}
|
||||
bool isSnapToGrid() const {return grid_snap;}
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
double gridPointsWidth() const {return grid_points;}
|
||||
SelectionMode selectionMode() const {return smode;}
|
||||
void setSelectionMode(SelectionMode mode) {smode = mode;}
|
||||
|
||||
|
||||
void addItems(QList<QGraphicsItem * > items) {foreach (QGraphicsItem * i, items) addItem(i);}
|
||||
QList<BlockBusItem * > buses() const;
|
||||
QList<BlockBusItem * > wrongConnectedBuses() const;
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
BlockBusItem * connectionBus(BlockItem * b0, BlockItem * b1) const;
|
||||
QList<BlockBusItem * > connectionBuses(BlockItem * b0, BlockItem * b1) const;
|
||||
bool connectPins(BlockItemPin * p0, BlockItemPin * p1);
|
||||
QList<BlockItem * > selectedBlocks() const;
|
||||
QList<QGraphicsItem * > selectedDecors() const;
|
||||
|
||||
void setTransform(const QTransform & matrix, bool combine = false);
|
||||
void centerOn(const QPointF & pos);
|
||||
@@ -136,15 +138,13 @@ protected:
|
||||
void simplifyBuses();
|
||||
void moveBuses(const QList<QGraphicsItem * > & items, QPointF dp);
|
||||
QList<BlockBusItem * > internalBuses(const QList<BlockItem * > & items);
|
||||
QList<BlockItem * > selectedBlocks() const;
|
||||
QList<QGraphicsItem * > selectedDecors() const;
|
||||
double _thumb() const {return _talpha;}
|
||||
QRectF _nav() const;
|
||||
void animateNav(QRectF d);
|
||||
void scrollFromThumb();
|
||||
void deleteCopyTemp();
|
||||
void emitActionEvent(BlockItemBase::Action action, QList<QGraphicsItem * > items);
|
||||
|
||||
|
||||
virtual void loadBus(BlockBusItem * bus) {}
|
||||
virtual void copyBlocks(QList<BlockItem * > items, QPointF offset) {}
|
||||
virtual void copyBuses(QList<BlockBusItem * > items, QPointF offset) {}
|
||||
@@ -207,7 +207,7 @@ public slots:
|
||||
void setTraceConsiderBuses(bool on) {m_trace_with_buses = on;}
|
||||
void setPinMulticonnectEnabled(bool on) {m_pin_mc = on;}
|
||||
void setMiniMapEnabled(bool on) {minimap = on;}
|
||||
|
||||
|
||||
void zoom(double factor);
|
||||
void zoomIn() {zoom(1.2);}
|
||||
void zoomOut() {zoom(1. / 1.2);}
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
Peri4 Paint
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "qpievaluator.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
Peri4 Paint
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef QPIEVALUATOR_H
|
||||
#define QPIEVALUATOR_H
|
||||
|
||||
|
||||
@@ -25,8 +25,23 @@ public:
|
||||
bool isClearButtonVisible() const {return cw_visible;}
|
||||
bool isCleared() const;
|
||||
|
||||
|
||||
virtual void stepBy(int steps);
|
||||
virtual void clear();
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
public slots:
|
||||
void setExpression(const QString & expr);
|
||||
void setValue(double val);
|
||||
void setDefaultText(const QString & t);
|
||||
void setClearButtonVisible(bool visible);
|
||||
|
||||
protected:
|
||||
QString text() const {return QAbstractSpinBox::text();}
|
||||
|
||||
virtual StepEnabled stepEnabled() const;
|
||||
virtual void focusInEvent(QFocusEvent *event);
|
||||
virtual void focusOutEvent(QFocusEvent *event);
|
||||
|
||||
QWidget * status;
|
||||
QWidget * cw;
|
||||
QPIEvaluator eval;
|
||||
@@ -38,7 +53,7 @@ protected:
|
||||
QImage clear_im;
|
||||
QString dt;
|
||||
bool cw_visible;
|
||||
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject * o, QEvent * e);
|
||||
void resizeEvent(QResizeEvent * );
|
||||
@@ -46,32 +61,16 @@ private:
|
||||
void statusPaintEvent();
|
||||
void cwPaintEvent();
|
||||
void resizeIcons();
|
||||
|
||||
|
||||
private slots:
|
||||
void clearMouseRelease(QMouseEvent * e);
|
||||
void textChanged_(const QString & text);
|
||||
void setExpression_();
|
||||
|
||||
public slots:
|
||||
void setExpression(const QString & expr);
|
||||
void setValue(double val);
|
||||
void setDefaultText(const QString & t);
|
||||
void setClearButtonVisible(bool visible);
|
||||
|
||||
public:
|
||||
virtual void stepBy(int steps);
|
||||
virtual void clear();
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
virtual StepEnabled stepEnabled() const;
|
||||
virtual void focusInEvent(QFocusEvent *event);
|
||||
virtual void focusOutEvent(QFocusEvent *event);
|
||||
|
||||
|
||||
signals:
|
||||
void valueChanged(double val);
|
||||
void cleared();
|
||||
|
||||
};
|
||||
|
||||
#endif // EVALSPINBOX_H
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
Peri4 Paint
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "session_manager.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
Peri4 Paint
|
||||
Copyright (C) 2018 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SESSION_MANAGER_H
|
||||
#define SESSION_MANAGER_H
|
||||
|
||||
@@ -39,7 +21,7 @@ public:
|
||||
~SessionManager() {;}
|
||||
|
||||
inline void setFile(const QString & file) {file_ = file;}
|
||||
|
||||
|
||||
inline void addEntry(QMainWindow * e) {mwindows.push_back(QPair<QString, QMainWindow * >(e->objectName(), e));}
|
||||
inline void addEntry(QCheckBox * e) {checks.push_back(QPair<QString, QCheckBox * >(e->objectName(), e));}
|
||||
inline void addEntry(QLineEdit * e) {lines.push_back(QPair<QString, QLineEdit * >(e->objectName(), e));}
|
||||
@@ -50,7 +32,7 @@ public:
|
||||
inline void addEntry(QTabWidget * e) {tabs.push_back(QPair<QString, QTabWidget * >(e->objectName(), e));}
|
||||
inline void addEntry(QAction * e) {actions.push_back(QPair<QString, QAction * >(e->objectName(), e));}
|
||||
inline void addMainWidget(QWidget * e) {widgets.push_back(QPair<QString, QWidget * >(e->objectName(), e));}
|
||||
|
||||
|
||||
inline void addEntry(const QString & name, QMainWindow * e) {mwindows.push_back(QPair<QString, QMainWindow * >(name, e));}
|
||||
inline void addEntry(const QString & name, QCheckBox * e) {checks.push_back(QPair<QString, QCheckBox * >(name, e));}
|
||||
inline void addEntry(const QString & name, QLineEdit * e) {lines.push_back(QPair<QString, QLineEdit * >(name, e));}
|
||||
|
||||
Reference in New Issue
Block a user