Mailinglist Archive: opensuse-programming (84 mails)
| < Previous | Next > |
Re: [suse-programming-e] QDataBrowser can not display bpchar(150)
- From: Prabu Subroto <prabu_subroto@xxxxxxxxx>
- Date: Thu, 5 Aug 2004 01:07:50 -0700 (PDT)
- Message-id: <20040805080750.85359.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Hi Brad...
I am so confused because the QLineEdit was defined by
the Qt Designer. I create the QDataBrowser from Qt
Designer and the QDataBrowser generate the QLineEdit
by themselves.
I try to define this line " QLineEditCompany =
custdataBrowser->field("custid").QString(); " in the
constructor ( init() ) but of course if I click the
button of "next"/"last"/"previos"/"first" than the
content of "company" field will not be displayed
anymore.
Please tell me your solution. Please....
Thank you very much.
====
void funonseqForm::init()
{
retrieve();
}
void funonseqForm::retrieve()
{
QSqlDatabase * bd =
QSqlDatabase::addDatabase("QPSQL7", "OTHER");
bd->setHostName("192.168.23.237");
bd->setDatabaseName("kv");
bd->setUserName("postgres");
bd->setPassword("");
if ( ! bd->open() )
{
bd->lastError().showMessage();
}
QSqlCursor * cursor = new
QSqlCursor("v_cust_sven", true, bd);
custdataBrowser->setSqlCursor(cursor, false);
QLineEditCompany =
custdataBrowser->field("custid").QString();
custdataBrowser->refresh();
}
--- Brad Bourn <brad@xxxxxxxxxxxx> wrote:
> been a while since I played with this stuff....
>
> I know there is a way to reference the var as a
> QString...
>
>
> where is the actual data stored?
>
> like where do you try to fill in the lineedit?
>
> databrowser->fieldname ?
>
> if so, should be something like
>
> linedit = databrowser->field("fieldname").QString()
>
>
> B-)
>
>
> If you give me the exact syntax where you set the
> lineedit var, I'll probably
> remember.
>
>
> On Wednesday 04 August 2004 11:49 am, you wrote:
> > Dear Brad...
> >
> > But how?
> >
> > here is my code:
> > ===
> > void funonseqForm::init()
> > {
> > retrieve();
> > }
> >
> > void funonseqForm::retrieve()
> > {
> > QSqlDatabase * bd =
> > QSqlDatabase::addDatabase("QPSQL7", "OTHER");
> > bd->setHostName("192.168.23.237");
> > bd->setDatabaseName("kv");
> > bd->setUserName("postgres");
> > bd->setPassword("");
> > if ( ! bd->open() )
> > {
> > bd->lastError().showMessage();
> > }
> >
> > QSqlCursor * cursor = new
> > QSqlCursor("v_cust_sven", true, bd);
> > custdataBrowser->setSqlCursor(cursor, false);
> > custdataBrowser->refresh();
> >
> > }
> > ===
> >
> > Thank you very much in advance
> >
> > --- Brad Bourn <brad@xxxxxxxxxxxx> wrote:
> > > You should be able to set it to
> > > QString
> > >
> > > B-)
> > >
> > > On Wednesday 04 August 2004 11:41 am, Prabu
> Subroto
> > >
> > > wrote:
> > > > Dear my friends...
> > > >
> > > > I am using postgres 7.2.x, Qt 3.2 and SuSE 9.1
> .
> > > >
> > > > I want to make the list of customer list with
> > > > "previous", "next", "first" and "last"
> buttons.
> > > >
> > > > Finally, I create this with QDataBrowser.
> > > > Actually it works...the four buttons work as I
> > > > expected. but what weird is that the QLineEdit
> of
> > > > Address can not display the value of the field
> > > > "address". I define this field with
> bpchar(150).
> > >
> > > Does
> > >
> > > > it has anything to do with the datatype?
> > > > Which data type should I use?
> > > >
> > > > Please tell me where my mistake is.
> > > >
> > > > Thank you very much.
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Y! Messenger - Communicate in real time.
> Download
> > >
> > > now.
> > >
> > > > http://messenger.yahoo.com
> > >
> > > --
> > > To unsubscribe, email:
> > > suse-programming-e-unsubscribe@xxxxxxxx
> > > For additional commands, email:
> > > suse-programming-e-help@xxxxxxxx
> > > Archives can be found at:
> > > http://lists.suse.com/archive/suse-programming-e
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
I am so confused because the QLineEdit was defined by
the Qt Designer. I create the QDataBrowser from Qt
Designer and the QDataBrowser generate the QLineEdit
by themselves.
I try to define this line " QLineEditCompany =
custdataBrowser->field("custid").QString(); " in the
constructor ( init() ) but of course if I click the
button of "next"/"last"/"previos"/"first" than the
content of "company" field will not be displayed
anymore.
Please tell me your solution. Please....
Thank you very much.
====
void funonseqForm::init()
{
retrieve();
}
void funonseqForm::retrieve()
{
QSqlDatabase * bd =
QSqlDatabase::addDatabase("QPSQL7", "OTHER");
bd->setHostName("192.168.23.237");
bd->setDatabaseName("kv");
bd->setUserName("postgres");
bd->setPassword("");
if ( ! bd->open() )
{
bd->lastError().showMessage();
}
QSqlCursor * cursor = new
QSqlCursor("v_cust_sven", true, bd);
custdataBrowser->setSqlCursor(cursor, false);
QLineEditCompany =
custdataBrowser->field("custid").QString();
custdataBrowser->refresh();
}
--- Brad Bourn <brad@xxxxxxxxxxxx> wrote:
> been a while since I played with this stuff....
>
> I know there is a way to reference the var as a
> QString...
>
>
> where is the actual data stored?
>
> like where do you try to fill in the lineedit?
>
> databrowser->fieldname ?
>
> if so, should be something like
>
> linedit = databrowser->field("fieldname").QString()
>
>
> B-)
>
>
> If you give me the exact syntax where you set the
> lineedit var, I'll probably
> remember.
>
>
> On Wednesday 04 August 2004 11:49 am, you wrote:
> > Dear Brad...
> >
> > But how?
> >
> > here is my code:
> > ===
> > void funonseqForm::init()
> > {
> > retrieve();
> > }
> >
> > void funonseqForm::retrieve()
> > {
> > QSqlDatabase * bd =
> > QSqlDatabase::addDatabase("QPSQL7", "OTHER");
> > bd->setHostName("192.168.23.237");
> > bd->setDatabaseName("kv");
> > bd->setUserName("postgres");
> > bd->setPassword("");
> > if ( ! bd->open() )
> > {
> > bd->lastError().showMessage();
> > }
> >
> > QSqlCursor * cursor = new
> > QSqlCursor("v_cust_sven", true, bd);
> > custdataBrowser->setSqlCursor(cursor, false);
> > custdataBrowser->refresh();
> >
> > }
> > ===
> >
> > Thank you very much in advance
> >
> > --- Brad Bourn <brad@xxxxxxxxxxxx> wrote:
> > > You should be able to set it to
> > > QString
> > >
> > > B-)
> > >
> > > On Wednesday 04 August 2004 11:41 am, Prabu
> Subroto
> > >
> > > wrote:
> > > > Dear my friends...
> > > >
> > > > I am using postgres 7.2.x, Qt 3.2 and SuSE 9.1
> .
> > > >
> > > > I want to make the list of customer list with
> > > > "previous", "next", "first" and "last"
> buttons.
> > > >
> > > > Finally, I create this with QDataBrowser.
> > > > Actually it works...the four buttons work as I
> > > > expected. but what weird is that the QLineEdit
> of
> > > > Address can not display the value of the field
> > > > "address". I define this field with
> bpchar(150).
> > >
> > > Does
> > >
> > > > it has anything to do with the datatype?
> > > > Which data type should I use?
> > > >
> > > > Please tell me where my mistake is.
> > > >
> > > > Thank you very much.
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Y! Messenger - Communicate in real time.
> Download
> > >
> > > now.
> > >
> > > > http://messenger.yahoo.com
> > >
> > > --
> > > To unsubscribe, email:
> > > suse-programming-e-unsubscribe@xxxxxxxx
> > > For additional commands, email:
> > > suse-programming-e-help@xxxxxxxx
> > > Archives can be found at:
> > > http://lists.suse.com/archive/suse-programming-e
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
| < Previous | Next > |