PDA

View Full Version : am New to qt, Help ME please...



sjaideep93
21st July 2011, 09:30
stack . cpp

#include "stack.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
int i=0;
StackTest::StackTest(QWidget *parent):QWidget(parent)
{
QHBoxLayout *HLayout = new QHBoxLayout;
QVBoxLayout *VLayout = new QVBoxLayout;
newStack = new QPushButton;
prevStack = new QPushButton;
nextStack = new QPushButton;
addresText = new QLineEdit;
stackWidget = new QStackedWidget;
HLayout->addWidget(addresText);
HLayout->addWidget(prevStack);
HLayout->addWidget(nextStack;
HLayout->addWidget(newStack);
VLayout->addLayout(HLayout);
VLayout->addWidget(stackWidget);
setLayout(VLayout);
connect(newStack,SIGNAL(clicked()),this,SLOT(on_ne wStack_cliked()));
}
void StackTest:: on_newStack_cliked()
{
view[i]=new QWebView;
stackWidget->addWidget(view[i]);
view[i]->load(QUrl("http://google.com"));
i += 1;
}

here i attached the file
6696

showing err:
error: expected ')' before ';' token

Added after 7 minutes:

Help Me Please

mvuori
21st July 2011, 10:11
Help yourself get help!
* Many people don't even open messages that do not have a descriptive title. Asking for help is not such -- most new threads request help. A more detailed title would be: "Compiling error: expected ')' before ';' token"
* I'm sure the compiler told you more than "error: expected ')' before ';' token". All compiler tell the row where the error is.
* When the compiler suggests that a ')' is missing, I'm sure you tried adding one (of course you did), but you don't tell what happened.
* You should start the message with a clear description of the problem. Now a reader just sees a code listing and many will go back immediately.

stampede
21st July 2011, 10:18
I agree with mvuori, I'm sure compiler told you what line is causing the error, so it should be enough to solve it yourself. If you could not fix it, at least post which line caused the error.

deepakn
21st July 2011, 10:48
HLayout->addWidget(nextStack); solves it for the time being.
Agree with mvuori and stampede. Hope you will get used to the ways of seeking help in here. :)

sjaideep93
21st July 2011, 11:04
sorry for waisting your time...
extremely sorry...

and thank you all too.

ChrisW67
22nd July 2011, 01:29
You weren't wasting our time, just yours. Creating that post and attachment would have taken you far longer than reading the error message, looking at the line involved, and the lines preceding it, and adding the missing ')' that the error explicitly tells you is missing.