Qtの - Librecadソースコード解析

ライブラリ

  • jwwlib
  • libdxfrw:テキストまたはバイナリ形式の読み込みと書き込みのためのC ++、DXFファイル形式の無料ライブラリ(C ++ライブラリはDXF / DWGファイルを読み書きします)
  • muparser:計算は非常にあるので、などのカスタムマルチパラメトリック機能、カスタムの定数、変数、および単項の接頭辞、接尾演算子、二項演算子とすることができるクロスプラットフォームのライブラリーの分析式が、それは、バイトコード式にコンパイルされます速いです

LibreCAD

  • SRC:ソース
    • アクション:アクション
    • CMD:コマンドライン
    • LIB:さまざまなライブラリ
      • アクション:イベントへの応答の様々な処理
      • 創造
      • デバッグ
      • エンジン
      • FILEIO
      • フィルタ
      • 発電機
      • GUI:インタフェースの表示
      • 情報
      • 数学
      • 変形
      • 印刷
      • スクリプティング
    • メイン:スタートプログラムと窓
    • プラグイン:プラグイン
    • テスト
    • UI:インタフェース制御

 

 

 

 

 

 qc_applicationwindow

 1 /**
 2  * Redraws all mdi windows.
 3  */
 4 void QC_ApplicationWindow::redrawAll()
 5 {
 6     if (mdiAreaCAD)
 7     {
 8         foreach (const QC_MDIWindow* win, window_list)
 9         {
10             if (win)
11             {
12                 QG_GraphicView* gv = win->getGraphicView();
13                 if (gv) {gv->redraw();}
14             }
15         }
16     }
17 }

\librecad\src\ui

qg_graphicView

updateGridStatusWidget()

1 /**
2  * Sets the text for the grid status widget in the left bottom corner.
3  */
4 void QG_GraphicView::updateGridStatusWidget(const QString& text)
5 {
6    emit gridStatusChanged(text);
7 }

wheelEvent()

1 /**
2  * mouse wheel event. zooms in/out or scrolls when
3  * shift or ctrl is pressed.
4  */
5 void QG_GraphicView::wheelEvent(QWheelEvent *e) {...}

 \librecad\src\lib\gui

rs_graphicview

centerOffsetX()

 1 /**
 2  * Centers the drawing in x-direction.
 3  */
 4 void RS_GraphicView::centerOffsetX() {
 5     if (container && !zoomFrozen) {
 6         offsetX = (int)(((getWidth()-borderLeft-borderRight)
 7                          - (container->getSize().x*factor.x))/2.0
 8                         - (container->getMin().x*factor.x)) + borderLeft;
 9     }
10 }

zoomScroll()

 1 /**
 2  * Scrolls in the given direction.
 3  */
 4 void RS_GraphicView::zoomScroll(RS2::Direction direction) {
 5     switch (direction) {
 6     case RS2::Up:
 7         offsetY-=50;
 8         break;
 9     case RS2::Down:
10         offsetY+=50;
11         break;
12     case RS2::Right:
13         offsetX+=50;
14         break;
15     case RS2::Left:
16         offsetX-=50;
17         break;
18     }
19     adjustOffsetControls();
20     adjustZoomControls();
21     //    updateGrid();
22 
23     redraw();
24 }

<QCursor>

The QCursor class provides a mouse cursor with an arbitrary shape

<QDockWidget>

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop

 

 参考:

 https://blog.csdn.net/Caoyang_He/article/details/80343945

 

おすすめ

転載: www.cnblogs.com/cxc1357/p/11884417.html