source: s10k/Vago/libs/DropTableWidget/droptablewidget.h@ 1102

Last change on this file since 1102 was 1061, checked in by s10k, 8 years ago

Added Vago 1.3

File size: 1.9 KB
Line 
1#ifndef DROPTABLEWIDGET_H
2#define DROPTABLEWIDGET_H
3
4#include <QTableWidget>
5#include <QtWidgets>
6
7#include "utilvago.h"
8
9
10//Used in swapPositions function, for switching orders and maintain the disabled style
11struct tableRowProperties{ //No need for typedef in c++ :)
12 QStringList cells;
13 bool isDisabled;
14
15 tableRowProperties(){
16 cells = QStringList(); //initialize the list on the constructor
17 isDisabled=false; //if you don't initialize a variable at c++ it is random assigned!
18 }
19};
20
21class QMimeData;
22
23class DropTableWidget : public QTableWidget {
24
25 Q_OBJECT
26
27public:
28 DropTableWidget(QWidget *parent = 0,
29 QBrush _disabledBackStyle = QPalette().brush(QPalette::Disabled,QPalette::Base),
30 QBrush _disabledTextStyle = QPalette().brush(QPalette::Disabled,QPalette::WindowText));
31
32 const QBrush disabledBackStyle;
33 const QBrush disabledTextStyle;
34
35 void swapPositions(QList<int> rowsSelected, int numUnitsToMove);
36 void resetStyleWidgetItem(QTableWidgetItem *currentItem);
37 void setDisableStyleWidgetItem(QTableWidgetItem *currentItem);
38 void updateTableToolTips(int row);
39 QString getFileAbsolute(int row);
40 QString getOutputAbsolute(int row);
41
42public slots:
43 void clear();
44
45signals:
46 void changed(const QMimeData *mimeData = 0);
47 void dropped(DropTableWidget *myTable, QStringList pathList);
48 QString getTypeConversion(DropTableWidget *thisTable);
49 void changeToCurrentSettings(int rows[], DropTableWidget* thisTable);
50 void dtContextMenu(DropTableWidget* thisTable, QContextMenuEvent *event);
51
52protected:
53 void dragEnterEvent(QDragEnterEvent *event);
54 void dragMoveEvent(QDragMoveEvent *event);
55 void dragLeaveEvent(QDragLeaveEvent *event);
56 void dropEvent(QDropEvent *event);
57 void contextMenuEvent(QContextMenuEvent * event);
58
59private:
60 QTableWidget *tablewidget;
61};
62
63#endif // DROPTABLEWIDGET_H
Note: See TracBrowser for help on using the repository browser.