comparison examples/mainwindows/dockwidgets/mainwindow.d @ 282:256ab6cb8e85

Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
author eldar
date Fri, 16 Oct 2009 02:43:59 +0000
parents 8aaa84d48451
children 7a3c43424dca
comparison
equal deleted inserted replaced
281:7f2e3ffa1c33 282:256ab6cb8e85
212 void createActions() 212 void createActions()
213 { 213 {
214 newLetterAct = new QAction(new QIcon(":images/new.png"), tr("&New Letter"), this); 214 newLetterAct = new QAction(new QIcon(":images/new.png"), tr("&New Letter"), this);
215 newLetterAct.setShortcut(tr("Ctrl+N")); 215 newLetterAct.setShortcut(tr("Ctrl+N"));
216 newLetterAct.setStatusTip(tr("Create a new form letter")); 216 newLetterAct.setStatusTip(tr("Create a new form letter"));
217 newLetterAct.triggered.connect(&this.newLetter); 217 connect!("triggered")(newLetterAct, &this.newLetter);
218 218
219 saveAct = new QAction(new QIcon(":images/save.png"), tr("&Save..."), this); 219 saveAct = new QAction(new QIcon(":images/save.png"), tr("&Save..."), this);
220 saveAct.setShortcut(tr("Ctrl+S")); 220 saveAct.setShortcut(tr("Ctrl+S"));
221 saveAct.setStatusTip(tr("Save the current form letter")); 221 saveAct.setStatusTip(tr("Save the current form letter"));
222 // saveAct.triggered.connect(&save); 222 // saveAct.triggered.connect(&save);
227 // printAct.triggered.connect(&print); 227 // printAct.triggered.connect(&print);
228 228
229 undoAct = new QAction(new QIcon(":images/undo.png"), tr("&Undo"), this); 229 undoAct = new QAction(new QIcon(":images/undo.png"), tr("&Undo"), this);
230 undoAct.setShortcut(tr("Ctrl+Z")); 230 undoAct.setShortcut(tr("Ctrl+Z"));
231 undoAct.setStatusTip(tr("Undo the last editing action")); 231 undoAct.setStatusTip(tr("Undo the last editing action"));
232 undoAct.triggered.connect(&undo); 232 connect!("triggered")(undoAct, &undo);
233 233
234 quitAct = new QAction(tr("&Quit"), this); 234 quitAct = new QAction(tr("&Quit"), this);
235 quitAct.setShortcut(tr("Ctrl+Q")); 235 quitAct.setShortcut(tr("Ctrl+Q"));
236 quitAct.setStatusTip(tr("Quit the application")); 236 quitAct.setStatusTip(tr("Quit the application"));
237 quitAct.triggered.connect(&this.close); 237 connect!("triggered")(quitAct, &this.close);
238 238
239 aboutAct = new QAction(tr("&About"), this); 239 aboutAct = new QAction(tr("&About"), this);
240 aboutAct.setStatusTip(tr("Show the application's About box")); 240 aboutAct.setStatusTip(tr("Show the application's About box"));
241 aboutAct.triggered.connect(&about); 241 connect!("triggered")(aboutAct, &about);
242 242
243 aboutQtAct = new QAction(tr("About &Qt"), this); 243 aboutQtAct = new QAction(tr("About &Qt"), this);
244 aboutQtAct.setStatusTip(tr("Show the Qt library's About box")); 244 aboutQtAct.setStatusTip(tr("Show the Qt library's About box"));
245 // aboutQtAct.triggered(&aboutQt); 245 // aboutQtAct.triggered(&aboutQt);
246 } 246 }
325 "buy more items, or should we return the excess to you?"]); 325 "buy more items, or should we return the excess to you?"]);
326 dock.setWidget(paragraphsList); 326 dock.setWidget(paragraphsList);
327 addDockWidget(Qt.RightDockWidgetArea, dock); 327 addDockWidget(Qt.RightDockWidgetArea, dock);
328 viewMenu.addAction(dock.toggleViewAction()); 328 viewMenu.addAction(dock.toggleViewAction());
329 329
330 customerList.currentTextChanged.connect(&this.insertCustomer); 330 connect!("currentTextChanged")(customerList, &this.insertCustomer);
331 paragraphsList.currentTextChanged.connect(&this.addParagraph); 331 connect!("currentTextChanged")(paragraphsList, &this.addParagraph);
332 } 332 }
333 333
334 QTextEdit textEdit; 334 QTextEdit textEdit;
335 QListWidget customerList; 335 QListWidget customerList;
336 QListWidget paragraphsList; 336 QListWidget paragraphsList;