Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在5.3.2 上编译通过,examples 能够正常运行 #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[github地址](https://github.com/15280986168/QtPropertyBrowser)

10 changes: 6 additions & 4 deletions buildlib/buildlib.pro
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
TEMPLATE=lib
CONFIG += qt dll qtpropertybrowser-buildlib
QT += core
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
mac:CONFIG += absolute_library_soname
win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
include(../src/qtpropertybrowser.pri)
TARGET = $$QTPROPERTYBROWSER_LIBNAME
DESTDIR = $$QTPROPERTYBROWSER_LIBDIR
win32 {
DLLDESTDIR = $$[QT_INSTALL_BINS]
QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QTPROPERTYBROWSER_LIBNAME}.dll
}
#win32 {
# DLLDESTDIR = $$QTPROPERTYBROWSER_BINDIR
# QMAKE_DISTCLEAN += $$QTPROPERTYBROWSER_BINDIR\\$$QTPROPERTYBROWSER_LIBNAME.dll
#}
target.path = $$DESTDIR
INSTALLS += target
3 changes: 2 additions & 1 deletion common.pri
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtpropertybrowser-uselib
TEMPLATE += fakelib
QTPROPERTYBROWSER_LIBNAME = $$qtLibraryTarget(QtSolutions_PropertyBrowser-head)
QTPROPERTYBROWSER_LIBNAME = $$qtLibraryTarget(QPropertyBrowser)
TEMPLATE -= fakelib
QTPROPERTYBROWSER_LIBDIR = $$PWD/lib
QTPROPERTYBROWSER_BINDIR = $$PWD/bin
unix:qtpropertybrowser-uselib:!qtpropertybrowser-buildlib:QMAKE_RPATHDIR += $$QTPROPERTYBROWSER_LIBDIR
6 changes: 6 additions & 0 deletions examples/canvas_typed/canvas_typed.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .

QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

include(../../src/qtpropertybrowser.pri)
# Input
HEADERS += qtcanvas.h mainwindow.h
SOURCES += qtcanvas.cpp mainwindow.cpp main.cpp


DESTDIR = $$QTPROPERTYBROWSER_BINDIR

2 changes: 1 addition & 1 deletion examples/canvas_typed/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
**
****************************************************************************/

#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include "mainwindow.h"

int main(int argc, char **argv)
Expand Down
8 changes: 4 additions & 4 deletions examples/canvas_typed/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
#include "qttreepropertybrowser.h"
#include <QtGui/QMatrix>
#include <QtGui/QMouseEvent>
#include <QtGui/QMenuBar>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QDockWidget>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QMenu>
#include <QtWidgets/QAction>
#include <QtWidgets/QDockWidget>

void CanvasView::contentsMousePressEvent(QMouseEvent* event)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/canvas_typed/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QtWidgets/QMainWindow>
#include <QtCore/QMap>
#include "qtcanvas.h"

Expand Down
22 changes: 11 additions & 11 deletions examples/canvas_typed/qtcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
****************************************************************************/

#include "qtcanvas.h"
#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include <QtGui/QBitmap>
#include <QtGui/QDesktopWidget>
#include <QtWidgets/QDesktopWidget>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtCore/QTimer>
Expand Down Expand Up @@ -256,7 +256,7 @@ void QtCanvasClusterizer::add(const QRect& rect)
include(cluster[cheapest], rect);
}

// NB: clusters do not intersect (or intersection will
// NB: clusters do not intersected (or intersectedion will
// overwrite). This is a result of the above algorithm,
// given the assumption that (x, y) are ordered topleft
// to bottomright.
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void QtCanvas::setAllChanged()
*/
void QtCanvas::setChanged(const QRect& area)
{
QRect thearea = area.intersect(QRect(0, 0, width(), height()));
QRect thearea = area.intersected(QRect(0, 0, width(), height()));

int mx = (thearea.x()+thearea.width()+chunksize)/chunksize;
int my = (thearea.y()+thearea.height()+chunksize)/chunksize;
Expand All @@ -1036,7 +1036,7 @@ void QtCanvas::setChanged(const QRect& area)
*/
void QtCanvas::setUnchanged(const QRect& area)
{
QRect thearea = area.intersect(QRect(0, 0, width(), height()));
QRect thearea = area.intersected(QRect(0, 0, width(), height()));

int mx = (thearea.x()+thearea.width()+chunksize)/chunksize;
int my = (thearea.y()+thearea.height()+chunksize)/chunksize;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ void QtCanvas::drawArea(const QRect& clip, QPainter* painter, bool dbuf)
*/
void QtCanvas::drawCanvasArea(const QRect& inarea, QPainter* p, bool /*double_buffer*/)
{
QRect area = inarea.intersect(QRect(0, 0, width(), height()));
QRect area = inarea.intersected(QRect(0, 0, width(), height()));

if (!p) return; // Nothing to do.

Expand Down Expand Up @@ -1995,7 +1995,7 @@ bool qt_testCollision(const QtCanvasSprite* s1, const QtCanvasSprite* s2)

QRect s1area = s1->boundingRectAdvanced();

QRect ourarea = s1area.intersect(cyourarea);
QRect ourarea = s1area.intersected(cyourarea);

if (ourarea.isEmpty())
return false;
Expand Down Expand Up @@ -2319,7 +2319,7 @@ bool QtCanvasText::collidesWith(const QtCanvasSprite* s,
it moves, not its current location. For example, a "ball" item
doesn't need to actually embed into a "wall" item before a
collision is detected. For items without velocity, plain
intersection is used.
intersectedion is used.
*/
QtCanvasItemList QtCanvasItem::collisions(bool exact) const
{
Expand Down Expand Up @@ -2356,7 +2356,7 @@ QtCanvasItemList QtCanvas::collisions(const QRect& r) const
/*
\overload

Returns a list of canvas items which intersect with the chunks
Returns a list of canvas items which intersected with the chunks
listed in \a chunklist, excluding \a item. If \a exact is true,
only those which actually \link QtCanvasItem::collidesWith()
collide with\endlink \a item are returned; otherwise canvas items
Expand Down Expand Up @@ -3566,7 +3566,7 @@ class QPolygonalProcessor {
{
QRect pixelbounds = pa.boundingRect();
int cs = canvas->chunkSize();
QRect canvasbounds = pixelbounds.intersect(canvas->rect());
QRect canvasbounds = pixelbounds.intersected(canvas->rect());
bounds.setLeft(canvasbounds.left()/cs);
bounds.setRight(canvasbounds.right()/cs);
bounds.setTop(canvasbounds.top()/cs);
Expand Down Expand Up @@ -5027,7 +5027,7 @@ class QtPolygonScanner {
* As we change the y-coordinate, we update each entry in
* in the active edge table to reflect the edges new xcoord.
* This list must be sorted at each scanline in case
* two edges intersect.
* two edges intersected.
* We also keep a data structure known as the Edge Table (ET),
* which keeps track of all the edges which the current
* scanline has not yet reached. The ET is basically a
Expand Down
2 changes: 1 addition & 1 deletion examples/canvas_typed/qtcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <QtGui/qbrush.h>
#include <QtGui/qpen.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qscrollarea.h>
#include <QtWidgets/qscrollarea.h>

class QtCanvasSprite;
class QtCanvasPolygonalItem;
Expand Down
3 changes: 3 additions & 0 deletions examples/canvas_variant/canvas_variant.pro
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

include(../../src/qtpropertybrowser.pri)
# Input
HEADERS += qtcanvas.h mainwindow.h
SOURCES += qtcanvas.cpp mainwindow.cpp main.cpp

DESTDIR = $$QTPROPERTYBROWSER_BINDIR
2 changes: 1 addition & 1 deletion examples/canvas_variant/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
**
****************************************************************************/

#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include "mainwindow.h"

int main(int argc, char **argv)
Expand Down
24 changes: 12 additions & 12 deletions examples/canvas_variant/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
#include "qttreepropertybrowser.h"
#include <QtGui/QMatrix>
#include <QtGui/QMouseEvent>
#include <QtGui/QMenuBar>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QDockWidget>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QMenu>
#include <QtWidgets/QAction>
#include <QtWidgets/QDockWidget>

void CanvasView::contentsMousePressEvent(QMouseEvent* event)
{
Expand Down Expand Up @@ -384,48 +384,48 @@ void MainWindow::valueChanged(QtProperty *property, const QVariant &value)
} else if (id == QLatin1String("text")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Text) {
QtCanvasText *i = (QtCanvasText *)currentItem;
i->setText(qVariantValue<QString>(value));
i->setText(qvariant_cast<QString>(value));
}
} else if (id == QLatin1String("color")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Text) {
QtCanvasText *i = (QtCanvasText *)currentItem;
i->setColor(qVariantValue<QColor>(value));
i->setColor(qvariant_cast<QColor>(value));
}
} else if (id == QLatin1String("brush")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle ||
currentItem->rtti() == QtCanvasItem::Rtti_Ellipse) {
QtCanvasPolygonalItem *i = (QtCanvasPolygonalItem *)currentItem;
QBrush b = i->brush();
b.setColor(qVariantValue<QColor>(value));
b.setColor(qvariant_cast<QColor>(value));
i->setBrush(b);
}
} else if (id == QLatin1String("pen")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle ||
currentItem->rtti() == QtCanvasItem::Rtti_Line) {
QtCanvasPolygonalItem *i = (QtCanvasPolygonalItem *)currentItem;
QPen p = i->pen();
p.setColor(qVariantValue<QColor>(value));
p.setColor(qvariant_cast<QColor>(value));
i->setPen(p);
}
} else if (id == QLatin1String("font")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Text) {
QtCanvasText *i = (QtCanvasText *)currentItem;
i->setFont(qVariantValue<QFont>(value));
i->setFont(qvariant_cast<QFont>(value));
}
} else if (id == QLatin1String("endpoint")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Line) {
QtCanvasLine *i = (QtCanvasLine *)currentItem;
QPoint p = qVariantValue<QPoint>(value);
QPoint p = qvariant_cast<QPoint>(value);
i->setPoints(i->startPoint().x(), i->startPoint().y(), p.x(), p.y());
}
} else if (id == QLatin1String("size")) {
if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle) {
QtCanvasRectangle *i = (QtCanvasRectangle *)currentItem;
QSize s = qVariantValue<QSize>(value);
QSize s = qvariant_cast<QSize>(value);
i->setSize(s.width(), s.height());
} else if (currentItem->rtti() == QtCanvasItem::Rtti_Ellipse) {
QtCanvasEllipse *i = (QtCanvasEllipse *)currentItem;
QSize s = qVariantValue<QSize>(value);
QSize s = qvariant_cast<QSize>(value);
i->setSize(s.width(), s.height());
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/canvas_variant/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QtWidgets/QMainWindow>
#include <QtCore/QMap>
#include "qtcanvas.h"

Expand Down
22 changes: 11 additions & 11 deletions examples/canvas_variant/qtcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
****************************************************************************/

#include "qtcanvas.h"
#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include <QtGui/QBitmap>
#include <QtGui/QDesktopWidget>
#include <QtWidgets/QDesktopWidget>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtCore/QTimer>
Expand Down Expand Up @@ -256,7 +256,7 @@ void QtCanvasClusterizer::add(const QRect& rect)
include(cluster[cheapest], rect);
}

// NB: clusters do not intersect (or intersection will
// NB: clusters do not intersected (or intersectedion will
// overwrite). This is a result of the above algorithm,
// given the assumption that (x, y) are ordered topleft
// to bottomright.
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void QtCanvas::setAllChanged()
*/
void QtCanvas::setChanged(const QRect& area)
{
QRect thearea = area.intersect(QRect(0, 0, width(), height()));
QRect thearea = area.intersected(QRect(0, 0, width(), height()));

int mx = (thearea.x()+thearea.width()+chunksize)/chunksize;
int my = (thearea.y()+thearea.height()+chunksize)/chunksize;
Expand All @@ -1036,7 +1036,7 @@ void QtCanvas::setChanged(const QRect& area)
*/
void QtCanvas::setUnchanged(const QRect& area)
{
QRect thearea = area.intersect(QRect(0, 0, width(), height()));
QRect thearea = area.intersected(QRect(0, 0, width(), height()));

int mx = (thearea.x()+thearea.width()+chunksize)/chunksize;
int my = (thearea.y()+thearea.height()+chunksize)/chunksize;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ void QtCanvas::drawArea(const QRect& clip, QPainter* painter, bool dbuf)
*/
void QtCanvas::drawCanvasArea(const QRect& inarea, QPainter* p, bool /*double_buffer*/)
{
QRect area = inarea.intersect(QRect(0, 0, width(), height()));
QRect area = inarea.intersected(QRect(0, 0, width(), height()));

if (!p) return; // Nothing to do.

Expand Down Expand Up @@ -1995,7 +1995,7 @@ bool qt_testCollision(const QtCanvasSprite* s1, const QtCanvasSprite* s2)

QRect s1area = s1->boundingRectAdvanced();

QRect ourarea = s1area.intersect(cyourarea);
QRect ourarea = s1area.intersected(cyourarea);

if (ourarea.isEmpty())
return false;
Expand Down Expand Up @@ -2319,7 +2319,7 @@ bool QtCanvasText::collidesWith(const QtCanvasSprite* s,
it moves, not its current location. For example, a "ball" item
doesn't need to actually embed into a "wall" item before a
collision is detected. For items without velocity, plain
intersection is used.
intersectedion is used.
*/
QtCanvasItemList QtCanvasItem::collisions(bool exact) const
{
Expand Down Expand Up @@ -2356,7 +2356,7 @@ QtCanvasItemList QtCanvas::collisions(const QRect& r) const
/*
\overload

Returns a list of canvas items which intersect with the chunks
Returns a list of canvas items which intersected with the chunks
listed in \a chunklist, excluding \a item. If \a exact is true,
only those which actually \link QtCanvasItem::collidesWith()
collide with\endlink \a item are returned; otherwise canvas items
Expand Down Expand Up @@ -3566,7 +3566,7 @@ class QPolygonalProcessor {
{
QRect pixelbounds = pa.boundingRect();
int cs = canvas->chunkSize();
QRect canvasbounds = pixelbounds.intersect(canvas->rect());
QRect canvasbounds = pixelbounds.intersected(canvas->rect());
bounds.setLeft(canvasbounds.left()/cs);
bounds.setRight(canvasbounds.right()/cs);
bounds.setTop(canvasbounds.top()/cs);
Expand Down Expand Up @@ -5027,7 +5027,7 @@ class QtPolygonScanner {
* As we change the y-coordinate, we update each entry in
* in the active edge table to reflect the edges new xcoord.
* This list must be sorted at each scanline in case
* two edges intersect.
* two edges intersected.
* We also keep a data structure known as the Edge Table (ET),
* which keeps track of all the edges which the current
* scanline has not yet reached. The ET is basically a
Expand Down
2 changes: 1 addition & 1 deletion examples/canvas_variant/qtcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <QtGui/qbrush.h>
#include <QtGui/qpen.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qscrollarea.h>
#include <QtWidgets/qscrollarea.h>

class QtCanvasSprite;
class QtCanvasPolygonalItem;
Expand Down
3 changes: 3 additions & 0 deletions examples/decoration/decoration.pro
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

include(../../src/qtpropertybrowser.pri)
# Input
SOURCES += main.cpp

DESTDIR = $$QTPROPERTYBROWSER_BINDIR
Loading