1 2 /* 3 * CodeQuery 4 * Copyright (C) 2013-2017 ruben2020 https://github.com/ruben2020/ 5 * 6 * This Source Code Form is subject to the terms of the Mozilla Public 7 * License, v. 2.0. If a copy of the MPL was not distributed with this 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 * 10 */ 11 12 13 #ifndef LISTHANDLER_H_CQ 14 #define LISTHANDLER_H_CQ 15 16 #ifdef USE_QT5 17 #include <QtWidgets> 18 #else 19 #include <QtGui> 20 #endif 21 22 #include "sqlquery.h" 23 24 class mainwindow; 25 26 class listhandler : public QObject 27 { 28 Q_OBJECT 29 30 public: 31 QTreeWidget *m_treeWidgetSearchResults; 32 QPushButton *m_pushButtonUp; 33 QPushButton *m_pushButtonDown; 34 35 listhandler(mainwindow* pmw); 36 ~listhandler(); 37 void init(void); 38 void updateList(void); 39 void prepareToExit(void); 40 void updateListHeaders(void); 41 void resizeColumns(void); 42 void retranslateUi(void); 43 void checkUpDown(void); 44 45 public slots: 46 void populateList(sqlqueryresultlist resultlist, int selectitem); 47 void listItemClicked(QTreeWidgetItem * current, QTreeWidgetItem * previous); 48 void clearList(); 49 void requestToProvideResultCurrentListItemSymbolName(); 50 void Up_ButtonClick(bool checked); 51 void Down_ButtonClick(bool checked); 52 53 signals: 54 void openFile(QString file, QString linenum, int fileid); 55 void listRowNumUpdated(int row); 56 void sendResultCurrentListItemSymbolName(const QString symName); 57 58 private: 59 mainwindow *mw; 60 sqlqueryresultlist m_sqlist; 61 bool m_noclick; 62 63 }; 64 65 66 #endif 67 68