Showing
5 changed files
with
7 additions
and
28 deletions
| ... | @@ -25,16 +25,11 @@ MainWindow::~MainWindow() | ... | @@ -25,16 +25,11 @@ MainWindow::~MainWindow() |
| 25 | 25 | ||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | -void MainWindow::print_graph(const char * filename) | 28 | +void MainWindow::make_graph(const char* filename) |
| 29 | { | 29 | { |
| 30 | - graphWidget->print_graph(filename); | 30 | + graphWidget->make_graph(filename); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | -//void MainWindow::print_graph(std::ifstream *pFin) | ||
| 34 | -//{ | ||
| 35 | -// graphWidget->print_graph(pFin); | ||
| 36 | -//} | ||
| 37 | - | ||
| 38 | ////////////////////////////////////////////////////////////////// | 33 | ////////////////////////////////////////////////////////////////// |
| 39 | // private methods | 34 | // private methods |
| 40 | ////////////////////////////////////////////////////////////////// | 35 | ////////////////////////////////////////////////////////////////// | ... | ... |
| ... | @@ -12,8 +12,7 @@ public: | ... | @@ -12,8 +12,7 @@ public: |
| 12 | MainWindow(QWidget *parent = 0); | 12 | MainWindow(QWidget *parent = 0); |
| 13 | ~MainWindow(); | 13 | ~MainWindow(); |
| 14 | 14 | ||
| 15 | - //void print_graph(std::ifstream *pFin); | 15 | + void make_graph(const char* filename); |
| 16 | - void print_graph(const char* filename); | ||
| 17 | 16 | ||
| 18 | 17 | ||
| 19 | private: | 18 | private: | ... | ... |
| ... | @@ -25,22 +25,10 @@ PaperGraphWidget::PaperGraphWidget(QWidget *parent) | ... | @@ -25,22 +25,10 @@ PaperGraphWidget::PaperGraphWidget(QWidget *parent) |
| 25 | setWindowTitle(tr("dblp paper graph visualization")); | 25 | setWindowTitle(tr("dblp paper graph visualization")); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | -//void PaperGraphWidget::print_graph(ifstream* pFin) | 28 | +void PaperGraphWidget::make_graph(const char* filename) |
| 29 | -//{ | ||
| 30 | -// qDebug("* PaperGraphWidget::print_graph"); | ||
| 31 | -// //QGraphicsItem *graph_item = new GraphItem(fin); | ||
| 32 | -// if (graphItem) | ||
| 33 | -// throw std::exception("already have graph item"); | ||
| 34 | -// | ||
| 35 | -// graphItem = new GraphItem(pFin); | ||
| 36 | -// graphItem->setPos(0, 0); | ||
| 37 | -// scene->addItem(graphItem); | ||
| 38 | -//} | ||
| 39 | - | ||
| 40 | -void PaperGraphWidget::print_graph(const char * filename) | ||
| 41 | { | 29 | { |
| 42 | if (graphItem) | 30 | if (graphItem) |
| 43 | - throw std::exception("already have graph item"); | 31 | + throw std::exception("graph is already exist"); |
| 44 | 32 | ||
| 45 | graphItem = new GraphItem(filename); | 33 | graphItem = new GraphItem(filename); |
| 46 | graphItem->setPos(0, 0); | 34 | graphItem->setPos(0, 0); | ... | ... |
| ... | @@ -11,8 +11,7 @@ class PaperGraphWidget : public QWidget | ... | @@ -11,8 +11,7 @@ class PaperGraphWidget : public QWidget |
| 11 | 11 | ||
| 12 | public: | 12 | public: |
| 13 | PaperGraphWidget(QWidget *parent = 0); | 13 | PaperGraphWidget(QWidget *parent = 0); |
| 14 | - //void print_graph(ifstream* pFin); | 14 | + void make_graph(const char* filename); |
| 15 | - void print_graph(const char* filename); | ||
| 16 | 15 | ||
| 17 | //main window slots | 16 | //main window slots |
| 18 | void read_more(); | 17 | void read_more(); | ... | ... |
| ... | @@ -9,9 +9,7 @@ int main(int argc, char *argv[]) | ... | @@ -9,9 +9,7 @@ int main(int argc, char *argv[]) |
| 9 | MainWindow m; | 9 | MainWindow m; |
| 10 | 10 | ||
| 11 | try { | 11 | try { |
| 12 | - //ifstream fin(PAPER_FILENAME); | 12 | + m.make_graph(PAPER_FILENAME); |
| 13 | - m.print_graph(PAPER_FILENAME); | ||
| 14 | - //fin.close(); | ||
| 15 | } catch (const std::exception& e) { | 13 | } catch (const std::exception& e) { |
| 16 | qDebug() << "Error: " << e.what(); | 14 | qDebug() << "Error: " << e.what(); |
| 17 | return EXIT_FAILURE; | 15 | return EXIT_FAILURE; | ... | ... |
-
Please register or login to post a comment