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
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.Originally Posted by Everall
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.
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.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.
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.Originally Posted by Everall
Thanks anyway.
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?
Last edited by wysota; 5th February 2006 at 14:58.
Even the other coding tools I've used also use search and replace!Originally Posted by wysota
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:
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.Qt Code:
... ui.leSSSN->setText(persRec.value(9).toString()); ui.lePart->setText(persRec.value(10).toString()); ...To copy to clipboard, switch view to plain text mode
Neither are arrays or array functions.
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.
CheersQList<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:
Warning: This function is not available with MSVC 6. Use qFindChildren() instead if you need to support that version of the compiler.Qt Code:
QList<QWidget *> widgets = parentWidget.findChildren<QWidget *>("widgetname"); This example returns all QPushButtons that are children of parentWidget: QList<QPushButton *> allPButtons = parentWidget.findChildren<QPushButton *>();To copy to clipboard, switch view to plain text mode
See also findChild() and qFindChildren().
Keep an array of pointers to QLineEdits and then:
Qt Code:
for(int i=0;i<10;i++){ }To copy to clipboard, switch view to plain text mode
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.Originally Posted by wysota
![]()
I'll give you one guess as to which compiler I am using...Originally Posted by Everall
![]()
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.Originally Posted by Everall
![]()
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
Last edited by Everall; 6th February 2006 at 08:27.
Bookmarks