Mercurial > projects > qtd
comparison examples/draganddrop/dropsite/droparea.d @ 206:aeeaae4dd540
'Dropsite' fixes for d2.
author | SokoL_SD |
---|---|
date | Tue, 14 Jul 2009 09:13:27 +0000 |
parents | 79d648fdee0f |
children | 1f6923c8cba0 |
comparison
equal
deleted
inserted
replaced
205:3dadfee97421 | 206:aeeaae4dd540 |
---|---|
40 ****************************************************************************/ | 40 ****************************************************************************/ |
41 | 41 |
42 module droparea; | 42 module droparea; |
43 | 43 |
44 import qt.gui.QLabel; | 44 import qt.gui.QLabel; |
45 | |
46 import tango.io.Stdout; | |
47 | |
48 | 45 |
49 class DropArea : public QLabel | 46 class DropArea : public QLabel |
50 { | 47 { |
51 public: | 48 public: |
52 this(QWidget parent = null) | 49 this(QWidget parent = null) |
105 } else if (mimeData.hasText()) { | 102 } else if (mimeData.hasText()) { |
106 setText(mimeData.text()); | 103 setText(mimeData.text()); |
107 setTextFormat(Qt.PlainText); | 104 setTextFormat(Qt.PlainText); |
108 } else if (mimeData.hasUrls()) { | 105 } else if (mimeData.hasUrls()) { |
109 QUrl[] urlList = mimeData.urls(); | 106 QUrl[] urlList = mimeData.urls(); |
110 char[] text; | 107 string text; |
111 for (int i = 0; i < urlList.length && i < 32; ++i) { | 108 for (int i = 0; i < urlList.length && i < 32; ++i) { |
112 text ~= urlList[i].path() ~ "\n"; | 109 text ~= urlList[i].path() ~ "\n"; |
113 } | 110 } |
114 setText(text); | 111 setText(text); |
115 } else { | 112 } else { |