Mercurial > projects > qtd
diff examples/draganddrop/dropsite/dropsitewindow.d @ 323:7a3c43424dca signals
make all examples compile with new signals/slots
author | eldar_ins@eldar-laptop |
---|---|
date | Mon, 28 Dec 2009 16:28:55 +0500 |
parents | 256ab6cb8e85 |
children | 31520b2c0b3c |
line wrap: on
line diff
--- a/examples/draganddrop/dropsite/dropsitewindow.d Sun Dec 27 21:13:38 2009 +0500 +++ b/examples/draganddrop/dropsite/dropsitewindow.d Mon Dec 28 16:28:55 2009 +0500 @@ -67,7 +67,7 @@ abstractLabel.adjustSize(); dropArea = new DropArea; - connect!("changed")(dropArea, &updateFormatsTable); + connect(dropArea, "changed", this, "updateFormatsTable"); string[] labels; labels ~= tr("Format"); @@ -76,7 +76,7 @@ formatsTable = new QTableWidget; formatsTable.setColumnCount(2); formatsTable.setEditTriggers(QAbstractItemView.NoEditTriggers); - formatsTable.setHorizontalHeaderLabels(labels); + formatsTable.setHorizontalHeaderLabels(labels.toQList()); formatsTable.horizontalHeader().setStretchLastSection(true); clearButton = new QPushButton(tr("Clear")); @@ -86,8 +86,8 @@ buttonBox.addButton(clearButton, QDialogButtonBox.ActionRole); buttonBox.addButton(quitButton, QDialogButtonBox.RejectRole); - connect!("pressed")(quitButton, &close); - connect!("pressed")(clearButton, &dropArea.clearArea); + connect(quitButton, "pressed", this, "close"); + connect(clearButton, "pressed", dropArea, "clearArea"); QVBoxLayout mainLayout = new QVBoxLayout; mainLayout.addWidget(abstractLabel); @@ -100,7 +100,7 @@ setMinimumSize(350, 500); } - void updateFormatsTable(QMimeData mimeData) + void slot_updateFormatsTable(QMimeData mimeData) { formatsTable.setRowCount(0); if (!mimeData) @@ -117,7 +117,7 @@ } else if (format == "text/html") { text = strip(mimeData.html()); } else if (format == "text/uri-list") { - QUrl[] urlList = mimeData.urls(); + auto urlList = mimeData.urls(); for (int i = 0; i < urlList.length && i < 32; ++i) { string url = urlList[i].path(); text ~= url ~ " "; @@ -148,4 +148,6 @@ QPushButton clearButton; QPushButton quitButton; QDialogButtonBox buttonBox; + + mixin Q_OBJECT; }