Changeset 209 for tests/process/process/process.cpp
- Timestamp:
- Oct 6, 2009, 6:13:43 PM (16 years ago)
- Location:
- tests/process/process
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/process/process
- Property svn:ignore
-
old new 1 1 Makefile 2 2 Makefile.* 3 vc*.pdb
-
- Property svn:ignore
-
tests/process/process/process.cpp
r205 r209 21 21 public: 22 22 23 MyWidget(QWidget *aParent) : QWidget(aParent) 23 MyWidget(QWidget *aParent) 24 : QWidget(aParent), mOtherProcess(0), mRedirectedToOtherProcess(false) 24 25 { 25 26 // children … … 74 75 } 75 76 77 QProcess *process() const { return mProcess; } 78 void setOtherProcess(QProcess *aOtherProcess) { mOtherProcess = aOtherProcess; } 79 76 80 private slots: 77 81 … … 200 204 return; 201 205 } 206 207 if (!mRedirectedToOtherProcess) 208 { 209 mRedirectedToOtherProcess = true; 210 mProcess->setStandardOutputProcess(mOtherProcess); 211 mEditor->append(tr("> Redirected standard output to standard " 212 "input of another process")); 213 } 214 else 215 { 216 mRedirectedToOtherProcess = false; 217 mProcess->setStandardErrorFile(QString::null); 218 mEditor->append(tr("> Canceled redirection of standard output")); 219 } 202 220 } 203 221 else … … 266 284 267 285 QProcess *mProcess; 286 QProcess *mOtherProcess; 287 bool mRedirectedToOtherProcess; 288 268 289 QTextEdit *mEditor; 269 290 QLineEdit *mLineEdit; … … 284 305 285 306 QTabWidget *tabs = new QTabWidget(); 286 tabs->addTab(new MyWidget(tabs), QLatin1String("Process 1")); 287 tabs->addTab(new MyWidget(tabs), QLatin1String("Process 2")); 307 308 mWidget1 = new MyWidget(tabs); 309 mWidget2 = new MyWidget(tabs); 310 311 mWidget1->setOtherProcess(mWidget2->process()); 312 mWidget2->setOtherProcess(mWidget1->process()); 313 314 tabs->addTab(mWidget1, QLatin1String("Process 1")); 315 tabs->addTab(mWidget2, QLatin1String("Process 2")); 288 316 289 317 // connections … … 302 330 // other 303 331 } 332 333 private: 334 335 MyWidget *mWidget1; 336 MyWidget *mWidget2; 304 337 }; 305 338
Note:
See TracChangeset
for help on using the changeset viewer.