Mercurial > projects > qtd
comparison examples/desktop/systray/window.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 | 2c9ef955a171 |
children | 7a3c43424dca |
comparison
equal
deleted
inserted
replaced
281:7f2e3ffa1c33 | 282:256ab6cb8e85 |
---|---|
70 iconLabel.setMinimumWidth(durationLabel.sizeHint().width()); | 70 iconLabel.setMinimumWidth(durationLabel.sizeHint().width()); |
71 | 71 |
72 createActions(); | 72 createActions(); |
73 createTrayIcon(); | 73 createTrayIcon(); |
74 | 74 |
75 showMessageButton.clicked.connect(&this.showMessage); | 75 connect!("clicked")(showMessageButton, &this.showMessage); |
76 showIconCheckBox.toggled.connect(&trayIcon.setVisible); | 76 connect!("toggled")(showIconCheckBox, &trayIcon.setVisible); |
77 iconComboBox.currentIndexChanged.connect(&this.setIcon); | 77 connect!("currentIndexChanged")(iconComboBox, &this.setIcon); |
78 trayIcon.messageClicked.connect(&this.messageClicked); | 78 connect!("messageClicked")(trayIcon, &this.messageClicked); |
79 trayIcon.activated.connect(&this.iconActivated); | 79 connect!("activated")(trayIcon, &this.iconActivated); |
80 | 80 |
81 QVBoxLayout mainLayout = new QVBoxLayout; | 81 QVBoxLayout mainLayout = new QVBoxLayout; |
82 mainLayout.addWidget(iconGroupBox); | 82 mainLayout.addWidget(iconGroupBox); |
83 mainLayout.addWidget(messageGroupBox); | 83 mainLayout.addWidget(messageGroupBox); |
84 setLayout(mainLayout); | 84 setLayout(mainLayout); |
231 } | 231 } |
232 | 232 |
233 void createActions() | 233 void createActions() |
234 { | 234 { |
235 minimizeAction = new QAction(tr("Mi&nimize"), this); | 235 minimizeAction = new QAction(tr("Mi&nimize"), this); |
236 minimizeAction.triggered.connect(&this.hide); | 236 connect!("triggered")(minimizeAction, &this.hide); |
237 | 237 |
238 maximizeAction = new QAction(tr("Ma&ximize"), this); | 238 maximizeAction = new QAction(tr("Ma&ximize"), this); |
239 maximizeAction.triggered.connect(&this.showMaximized); | 239 connect!("triggered")(maximizeAction, &this.showMaximized); |
240 | 240 |
241 restoreAction = new QAction(tr("&Restore"), this); | 241 restoreAction = new QAction(tr("&Restore"), this); |
242 restoreAction.triggered.connect(&this.showNormal); | 242 connect!("triggered")(restoreAction, &this.showNormal); |
243 | 243 |
244 quitAction = new QAction(tr("&Quit"), this); | 244 quitAction = new QAction(tr("&Quit"), this); |
245 quitAction.triggered.connect(&QApplication.quit); | 245 connect!("triggered")(quitAction, &QApplication.quit); |
246 } | 246 } |
247 | 247 |
248 void createTrayIcon() | 248 void createTrayIcon() |
249 { | 249 { |
250 trayIconMenu = new QMenu(this); | 250 trayIconMenu = new QMenu(this); |