actual version libs withiout pip
git-svn-id: svn://db.shs.com.ru/libs@2 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
[Containments][1]
|
||||
ActionPluginsSource=Global
|
||||
activity=qad_blockview
|
||||
activityId=
|
||||
desktop=-1
|
||||
formfactor=0
|
||||
geometry=0,0,1508,862
|
||||
immutability=1
|
||||
lastDesktop=-1
|
||||
lastScreen=0
|
||||
location=0
|
||||
orientation=2
|
||||
plugin=newspaper
|
||||
screen=0
|
||||
wallpaperplugin=color
|
||||
wallpaperpluginmode=
|
||||
zvalue=0
|
||||
|
||||
[Containments][1][Wallpaper][color]
|
||||
backgroundMode=0
|
||||
color1=255,255,255
|
||||
color2=0,0,0
|
||||
|
||||
[Project]
|
||||
Manager=KDevCMakeManager
|
||||
Name=qad_blockview
|
||||
@@ -1,141 +0,0 @@
|
||||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1a\x00q\x00a\x00d\x00_\x00b\x00l\x00o\x00c\x00k\x00v\x00i\x00e\x00w)
|
||||
|
||||
[CMake]
|
||||
Build Directory Count=1
|
||||
Current Build Directory Index=0
|
||||
ProjectRootRelative=./
|
||||
|
||||
[CMake][CMake Build Directory 0]
|
||||
Build Directory Path=file:///mnt/data/orders/libs/qad_blockview/
|
||||
Build Type=
|
||||
CMake Binary=file:///usr/bin/cmake
|
||||
Environment Profile=
|
||||
Extra Arguments=
|
||||
Install Directory=file:///usr/local
|
||||
|
||||
[Defines And Includes][Compiler]
|
||||
Name=GCC
|
||||
Path=gcc
|
||||
Type=GCC
|
||||
|
||||
[Filters]
|
||||
size=23
|
||||
|
||||
[Filters][0]
|
||||
inclusive=0
|
||||
pattern=.*
|
||||
targets=3
|
||||
|
||||
[Filters][1]
|
||||
inclusive=0
|
||||
pattern=.git
|
||||
targets=2
|
||||
|
||||
[Filters][10]
|
||||
inclusive=0
|
||||
pattern=*.a
|
||||
targets=1
|
||||
|
||||
[Filters][11]
|
||||
inclusive=0
|
||||
pattern=*.so
|
||||
targets=1
|
||||
|
||||
[Filters][12]
|
||||
inclusive=0
|
||||
pattern=*.so.*
|
||||
targets=1
|
||||
|
||||
[Filters][13]
|
||||
inclusive=0
|
||||
pattern=moc_*
|
||||
targets=1
|
||||
|
||||
[Filters][14]
|
||||
inclusive=0
|
||||
pattern=*.moc
|
||||
targets=1
|
||||
|
||||
[Filters][15]
|
||||
inclusive=0
|
||||
pattern=ui_*
|
||||
targets=1
|
||||
|
||||
[Filters][16]
|
||||
inclusive=0
|
||||
pattern=qrc_*
|
||||
targets=1
|
||||
|
||||
[Filters][17]
|
||||
inclusive=0
|
||||
pattern=*~
|
||||
targets=1
|
||||
|
||||
[Filters][18]
|
||||
inclusive=0
|
||||
pattern=.*.kate-swp
|
||||
targets=1
|
||||
|
||||
[Filters][19]
|
||||
inclusive=0
|
||||
pattern=.*.swp
|
||||
targets=1
|
||||
|
||||
[Filters][2]
|
||||
inclusive=0
|
||||
pattern=CVS
|
||||
targets=2
|
||||
|
||||
[Filters][20]
|
||||
inclusive=0
|
||||
pattern=*.pyc
|
||||
targets=1
|
||||
|
||||
[Filters][21]
|
||||
inclusive=0
|
||||
pattern=*.pyo
|
||||
targets=1
|
||||
|
||||
[Filters][22]
|
||||
inclusive=0
|
||||
pattern=__pycache__
|
||||
targets=1
|
||||
|
||||
[Filters][3]
|
||||
inclusive=0
|
||||
pattern=.svn
|
||||
targets=2
|
||||
|
||||
[Filters][4]
|
||||
inclusive=0
|
||||
pattern=_svn
|
||||
targets=2
|
||||
|
||||
[Filters][5]
|
||||
inclusive=0
|
||||
pattern=SCCS
|
||||
targets=2
|
||||
|
||||
[Filters][6]
|
||||
inclusive=0
|
||||
pattern=_darcs
|
||||
targets=2
|
||||
|
||||
[Filters][7]
|
||||
inclusive=0
|
||||
pattern=.hg
|
||||
targets=2
|
||||
|
||||
[Filters][8]
|
||||
inclusive=0
|
||||
pattern=.bzr
|
||||
targets=2
|
||||
|
||||
[Filters][9]
|
||||
inclusive=0
|
||||
pattern=*.o
|
||||
targets=1
|
||||
|
||||
[MakeBuilder]
|
||||
Number Of Jobs=8
|
||||
@@ -52,6 +52,43 @@ void BlockItemPin::_reparent() {
|
||||
}
|
||||
|
||||
|
||||
void BlockItemPin::_updateText() {
|
||||
QString p;
|
||||
QMapIterator<QString, Device> it(devices_);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (!p.isEmpty()) p += "\n";
|
||||
if (it.key().isEmpty()) p += it.value().devFPath;
|
||||
else p += QString("%1 = %2").arg(it.key(), it.value().devFPath);
|
||||
}
|
||||
text_item.setToolTip(p);
|
||||
setToolTip(p);
|
||||
}
|
||||
|
||||
|
||||
QMap<QString, QString> BlockItemPin::devicesPath() const {
|
||||
QMap<QString, QString> ret;
|
||||
QMapIterator<QString, Device> it(devices_);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (!it.value().editable) continue;
|
||||
ret[it.key()] = it.value().devFPath;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void BlockItemPin::setDevicesPath(const QMap<QString, QString> & dp) {
|
||||
QMapIterator<QString, Device> it(devices_);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (!it.value().editable) continue;
|
||||
if (!dp.contains(it.key())) continue;
|
||||
devices_[it.key()].devFPath = dp[it.key()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QVariant BlockItemPin::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant & value) {
|
||||
if (change == QGraphicsItem::ItemParentChange)
|
||||
_reparent();
|
||||
@@ -292,11 +329,13 @@ void BlockItem::loadModel(const QByteArray & data) {
|
||||
|
||||
QByteArray BlockItem::save() {
|
||||
ChunkStream cs;
|
||||
QMap<QString, QMap<QString, QString> > pdp;
|
||||
QMap<QString, QList<BlockItem::Property> > pp;
|
||||
foreach (BlockItemPin * p, pins()) {
|
||||
pdp[p->text()] = p->devicesPath();
|
||||
pp[p->text()] = p->properties();
|
||||
}
|
||||
cs << cs.chunk(1, pos()) << cs.chunk(2, rotation()) << cs.chunk(3, props) << cs.chunk(5, pp);
|
||||
cs << cs.chunk(1, pos()) << cs.chunk(2, rotation()) << cs.chunk(3, props) << cs.chunk(4, pdp) << cs.chunk(5, pp);
|
||||
return cs.data();
|
||||
}
|
||||
|
||||
@@ -311,6 +350,12 @@ void BlockItem::load(const QByteArray & data) {
|
||||
case 1: setPos(cs.getData<QPointF>()); break;
|
||||
case 2: setRotation(cs.getData<qreal>()); break;
|
||||
case 3: props = cs.getData<QList<BlockItem::Property> >(); break;
|
||||
case 4:
|
||||
_v = cs.getData<QMap<QString, QMap<QString, QString> > >();
|
||||
foreach (BlockItemPin * p, pins())
|
||||
if (_v.contains(p->text()))
|
||||
p->setDevicesPath(_v[p->text()]);
|
||||
break;
|
||||
case 5:
|
||||
_p = cs.getData<QMap<QString, QList<BlockItem::Property> > >();
|
||||
foreach (BlockItemPin * p, pins())
|
||||
@@ -335,6 +380,7 @@ BlockItem * BlockItem::copy() const {
|
||||
np->setBusType(p->busType());
|
||||
np->setAlignment(p->alignment());
|
||||
np->setText(p->text());
|
||||
np->setDevices(p->devices());
|
||||
np->properties() = p->properties();
|
||||
ret->addPin(np);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,13 @@ public:
|
||||
InputOutput = 0x3
|
||||
};
|
||||
|
||||
struct Device {
|
||||
Device(const QString & n = QString(), const QString & p = QString(), bool e = false) {name = n; devFPath = p; editable = e;}
|
||||
QString name;
|
||||
QString devFPath;
|
||||
bool editable;
|
||||
};
|
||||
|
||||
void setPen(const QPen & p) {ell_item.setPen(p);}
|
||||
QPen pen() const {return ell_item.pen();}
|
||||
void setBrush(const QBrush & b) {ell_item.setBrush(b);}
|
||||
@@ -66,6 +73,8 @@ public:
|
||||
Qt::Alignment alignment() const {return align;}
|
||||
Direction direction() const {return dir;}
|
||||
QString text() const {return text_item.text();}
|
||||
const QMap<QString, Device> & devices() const {return devices_;}
|
||||
QMap<QString, QString> devicesPath() const;
|
||||
State state() const {return state_;}
|
||||
|
||||
void setBusType(int type_) {bus_type = type_;}
|
||||
@@ -73,6 +82,13 @@ public:
|
||||
void setDirection(Direction d) {dir = d; _init(true);}
|
||||
void setText(const QString & t) {text_item.setText(t); _init(true);}
|
||||
void setState(State s) {state_ = s; setBrush(br[int(state_)]); update();}
|
||||
void addDevice(const QString & name, const QString & path, bool editable = false) {devices_[name] = Device(name, path, editable); _updateText();}
|
||||
void setDevicesPath(const QMap<QString, QString> & dp);
|
||||
void removeDevice(const QString & name) {devices_.remove(name); _updateText();}
|
||||
void clearDevices() {devices_.clear(); _updateText();}
|
||||
void setDevices(const QMap<QString, Device> & d) {devices_ = d; _updateText();}
|
||||
Device device(const QString & name) const {return devices_.value(name);}
|
||||
bool isDeviceExists(const QString & name) const {return devices_.contains(name);}
|
||||
|
||||
void saveState() {sstate_.push(state_);}
|
||||
bool restoreState() {if (sstate_.isEmpty()) return false; setState(sstate_.pop()); return true;}
|
||||
@@ -92,6 +108,7 @@ protected:
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent * e);
|
||||
void _init(bool affect_parent = false);
|
||||
void _reparent();
|
||||
void _updateText();
|
||||
int bus_type;
|
||||
State state_;
|
||||
QGraphicsEllipseItem ell_item;
|
||||
@@ -101,6 +118,7 @@ protected:
|
||||
BlockItem * parent_;
|
||||
Qt::Alignment align;
|
||||
Direction dir;
|
||||
QMap<QString, Device> devices_;
|
||||
QBrush br[6];
|
||||
|
||||
};
|
||||
@@ -170,7 +188,7 @@ protected:
|
||||
|
||||
inline QDataStream & operator <<(QDataStream & s, const BlockItemPin * p) {
|
||||
ChunkStream cs;
|
||||
cs << cs.chunk(1, int(p->alignment())) << cs.chunk(2, p->busType()) << cs.chunk(3, p->text());
|
||||
cs << cs.chunk(1, int(p->alignment())) << cs.chunk(2, p->busType()) << cs.chunk(3, p->text()) << cs.chunk(4, p->devices());
|
||||
s << cs.data(); return s;}
|
||||
inline QDataStream & operator >>(QDataStream & s, BlockItemPin *& p) {
|
||||
ChunkStream cs(s);
|
||||
@@ -180,6 +198,22 @@ inline QDataStream & operator >>(QDataStream & s, BlockItemPin *& p) {
|
||||
case 1: p->setAlignment((Qt::Alignment)cs.getData<int>()); break;
|
||||
case 2: p->setBusType(cs.getData<int>()); break;
|
||||
case 3: p->setText(cs.getData<QString>()); break;
|
||||
case 4: p->setDevices(cs.getData<QMap<QString, BlockItemPin::Device> >()); break;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
inline QDataStream & operator <<(QDataStream & s, const BlockItemPin::Device & d) {
|
||||
ChunkStream cs; cs << cs.chunk(1, d.name) << cs.chunk(2, d.devFPath) << cs.chunk(3, d.editable); s << cs.data(); return s;}
|
||||
inline QDataStream & operator >>(QDataStream & s, BlockItemPin::Device & d) {
|
||||
ChunkStream cs(s);
|
||||
while (!cs.atEnd()) {
|
||||
switch (cs.read()) {
|
||||
case 1: d.name = cs.getData<QString>(); break;
|
||||
case 2: d.devFPath = cs.getData<QString>(); break;
|
||||
case 3: d.editable = cs.getData<bool>(); break;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
|
||||
@@ -1049,7 +1049,6 @@ void BlockView::markPins(int bus_type) {
|
||||
}
|
||||
}
|
||||
}
|
||||
emit busStarted(bus_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -170,7 +170,6 @@ signals:
|
||||
void actionEvent(BlockItemBase::Action action, QList<QGraphicsItem * > items);
|
||||
void blockRemoved(BlockItem * item);
|
||||
void connectionsChanged();
|
||||
void busStarted(int bus_type);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[Project]
|
||||
Manager=KDevCMakeManager
|
||||
Name=qad_blockview
|
||||
@@ -1,53 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/draw-line.png</file>
|
||||
<file>icons/align-hor.png</file>
|
||||
<file>icons/align-ver.png</file>
|
||||
<file>icons/dialog-close.png</file>
|
||||
<file>icons/edit-clear.png</file>
|
||||
<file>icons/edit-guides.png</file>
|
||||
<file>icons/view-grid.png</file>
|
||||
<file>icons/zoom-fit-best.png</file>
|
||||
<file>icons/configure.png</file>
|
||||
<file>icons/document-save.png</file>
|
||||
<file>icons/edit-clear-locationbar-rtl.png</file>
|
||||
<file>icons/edit-find.png</file>
|
||||
<file>icons/list-add.png</file>
|
||||
<file>icons/edit-delete.png</file>
|
||||
<file>icons/item.png</file>
|
||||
<file>icons/node-add.png</file>
|
||||
<file>icons/node.png</file>
|
||||
<file>icons/edit-copy.png</file>
|
||||
<file>icons/edit-paste.png</file>
|
||||
<file>icons/expand_s_x.png</file>
|
||||
<file>icons/expand_s_y.png</file>
|
||||
<file>icons/expand_x.png</file>
|
||||
<file>icons/expand_y.png</file>
|
||||
<file>icons/border-line.png</file>
|
||||
<file>icons/legend.png</file>
|
||||
<file>icons/blockview.png</file>
|
||||
<file>icons/view-fullscreen.png</file>
|
||||
<file>lang/qad_blockview_ru.qm</file>
|
||||
<file>icons/draw-ellipse.png</file>
|
||||
<file>icons/draw-rectangle.png</file>
|
||||
<file>icons/draw-text.png</file>
|
||||
<file>icons/view-preview.png</file>
|
||||
<file>icons/format-fill-color.png</file>
|
||||
<file>icons/format-stroke-color.png</file>
|
||||
<file>icons/document-open.png</file>
|
||||
<file>icons/document-edit-.png</file>
|
||||
<file>icons/align-bottom-center.png</file>
|
||||
<file>icons/align-bottom-left.png</file>
|
||||
<file>icons/align-bottom-right.png</file>
|
||||
<file>icons/align-center-center.png</file>
|
||||
<file>icons/align-center-left.png</file>
|
||||
<file>icons/align-center-right.png</file>
|
||||
<file>icons/align-top-center.png</file>
|
||||
<file>icons/align-top-left.png</file>
|
||||
<file>icons/align-top-right.png</file>
|
||||
<file>icons/z-bottom.png</file>
|
||||
<file>icons/z-down.png</file>
|
||||
<file>icons/z-top.png</file>
|
||||
<file>icons/z-up.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
Reference in New Issue
Block a user