Re: [Interest] Qt and bash scripts

2012-07-01 Thread Phil
On 02/07/12 14:41, Mandeep Sandhu wrote: > > As Thiago mentioned, why aren't you using QDir/QFileInfo for this > requirement? You don't need to run 'ls' to get a dir's contents. Or > did you use ls just to illustrate your problem? Yes, it's just an example. > Also, in your sample code, you're cal

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Mandeep Sandhu
On Mon, Jul 2, 2012 at 7:08 AM, Phil wrote: > On 01/07/12 22:27, Thiago Macieira wrote: >> On domingo, 1 de julho de 2012 22.12.50, Phil wrote: >>> { >>> QProcess myProcess; >>> QString str; >>> >>> myProcess.start( "ls" ); >>> >>> if (!myProcess.waitForFinished()) >>>

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Phil
On 01/07/12 22:27, Thiago Macieira wrote: > On domingo, 1 de julho de 2012 22.12.50, Phil wrote: >> { >> QProcess myProcess; >> QString str; >> >> myProcess.start( "ls" ); >> >> if (!myProcess.waitForFinished()) >>qDebug()<< "Make failed:"<< myProcess.errorStri

Re: [Interest] how to create 2-D array of object whose constructor contains parameters in C++

2012-07-01 Thread 程梁
You could do this like: 1. class clazz { public: int num; }; clazz arr[3] = { clazz(1), clazz(2) }; OR 2. support default constructor with default parameters values or setters. You could not dynamic create arrays with new using the first way. That all I new. Hope this could help you. 201

Re: [Interest] How to make a column of a QTableView read-only?

2012-07-01 Thread K. Frank
Hi Sean! Thank you for the suggestion. On Sun, Jul 1, 2012 at 3:11 PM, Sean Harmer wrote: > Hi K. Frank, > > On 01/07/2012 19:50, K. Frank wrote: >> Hello List! >> >> I have a QTableView (backed by a QSqlTableModel) and am looking >> for a simple way to make a column read-only. Poking around in

Re: [Interest] How to make a column of a QTableView read-only?

2012-07-01 Thread Sean Harmer
Hi K. Frank, On 01/07/2012 19:50, K. Frank wrote: > Hello List! > > I have a QTableView (backed by a QSqlTableModel) and am looking > for a simple way to make a column read-only. Poking around in the > documentation, I don't see anything obviously simple. Take a look at the function QAbstractIte

[Interest] How to make a column of a QTableView read-only?

2012-07-01 Thread K. Frank
Hello List! I have a QTableView (backed by a QSqlTableModel) and am looking for a simple way to make a column read-only. Poking around in the documentation, I don't see anything obviously simple. I see two approaches: Attach a delegate to the column that provides a null or no-op editor. Drill

Re: [Interest] how to create 2-D array of object whose constructor contains parameters in C++

2012-07-01 Thread K. Frank
Hello Vincent! On Sun, Jul 1, 2012 at 10:31 AM, Vincent Cai wrote: > Hi, > > I am sorry to post C++ question here. To the extent that you are asking a pure C++ question (i.e., no Qt (or other third-party framework) classes), you'll probably get better answers if you ask on a C++ forum.

[Interest] how to create 2-D array of object whose constructor contains parameters in C++

2012-07-01 Thread Vincent Cai
Hi, I am sorry to post C++ question here. Hope somebody can help, thanks so much. Vincent. This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Thiago Macieira
On domingo, 1 de julho de 2012 22.12.50, Phil wrote: > { > QProcess myProcess; > QString str; > > myProcess.start( "ls" ); > > if (!myProcess.waitForFinished()) > qDebug() << "Make failed:" << myProcess.errorString(); > else > { > qDebug() << "Make

Re: [Interest] Qt and bash scripts

2012-07-01 Thread R. Reucher
On Sunday 01 July 2012 14:12:50 Phil wrote: > On 01/07/12 21:38, Thiago Macieira wrote: > >> I had also tried start() but the output still goes to the console. Is it > >> possible to have the directory list inserted into a string or string > >> list? > > > > Please show us the code you used when y

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Phil
On 01/07/12 21:38, Thiago Macieira wrote: >> >> I had also tried start() but the output still goes to the console. Is it >> possible to have the directory list inserted into a string or string list? > > Please show us the code you used when you used start(). { QProcess myProcess; QString

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Thiago Macieira
On domingo, 1 de julho de 2012 21.33.07, Phil wrote: > On 01/07/12 21:10, Thiago Macieira wrote: > > On domingo, 1 de julho de 2012 19.10.51, Phil wrote: > >> myProcess.startDetached("ls"); > > > > You started detached. You don't get the output of a detached execution. > > You > > need to use

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Phil
On 01/07/12 21:10, Thiago Macieira wrote: > On domingo, 1 de julho de 2012 19.10.51, Phil wrote: >> myProcess.startDetached("ls"); > > You started detached. You don't get the output of a detached execution. You > need to use start() to communicate with a process. > Thanks Thiago for your rep

[Interest] QtScript Error Objects

2012-07-01 Thread Prashant
Hi forum, Making applications scriptable document describes in last the last section about Error object. It says: " Error.prototype.backtrace This function returns a human-readable backtrace, in the form of an array of strings. Error objects have the following additional properties: lineNumber: The

Re: [Interest] Qt and bash scripts

2012-07-01 Thread Thiago Macieira
On domingo, 1 de julho de 2012 19.10.51, Phil wrote: > myProcess.startDetached("ls"); You started detached. You don't get the output of a detached execution. You need to use start() to communicate with a process. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel

[Interest] Qt and bash scripts

2012-07-01 Thread Phil
Thank you for reading this. The following is an example of what I'm attempting. I'd like a string or a string list to contain the output from ls. Array, in my example, is always empty. QProcess myProcess; myProcess.startDetached("ls"); QByteArray array = myProcess.readAllStanda