Re: a box around QLineEdit?
You can always enable Qt3 support and use QLineEdit (Qt3), ref: trolltech documentation
Re: a box around QLineEdit?
With QT4 .1 you can set the following in designer :
QTextEdit
frameShape to QFrame::Box
frameSchadow to QFrame::Plain
this gives just a line around the QTextEdit.
If this is not what you want, can you give us a picture of what you want.
Cheers
Re: a box around QLineEdit?
Quote:
Originally Posted by Everall
With QT4 .1 you can set the following in designer :
QTextEdit
frameShape to QFrame::Box
frameSchadow to QFrame::Plain
this gives just a line around the QTextEdit.
If this is not what you want, can you give us a picture of what you want.
Cheers
Visually it is exactly what I want.
Functionally, it's a quantum leap apart from the functionality of QLineEdit. Too many differences I'd have to configure around to be practical.:(
Thanks anyway.
Re: a box around QLineEdit?
Hello GreyGeek,
Quote:
Visually it is exactly what I want.
Functionally, it's a quantum leap apart from the functionality of QLineEdit. Too many differences I'd have to configure around to be practical.
Thanks anyway.
Here is a quick workaround that looks like what you want and has the functionality too. It can be done without code, just using QT designer.
put a QFrame on your dialog. Set its properties :
frameShape to QFrame::Box
frameSchadow to QFrame::Plain
margin and spacing to 0
put a QLineEdit in it and apply a grid layout on it.
Hope this helps
Re: a box around QLineEdit?
Quote:
Originally Posted by Everall
Hello GreyGeek,
Here is a quick workaround that looks like what you want and has the functionality too. It can be done without code, just using QT designer.
put a QFrame on your dialog. Set its properties :
frameShape to QFrame::Box
frameSchadow to QFrame::Plain
margin and spacing to 0
put a QLineEdit in it and apply a grid layout on it.
Hope this helps
I considered that but for over 50 QLineEdit boxes it would be impractical. Also, user demands require a textbox density so high that such a frame would not allow my app to fit in our standard 800X600 workstation desktop.
Thanks anyway.
Re: a box around QLineEdit?
Have you heard of "find & replace" paradigm? ;) Make a wrapper of functionality you desire and then wrap all occurences of QLineEdit into it. And BTW. What would need to be "configured" that makes you think it is not worth the effort?
Re: a box around QLineEdit?
Quote:
Originally Posted by Everall
Hello GreyGeek,
Here is a quick workaround that looks like what you want and has the functionality too. It can be done without code, just using QT designer.
put a QFrame on your dialog. Set its properties :
frameShape to QFrame::Box
frameSchadow to QFrame::Plain
margin and spacing to 0
put a QLineEdit in it and apply a grid layout on it.
Hope this helps
Interestingly, I had ported the GUI to Linux and this weekend I opened up the GUI in the Qt-4 designer and to my suprise noticed that there is a "frame" property in the QLineEdit widget when it displays in Linux, but not when it displays in Windows. By setting the frame to "true" a line appears around the QLineEdit widget. Same ui file, so I guess the Designer is slightly different for each platform.:confused:
Re: a box around QLineEdit?
I think the chosen window style makes it like that.
When I use form preview plastique style, it looks like what you want, other styles don't. They have the same "hole appearance".
Cheers
Re: a box around QLineEdit?
Quote:
Originally Posted by wysota
Have you heard of "find & replace" paradigm? ;) Make a wrapper of functionality you desire and then wrap all occurences of QLineEdit into it. And BTW. What would need to be "configured" that makes you think it is not worth the effort?
Even the other coding tools I've used also use search and replace! ;)
But, Search in what and replace what?
Here is a small part of the function which updates part of a column of QLineEdit widgets in homestead.cpp:
Code:
...
ui.leSSSN->setText(persRec.value(9).toString());
ui.lePart->setText(persRec.value(10).toString());
ui.
leTotalIncome->setText
(QString::number(persRec.
value(11).
toDouble(),
'f',
2));
ui.
leP2Line1->setText
(QString::number(persRec.
value(12).
toDouble(),
'f',
2));
ui.
leP2Line2->setText
(QString::number(persRec.
value(13).
toDouble(),
'f',
2));
ui.
leP2Line3->setText
(QString::number(persRec.
value(14).
toDouble(),
'f',
2));
ui.
leP2Line4->setText
(QString::number(persRec.
value(15).
toDouble(),
'f',
2));
ui.
leP2Line5->setText
(QString::number(persRec.
value(16).
toDouble(),
'f',
2));
ui.
leP2Line6->setText
(QString::number(persRec.
value(17).
toDouble(),
'f',
2));
ui.
leP2Line7a->setText
(QString::number(persRec.
value(18).
toDouble(),
'f',
2));
...
We're talking a tax form with several subforms so you have an idea of how many QLineEdit widgets there are on that form, each with it's own identifying name. Global S&R games aren't practical here.
Neither are arrays or array functions.
Re: a box around QLineEdit?
You could get all the widgets of your dialog, test them being QLineEdits and then change their properties.
Have a look at findChildren. There is an example that takes all the QPushButtons.
Quote:
QList<T> QObject::findChildren ( const QString & name = QString() ) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. An empty string matches all object names. The search is performed recursively.
The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:
Code:
QList<QWidget *> widgets = parentWidget.findChildren<QWidget *>("widgetname");
This example returns all QPushButtons that are children of parentWidget:
QList<QPushButton *> allPButtons = parentWidget.findChildren<QPushButton *>();
Warning: This function is not available with MSVC 6. Use qFindChildren() instead if you need to support that version of the compiler.
See also findChild() and qFindChildren().
Cheers
Re: a box around QLineEdit?
Keep an array of pointers to QLineEdits and then:
Code:
for(int i=0;i<10;i++){
lineedits
[i
]>setText
(QString::number(persRec.
value(i
+11).
toDouble(),
'f',
2));
}
Anyway, what is the frame property having to do with this?
Re: a box around QLineEdit?
Quote:
Originally Posted by Everall
...
Warning: This function is not available with MSVC 6. Use qFindChildren() instead if you need to support that version of the compiler.
.....
Cheers
I'll give you one guess as to which compiler I am using...;)
Re: a box around QLineEdit?
Quote:
Originally Posted by wysota
...
Anyway, what is the frame property having to do with this?
Nothing, except for the fact that this msg trail evolved from your suggestion to use a wrapper.:)