From: Shamus Hammons Date: Fri, 2 Jul 2010 02:13:27 +0000 (+0000) Subject: Check in prior to mucking around with preview/snapper rendering... X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c40d19f69539b4afaa2c15e7b314eb7b8c88e943;p=architektonas Check in prior to mucking around with preview/snapper rendering... --- diff --git a/architektonas.pro b/architektonas.pro index b7636d3..85fe482 100644 --- a/architektonas.pro +++ b/architektonas.pro @@ -488,7 +488,6 @@ HEADERS += \ src/widgets/qg_patternbox.h \ src/widgets/qg_pentoolbar.h \ src/widgets/recentfiles.h \ - src/widgets/qg_scrollbar.h \ src/widgets/qg_widthbox.h SOURCES += \ @@ -577,7 +576,6 @@ SOURCES += \ src/widgets/qg_patternbox.cpp \ src/widgets/qg_pentoolbar.cpp \ src/widgets/recentfiles.cpp \ - src/widgets/qg_scrollbar.cpp \ src/widgets/qg_widthbox.cpp FORMS = \ diff --git a/src/actions/rs_actiondrawline.cpp b/src/actions/rs_actiondrawline.cpp index ce6ccdf..c52fc44 100644 --- a/src/actions/rs_actiondrawline.cpp +++ b/src/actions/rs_actiondrawline.cpp @@ -25,8 +25,6 @@ RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, GraphicView { RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine"); reset(); -//[DONE]#warning "!!! Need to port setAutoDelete() behaviour from Qt3 to Qt4 !!!" -// history.setAutoDelete(true); RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine: OK"); } @@ -45,7 +43,6 @@ void RS_ActionDrawLine::reset() RS_DEBUG->print("RS_ActionDrawLine::reset"); data = RS_LineData(Vector(false), Vector(false)); start = Vector(false); -// history.clear(); ClearHistory(); RS_DEBUG->print("RS_ActionDrawLine::reset: OK"); } @@ -54,14 +51,13 @@ void RS_ActionDrawLine::init(int status) { RS_DEBUG->print("RS_ActionDrawLine::init"); RS_PreviewActionInterface::init(status); - reset(); RS_DEBUG->print("RS_ActionDrawLine::init: OK"); } void RS_ActionDrawLine::trigger() { - RS_PreviewActionInterface::trigger(); + RS_PreviewActionInterface::trigger(); // XOR off screen, delete entities in container RS_Line * line = new RS_Line(container, data); line->setLayerToActive(); @@ -74,20 +70,20 @@ void RS_ActionDrawLine::trigger() //std::cout << *container; // Update undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(line); document->endUndoCycle(); } - deleteSnapper(); + deleteSnapper(); // XOR off of screen graphicView->moveRelativeZero(Vector(0.0, 0.0)); //This is unnecessary, because we added this to the container... //#warning "!!! Here's the trouble... Trying to draw direct !!!" // graphicView->drawEntity(line); graphicView->moveRelativeZero(line->getEndpoint()); - drawSnapper(); + drawSnapper(); // XOR on screen RS_DEBUG->print("RS_ActionDrawLine::trigger(): line added: %d", line->getId()); } @@ -102,11 +98,14 @@ void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e) if (getStatus() == SetEndpoint && data.startpoint.valid) { RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: update preview"); - deletePreview(); - clearPreview(); +//not needed, but without this, it doesn't draw... strange... +//obviously we haven't gotten our rendering path correct... +// deletePreview(); // XOR off of screen + clearPreview(); // Remove entities from the container preview->addEntity(new RS_Line(preview, RS_LineData(data.startpoint, mouse))); RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: draw preview"); - drawPreview(); +// drawPreview(); // XOR on screen + xorPreview(); // XOR on screen } RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent end"); @@ -121,9 +120,9 @@ void RS_ActionDrawLine::mouseReleaseEvent(QMouseEvent * e) } else if (e->button() == Qt::RightButton) { - deletePreview(); - clearPreview(); - deleteSnapper(); + deletePreview(); // XOR off of screen + clearPreview(); // Remove entities from the container + deleteSnapper(); // XOR off of screen init(getStatus() - 1); } } @@ -132,7 +131,7 @@ void RS_ActionDrawLine::coordinateEvent(Vector * e) { RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent"); - if (e == NULL) + if (!e) { RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent: event was NULL"); return; @@ -144,7 +143,6 @@ void RS_ActionDrawLine::coordinateEvent(Vector * e) { case SetStartpoint: data.startpoint = mouse; -// history.clear(); ClearHistory(); history.append(new Vector(mouse)); start = data.startpoint; @@ -273,7 +271,6 @@ void RS_ActionDrawLine::showOptions() { RS_DEBUG->print("RS_ActionDrawLine::showOptions"); RS_ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); RS_DEBUG->print("RS_ActionDrawLine::showOptions: OK"); } @@ -281,7 +278,6 @@ void RS_ActionDrawLine::showOptions() void RS_ActionDrawLine::hideOptions() { RS_ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); } @@ -300,6 +296,8 @@ void RS_ActionDrawLine::updateToolBar() void RS_ActionDrawLine::close() { +//NOTE: We should grey out the "close" button until the conditions for its use are satisfied. +// Though I can see how this would be called via cmd line... So I guess it's OK if (history.count() > 2 && start.valid) { data.endpoint = start; @@ -313,11 +311,12 @@ void RS_ActionDrawLine::close() void RS_ActionDrawLine::undo() { +//NOTE: We should grey out the "undo" button until the conditions for its use are satisfied. if (history.count() > 1) { history.removeLast(); - deletePreview(); - clearPreview(); + deletePreview(); // XOR off of screen + clearPreview(); // Delete entities in container graphicView->setCurrentAction(new RS_ActionEditUndo(true, *container, *graphicView)); data.startpoint = *history.last(); graphicView->moveRelativeZero(data.startpoint); @@ -331,4 +330,3 @@ void RS_ActionDrawLine::ClearHistory(void) while (!history.isEmpty()) delete history.takeFirst(); } - diff --git a/src/base/rs_actioninterface.cpp b/src/base/rs_actioninterface.cpp index 7a885f8..e679028 100644 --- a/src/base/rs_actioninterface.cpp +++ b/src/base/rs_actioninterface.cpp @@ -89,13 +89,13 @@ QString RS_ActionInterface::getName() } /** - * Called to initiate an action. This funtcion is often + * Called to initiate an action. This function is often * overwritten by the implementing action. * * @param status The status on which to initiate this action. * default is 0 to begin the action. */ -void RS_ActionInterface::init(int status) +void RS_ActionInterface::init(int status/*= 0*/) { RS_Snapper::init(); setStatus(status); @@ -280,10 +280,14 @@ void RS_ActionInterface::finish() graphicView->setMouseCursor(RS2::ArrowCursor); //graphicView->requestToolBar(RS2::ToolBarMain); updateToolBar(); +//Maybe change this to SnapperOff()? //jlh: deleteSnapper(); hideOptions(); finished = true; - RS_Snapper::finish(); + RS_Snapper::finish(); // Sets RS_Snapper::finished = true + // I think this is where we want to update the screen... +// graphicView->update(); + graphicView->redraw(); RS_DEBUG->print("RS_ActionInterface::finish: OK"); } diff --git a/src/base/rs_actioninterface.h b/src/base/rs_actioninterface.h index c2daeb1..d9fd828 100644 --- a/src/base/rs_actioninterface.h +++ b/src/base/rs_actioninterface.h @@ -25,7 +25,8 @@ class RS_ActionInterface: public QObject, public RS_Snapper //huh? no slots/signals here... Q_OBJECT //WHY derive from QObject??? //for the TR macro??? -//mebbe... +//mebbe... Well, that's what he says above. Though it would be just as easy to +//prefix a QObject::tr in front of translated strings... public: RS_ActionInterface(const char * name, RS_EntityContainer & container, GraphicView & graphicView); diff --git a/src/base/rs_previewactioninterface.cpp b/src/base/rs_previewactioninterface.cpp index 1f59867..3301ac6 100644 --- a/src/base/rs_previewactioninterface.cpp +++ b/src/base/rs_previewactioninterface.cpp @@ -109,7 +109,8 @@ void RS_PreviewActionInterface::deletePreview() */ void RS_PreviewActionInterface::xorPreview() { -#warning "!!! xorPreview() not working AT ALL !!!" +//not true anymore.. +//#warning "!!! xorPreview() not working AT ALL !!!" #if 0 if (!preview->isEmpty()) { @@ -132,7 +133,6 @@ void RS_PreviewActionInterface::xorPreview() //This doesn't work, causes the thing to crash... //Now it works, just need to upgrade the rendering paths so that they aren't all //fucked up like QCad was... -#if 1 if (!preview->isEmpty()) { graphicView->SetPreviewMode(); @@ -143,5 +143,4 @@ void RS_PreviewActionInterface::xorPreview() visible = !visible; #endif -#endif } diff --git a/src/base/rs_previewactioninterface.h b/src/base/rs_previewactioninterface.h index 529fb0c..2b356dc 100644 --- a/src/base/rs_previewactioninterface.h +++ b/src/base/rs_previewactioninterface.h @@ -28,7 +28,8 @@ class RS_PreviewActionInterface: public RS_ActionInterface void drawPreview(); void deletePreview(); - private: +// private: + protected: void xorPreview(); protected: diff --git a/src/base/rs_snapper.cpp b/src/base/rs_snapper.cpp index 9505d6b..13d76a9 100644 --- a/src/base/rs_snapper.cpp +++ b/src/base/rs_snapper.cpp @@ -183,7 +183,7 @@ Vector RS_Snapper::snapPoint(QMouseEvent * e) #warning "!!! THIS IS WHERE THE SNAPPER IS BEING DRAWN... !!!" drawSnapper(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateCoordinateWidget(snapCoord, snapCoord - graphicView->getRelativeZero()); RS_DEBUG->print("RS_Snapper::snapPoint: OK"); @@ -409,10 +409,10 @@ RS_Entity * RS_Snapper::catchEntity(const Vector& pos, RS2::ResolveLevel level) int idx = -1; - if (entity != NULL && entity->getParent() != NULL) + if (entity && entity->getParent()) idx = entity->getParent()->findEntity(entity); - if (entity != NULL && dist <= graphicView->toGraphDX(snapRange)) + if (entity && dist <= graphicView->toGraphDX(snapRange)) { // highlight: RS_DEBUG->print("RS_Snapper::catchEntity: found: %d", idx); @@ -425,7 +425,7 @@ RS_Entity * RS_Snapper::catchEntity(const Vector& pos, RS2::ResolveLevel level) } RS_DEBUG->print("RS_Snapper::catchEntity: OK"); - } +} /** * Catches an entity which is close to the mouse cursor. @@ -463,9 +463,8 @@ void RS_Snapper::resume() */ void RS_Snapper::hideOptions() { - if (snapMode == RS2::SnapDist) - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->requestSnapDistOptions(distance, false); + if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY) + RS_DIALOGFACTORY->requestSnapDistOptions(distance, false); } /** @@ -473,9 +472,8 @@ void RS_Snapper::hideOptions() */ void RS_Snapper::showOptions() { - if (snapMode == RS2::SnapDist) - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->requestSnapDistOptions(distance, true); + if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY) + RS_DIALOGFACTORY->requestSnapDistOptions(distance, true); } /** @@ -483,6 +481,7 @@ void RS_Snapper::showOptions() */ void RS_Snapper::drawSnapper() { +printf("RS_Snapper::drawSnapper(): Using DEPRECATED function!!!\n"); if (!visible) xorSnapper(); } @@ -492,6 +491,7 @@ void RS_Snapper::drawSnapper() */ void RS_Snapper::deleteSnapper() { +printf("RS_Snapper::deleteSnapper(): Using DEPRECATED function!!!\n"); if (visible) { xorSnapper(); @@ -556,3 +556,15 @@ void RS_Snapper::xorSnapper() visible = !visible; #endif } + +void RS_Snapper::SetSnapperVisible(bool visibility/*= true*/) +{ + graphicView->SetSnapperDraw(visibility); +} + +//Hmm, not sure this is necessary... +#warning "!!! Not sure this is necessary... !!!" +void RS_Snapper::SetSnapperCoords(Vector snapCoord, Vector snapSpot) +{ + graphicView->SetSnapperVars(snapSpot, snapCoord, showCrosshairs); +} diff --git a/src/base/rs_snapper.h b/src/base/rs_snapper.h index 30e4a0c..3967d5e 100644 --- a/src/base/rs_snapper.h +++ b/src/base/rs_snapper.h @@ -48,8 +48,6 @@ class RS_Snapper Vector restrictHorizontal(Vector coord); Vector restrictVertical(Vector coord); - //RS_Entity* catchLeafEntity(const Vector& pos); - //RS_Entity* catchLeafEntity(QMouseEvent* e); RS_Entity * catchEntity(const Vector & pos, RS2::ResolveLevel level = RS2::ResolveNone); RS_Entity * catchEntity(QMouseEvent * e, RS2::ResolveLevel level = RS2::ResolveNone); @@ -61,6 +59,36 @@ class RS_Snapper void drawSnapper(); void deleteSnapper(); +/* +How should we handle this? All rendering goes through the GraphicView (QG_GraphicView to be +precise, soon to be merged in) as it should. So shouldn't we control the snapper through +that class as well? Unfortunately, all actions derive from this class... + +Should they? + +Not 100% sure. It does seem to make more sense to have them be a part of the GraphicView, +since snapping is a function of the grid and the entities contained in the view. (This would +also hold for the preview as well.) + +On to the interface: + +For allowing the crosshairs to be drawn, we'd have +void ShowSnapper(void) + +and +void HideSnapper(void) + +to hide it. Maybe +void SetSnapperCoords(Vector, Vector) + +for setting the coordinates? +*/ + protected: +// void ShowSnapper(void); +// void HideSnapper(void); + void SetSnapperVisible(bool visibility = true); + void SetSnapperCoords(Vector, Vector); + private: void xorSnapper(); diff --git a/src/base/rs_staticgraphicview.cpp b/src/base/rs_staticgraphicview.cpp index 59b8b4c..ca6d125 100644 --- a/src/base/rs_staticgraphicview.cpp +++ b/src/base/rs_staticgraphicview.cpp @@ -13,6 +13,12 @@ // JLH 06/15/2010 Moved implementation (however trivial) from header to here. // +/* +To me, this is yet another useless class. It seems to me that this could be +easily replaced by putting a bitmap creation method in GraphicView. But that's +just me. >:-) +*/ + #include "rs_staticgraphicview.h" /** diff --git a/src/mainapp/graphicview.cpp b/src/mainapp/graphicview.cpp index 69efb10..90aa44e 100644 --- a/src/mainapp/graphicview.cpp +++ b/src/mainapp/graphicview.cpp @@ -1992,8 +1992,21 @@ void GraphicView::drawAbsoluteZero() */ void GraphicView::drawRelativeZero() { +// PROBLEM: relativeZero IS NOT VALID!!! if (!relativeZero.valid || !painter) +#if 1 return; +#else + { + if (!relativeZero.valid) + printf("GraphicView::drawRelativeZero(): relativeZero is NOT valid!!!\n"); + + if (!painter) + printf("GraphicView::drawRelativeZero(): painter is NOT valid!!!\n"); + + return; + } +#endif // RS_Pen p(Qt::red, RS2::Width00, RS2::SolidLine); // p.setScreenWidth(0); @@ -2319,14 +2332,15 @@ void GraphicView::setRelativeZero(const Vector & pos) */ void GraphicView::moveRelativeZero(const Vector & pos) { -#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!" - if (!painter) - return; +//this is crap. we're taking this shit out. +//#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!" +// if (!painter) +// return; //painter->setXORMode(); - drawRelativeZero(); +// drawRelativeZero(); setRelativeZero(pos); - drawRelativeZero(); +// drawRelativeZero(); } RS_EventHandler * GraphicView::getEventHandler() diff --git a/src/mainapp/qc_dialogfactory.cpp b/src/mainapp/qc_dialogfactory.cpp index 716b50c..d7f6eeb 100644 --- a/src/mainapp/qc_dialogfactory.cpp +++ b/src/mainapp/qc_dialogfactory.cpp @@ -35,21 +35,16 @@ void QC_DialogFactory::requestEditBlockWindow(RS_BlockList * blockList) ApplicationWindow * appWindow = ApplicationWindow::getAppWindow(); MDIWindow * parent = appWindow->getMDIWindow(); - if (parent != NULL) + if (parent && blockList) { - //RS_BlockList* blist = blockWidget->getBlockList(); - if (blockList != NULL) - { - RS_Block * blk = blockList->getActive(); + RS_Block * block = blockList->getActive(); - if (blk != NULL) - { - MDIWindow * w = appWindow->slotFileNew(blk); - // the parent needs a pointer to the block window and - // vice versa - parent->addChildWindow(w); - w->getGraphicView()->zoomAuto(false); - } + if (block) + { + MDIWindow * w = appWindow->slotFileNew(block); + // the parent needs a pointer to the block window and vice versa + parent->addChildWindow(w); + w->getGraphicView()->zoomAuto(false); } } } @@ -64,18 +59,18 @@ void QC_DialogFactory::closeEditBlockWindow(RS_Block * block) ApplicationWindow * appWindow = ApplicationWindow::getAppWindow(); QMdiArea * workspace = appWindow->getWorkspace(); - if (workspace != NULL) + if (workspace) { RS_DEBUG->print("QC_DialogFactory::closeEditBlockWindow: workspace found"); QList windows = workspace->subWindowList(); - for(int i=0; iprint("QC_DialogFactory::closeEditBlockWindow: window: %d", i); MDIWindow * m = (MDIWindow *)windows.at(i); - if (m != NULL) + if (m) { RS_DEBUG->print("QC_DialogFactory::closeEditBlockWindow: got mdi"); diff --git a/src/widgets/qg_actionhandler.h b/src/widgets/qg_actionhandler.h index d5d68c2..3126a37 100644 --- a/src/widgets/qg_actionhandler.h +++ b/src/widgets/qg_actionhandler.h @@ -205,7 +205,6 @@ class QG_ActionHandler: public QObject void setActionRestrictVertical(QAction * a); void setActionLockRelativeZero(QAction * a); -// void setCadToolBarSnap(QG_CadToolBarSnap * tb); void setCadToolBarSnap(CadToolBarSnap * tb); private: diff --git a/src/widgets/qg_blockwidget.cpp b/src/widgets/qg_blockwidget.cpp index e5f67e0..e3ea143 100644 --- a/src/widgets/qg_blockwidget.cpp +++ b/src/widgets/qg_blockwidget.cpp @@ -324,7 +324,6 @@ void QG_BlockWidget::slotMouseButtonClicked(QListWidgetItem * item) */ void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e) { -#warning "Figure out how to port this crap (popup menu) to Qt4... !!! FIX !!!" #if 0 //QListBoxItem* item = listBox->selectedItem(); Q3PopupMenu * contextMenu = new Q3PopupMenu(this); @@ -344,6 +343,8 @@ void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e) contextMenu->insertItem(tr("&Create New Block"), actionHandler, SLOT(slotBlocksCreate()), 0); contextMenu->exec(QCursor::pos()); delete contextMenu; +#else +#warning "Figure out how to port this crap (popup menu) to Qt4... !!! FIX !!!" #endif e->accept(); diff --git a/src/widgets/qg_graphicview.cpp b/src/widgets/qg_graphicview.cpp index 4704f0a..e306fa6 100644 --- a/src/widgets/qg_graphicview.cpp +++ b/src/widgets/qg_graphicview.cpp @@ -94,7 +94,8 @@ Alignment is specified by alignment, which is a bitwise OR of Qt::AlignmentFlags A non-zero alignment indicates that the widget should not grow to fill the available space but should be sized according to sizeHint(). */ RS_DEBUG->print("--> Creating hScrollBar..."); - hScrollBar = new QG_ScrollBar(Qt::Horizontal, this); +// hScrollBar = new QG_ScrollBar(Qt::Horizontal, this); + hScrollBar = new QScrollBar(Qt::Horizontal, this); // hScrollBar->setLineStep(50); hScrollBar->setSingleStep(50); // layout->addMultiCellWidget(hScrollBar, 1, 1, 0, 0); @@ -103,7 +104,8 @@ A non-zero alignment indicates that the widget should not grow to fill the avail layout->addItem(new QSpacerItem(0, hScrollBar->sizeHint().height()), 1, 0); RS_DEBUG->print("--> Creating vScrollBar..."); - vScrollBar = new QG_ScrollBar(Qt::Vertical, this); +// vScrollBar = new QG_ScrollBar(Qt::Vertical, this); + vScrollBar = new QScrollBar(Qt::Vertical, this); // vScrollBar->setLineStep(50); vScrollBar->setSingleStep(50); // layout->addMultiCellWidget(vScrollBar, 0, 0, 2, 2); @@ -369,7 +371,10 @@ void QG_GraphicView::resizeEvent(QResizeEvent * /*e*/) /* This is retarded. There is absolutely no reason to have this shit in here. This could be easily called from whoever calls this crap. + +And so... We remove it. */ +#if 0 // Next three methods from RS_LayerListListener Interface: void QG_GraphicView::layerEdited(RS_Layer *) { @@ -385,6 +390,7 @@ void QG_GraphicView::layerToggled(RS_Layer *) { redraw(); } +#endif void QG_GraphicView::emulateMouseMoveEvent() { diff --git a/src/widgets/qg_graphicview.h b/src/widgets/qg_graphicview.h index 2b3293b..04d58a1 100644 --- a/src/widgets/qg_graphicview.h +++ b/src/widgets/qg_graphicview.h @@ -18,8 +18,8 @@ class RS_Preview; * Instances of this class can be linked to layer lists using * addLayerListListener(). */ -class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview, - public RS_LayerListListener, public RS_BlockListListener +class QG_GraphicView: public QWidget, public GraphicView//, //public Q3FilePreview, +// public RS_LayerListListener, public RS_BlockListListener { Q_OBJECT @@ -37,10 +37,12 @@ class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview virtual void setMouseCursor(RS2::CursorType c); virtual void updateGridStatusWidget(const QString & text); +// This is just crap. Why have a klunky listener interface when we have slots/signals??? +// That's what I thought!!! // Methods from RS_LayerListListener Interface: - virtual void layerEdited(RS_Layer *); - virtual void layerRemoved(RS_Layer *); - virtual void layerToggled(RS_Layer *); +// virtual void layerEdited(RS_Layer *); +// virtual void layerRemoved(RS_Layer *); +// virtual void layerToggled(RS_Layer *); protected: virtual void emulateMouseMoveEvent(); @@ -79,9 +81,11 @@ class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview int lastWidth; int lastHeight; //! Horizontal scrollbar. - QG_ScrollBar * hScrollBar; +// QG_ScrollBar * hScrollBar; + QScrollBar * hScrollBar; //! Vertical scrollbar. - QG_ScrollBar * vScrollBar; +// QG_ScrollBar * vScrollBar; + QScrollBar * vScrollBar; //! Layout used to fit in the view and the scrollbars. QGridLayout * layout; //! Label for grid spacing. diff --git a/src/widgets/qg_scrollbar.cpp b/src/widgets/qg_scrollbar.cpp deleted file mode 100644 index 646c64c..0000000 --- a/src/widgets/qg_scrollbar.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// qg_scrollbar.cpp -// -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 05/08/2010 Moved implementation from header to this file. :-) -// - -// This class seems worse than useless to me; probably will end up removing it -// at some point. :-P - -#include "qg_scrollbar.h" - -QG_ScrollBar::QG_ScrollBar(QWidget * parent/*= 0*/, const char */*name = 0*/): -// QScrollBar(parent, name) - QScrollBar(parent) -{ -} - -QG_ScrollBar::QG_ScrollBar(Qt::Orientation orientation, QWidget * parent/*= 0*/, const char */*name = 0*/): -// QScrollBar(orientation, parent, name) - QScrollBar(orientation, parent) -{ -} - -void QG_ScrollBar::slotWheelEvent(QWheelEvent * e) -{ - wheelEvent(e); -} diff --git a/src/widgets/qg_scrollbar.h b/src/widgets/qg_scrollbar.h deleted file mode 100644 index 807d5cd..0000000 --- a/src/widgets/qg_scrollbar.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef QG_SCROLLBAR_H -#define QG_SCROLLBAR_H - -#include - -/** - * A small wrapper for the Qt scrollbar. This class offers a slot - * for scroll events. - */ -class QG_ScrollBar: public QScrollBar -{ - Q_OBJECT - - public: - QG_ScrollBar(QWidget * parent = 0, const char * name = 0); - QG_ScrollBar(Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0); - - public slots: - void slotWheelEvent(QWheelEvent * e); -}; - -#endif