git-svn-id: svn://db.shs.com.ru/libs@311 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -218,13 +218,13 @@ void KX_Pult::setControlsEnable(bool enable) {
|
|||||||
|
|
||||||
void KX_Pult::setX(const KX_X_Data & data) {
|
void KX_Pult::setX(const KX_X_Data & data) {
|
||||||
if (!show_x) return;
|
if (!show_x) return;
|
||||||
ui->graphic->lock();
|
//ui->graphic->lock();
|
||||||
for (int i = 0; i < KX_X_PACKET_NUM; ++i) {
|
for (int i = 0; i < KX_X_PACKET_NUM; ++i) {
|
||||||
if (!isNormalDouble(data.x_data[i])) continue;
|
if (!isNormalDouble(data.x_data[i])) continue;
|
||||||
ui->graphic->addPoint(data.x_data[i], i, false);
|
ui->graphic->addPoint(data.x_data[i], i, false);
|
||||||
values[i]->setText(QString("(%1): %2").arg(data.x_num[i]).arg(data.x_data[i]));
|
values[i]->setText(QString("(%1): %2").arg(data.x_num[i]).arg(data.x_data[i]));
|
||||||
}
|
}
|
||||||
ui->graphic->unlock();
|
//ui->graphic->unlock();
|
||||||
if (!isPause) {
|
if (!isPause) {
|
||||||
need_update = true;
|
need_update = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ set ARCH=%~1
|
|||||||
set PATH=%SDK_MINGW_DIR%%ARCH%\bin;%SDK_QT4_DIR%%ARCH%\bin;%SDK_CMAKE_DIR%\bin
|
set PATH=%SDK_MINGW_DIR%%ARCH%\bin;%SDK_QT4_DIR%%ARCH%\bin;%SDK_CMAKE_DIR%\bin
|
||||||
if defined SDK_QT5_DIR set Qt5_DIR=%SDK_QT5_DIR%%ARCH%
|
if defined SDK_QT5_DIR set Qt5_DIR=%SDK_QT5_DIR%%ARCH%
|
||||||
mkdir ..\libs_build_win%ARCH%
|
mkdir ..\libs_build_win%ARCH%
|
||||||
cd ../libs_build_win%ARCH% && cmake_mgw -Wno-dev ../libs && make install -j8 && cd ../libs && pause
|
cd ../libs_build_win%ARCH% && cmake_mgw -Wno-dev -DQGLVIEW=1 ../libs && make install -j8 && cd ../libs && pause
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "ribbon.h"
|
#include "ribbon.h"
|
||||||
|
#include "qad_types.h"
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
|
|
||||||
@@ -13,6 +14,8 @@ Ribbon::Ribbon(QMainWindow * parent_): QToolBar() {
|
|||||||
if (parent_)
|
if (parent_)
|
||||||
parent_->installEventFilter(this);
|
parent_->installEventFilter(this);
|
||||||
init();
|
init();
|
||||||
|
setTabIconSize(preferredIconSize(2));
|
||||||
|
setIconSize(preferredIconSize(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -730,6 +730,6 @@ void BlockBusItem::paint(QPainter * p, const QStyleOptionGraphicsItem * o, QWidg
|
|||||||
|
|
||||||
QRectF BlockBusItem::boundingRect() const {
|
QRectF BlockBusItem::boundingRect() const {
|
||||||
QPolygonF p(pol);
|
QPolygonF p(pol);
|
||||||
p << new_end;
|
if (new_segment) p << new_end;
|
||||||
return enlargedRect(p.boundingRect(), 0, 0, 10.f);
|
return enlargedRect(p.boundingRect(), 0, 0, 10.f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1000,6 +1000,25 @@ void BlockView::fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspect
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QRectF BlockView::itemsBoundingRect() const {
|
||||||
|
QList<QGraphicsItem*> gi = scene_->items();
|
||||||
|
if (gi.isEmpty()) return QRectF();
|
||||||
|
bool f = true;
|
||||||
|
QRectF ret;
|
||||||
|
foreach (QGraphicsItem * i, gi)
|
||||||
|
if (i->isVisible() && (i != &tmp_bus)) {
|
||||||
|
if ((i->data(1007) != "item_selection") && !i->data(1008).toBool()) {
|
||||||
|
QRectF br = i->mapRectToScene(i->boundingRect());
|
||||||
|
//qDebug() << i << br;
|
||||||
|
if (f) ret = br;
|
||||||
|
else ret |= br;
|
||||||
|
f = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BlockView::restoreSelState() {
|
void BlockView::restoreSelState() {
|
||||||
foreach (QGraphicsItem * i, sel_items) {
|
foreach (QGraphicsItem * i, sel_items) {
|
||||||
i->setPos(i->data(1001).toPointF());
|
i->setPos(i->data(1001).toPointF());
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ public:
|
|||||||
void fitInView(qreal x, qreal y, qreal w, qreal h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
void fitInView(qreal x, qreal y, qreal w, qreal h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
||||||
void fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
void fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
||||||
|
|
||||||
|
QRectF itemsBoundingRect() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _init();
|
void _init();
|
||||||
void _updateBack();
|
void _updateBack();
|
||||||
|
|||||||
@@ -125,6 +125,17 @@ QString uniqueName(QString n, const QStringList & names) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int lineThickness() {
|
int fontHeight() {
|
||||||
return qMax<int>(qRound(QApplication::fontMetrics().size(0, "0").height() / 15.), 1);
|
return QApplication::fontMetrics().size(0, "0").height();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int lineThickness() {
|
||||||
|
return qMax<int>(qRound(fontHeight() / 15.), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize preferredIconSize(float x) {
|
||||||
|
int s = qMax<int>(8, qRound(fontHeight() * x));
|
||||||
|
return QSize(s, s);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ inline QRectF enlargedRect(const QRectF & r, qreal dx, qreal dy, qreal v) {
|
|||||||
|
|
||||||
QVariant::Type typeFromLetter(const QString & l);
|
QVariant::Type typeFromLetter(const QString & l);
|
||||||
QString uniqueName(QString n, const QStringList & names);
|
QString uniqueName(QString n, const QStringList & names);
|
||||||
|
int fontHeight();
|
||||||
int lineThickness();
|
int lineThickness();
|
||||||
|
QSize preferredIconSize(float x = 1.f);
|
||||||
|
|
||||||
|
|
||||||
#endif // QAD_TYPES_H
|
#endif // QAD_TYPES_H
|
||||||
|
|||||||
Reference in New Issue
Block a user