Yeah.
I write some codes.But it didn't work.
Can you give me some tips?
How can I make it right.
Please tell me how.
/*************************************************************************
*
* Copyright (c) 2008-2011, Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* See the LICENSE.txt file shipped along with this file for the license.
*
*************************************************************************/
#include <QtGui>
int main(int argc, char *argv[])
{
QWidget window;
// our top-level window
//widget layout
inner->addWidget(itemLabel);
inner->addWidget(lineEdit);
inner->addWidget(addPushButton);
outer->addWidget(inner);
outer->addWidget(itemlistLabel);
outer->addWidget(textEdit);
window.setLayout(outer);
// ... your code here
window.resize(480, 640);
window.show();
return app.exec();
}
/*************************************************************************
*
* Copyright (c) 2008-2011, Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* See the LICENSE.txt file shipped along with this file for the license.
*
*************************************************************************/
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget window; // our top-level window
QLabel *itemLabel=new QLabel("Item",window);
QLineEdit *lineEdit=new QLineEdit(window);
QLabel *itemlistLabel=new QLabel("Item",window);
QPushButton *addPushButton=new QPushButton("Add",window);
QTextEdit *textEdit=new QTextEdit(window);
//widget layout
QHBoxLayout *inner=new QHBoxLayout();
inner->addWidget(itemLabel);
inner->addWidget(lineEdit);
inner->addWidget(addPushButton);
QVBoxLayout *outer=new QVBoxLayout();
outer->addWidget(inner);
outer->addWidget(itemlistLabel);
outer->addWidget(textEdit);
window.setLayout(outer);
// ... your code here
window.resize(480, 640);
window.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Added after 18 minutes:
Yeah!I have done it using QtDesigner!
But how can I achieve this without QtDesigner?
Can you tell me how?
I am confused.
Bookmarks