$search
00001 /* 00002 Aseba - an event-based framework for distributed robot control 00003 Copyright (C) 2007--2012: 00004 Stephane Magnenat <stephane at magnenat dot net> 00005 (http://stephane.magnenat.net) 00006 and other contributors, see authors.txt for details 00007 00008 This program is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU Lesser General Public License as published 00010 by the Free Software Foundation, version 3 of the License. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef CUSTOM_WIDGETS_H 00022 #define CUSTOM_WIDGETS_H 00023 00024 #include <QListWidget> 00025 #include <QTableView> 00026 00027 namespace Aseba 00028 { 00031 00032 class DraggableListWidget: public QListWidget 00033 { 00034 protected: 00035 virtual QStringList mimeTypes () const; 00036 virtual QMimeData * mimeData ( const QList<QListWidgetItem *> items ) const; 00037 }; 00038 00039 class FixedWidthTableView : public QTableView 00040 { 00041 protected: 00042 int col1Width; 00043 00044 public: 00045 FixedWidthTableView(); 00046 void setSecondColumnLongestContent(const QString& content); 00047 00048 protected: 00049 virtual void resizeEvent ( QResizeEvent * event ); 00050 00051 void startDrag(Qt::DropActions supportedActions); 00052 void dragEnterEvent(QDragEnterEvent *event); 00053 void dragMoveEvent(QDragMoveEvent *event); 00054 void dropEvent(QDropEvent *event); 00055 00056 QPixmap getDragPixmap(QString text); 00057 bool modelMatchMimeFormat(QStringList candidates); 00058 }; 00059 00061 }; // Aseba 00062 00063 #endif