• 7981阅读
  • 2回复

版主,麻烦你帮我瞧瞧 [复制链接]

上一主题 下一主题
离线weilong122
 

只看楼主 倒序阅读 楼主  发表于: 2006-04-21
#include"gotocelldialog.h"

GoToCellDialog::GoToCellDialog(QWidget* parent):QDialog(parent)
{
  //this->setObjectName(QString::fromUtf8("this"));
  this->resize(QSize(335, 78).expandedTo(this->minimumSizeHint()));
  gridLayout = new QGridLayout(this);
  gridLayout->setSpacing(6);
  gridLayout->setMargin(9);
  // gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
  hboxLayout = new QHBoxLayout();
  hboxLayout->setSpacing(6);
  hboxLayout->setMargin(0);
  //hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
  label = new QLabel(tr("&Cell Location:"),this);
  //label->setObjectName(QString::fromUtf8("label"));

  hboxLayout->addWidget(label);

  lineEdit = new QLineEdit(this);
  //lineEdit->setObjectName(QString::fromUtf8("lineEdit"));

  hboxLayout->addWidget(lineEdit);


  gridLayout->addLayout(hboxLayout, 0, 0, 1, 1);

  hboxLayout1 = new QHBoxLayout();
  hboxLayout1->setSpacing(6);
  hboxLayout1->setMargin(0);
  //hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
  spacerItem = new QSpacerItem(121, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

  hboxLayout1->addItem(spacerItem);

  okButton = new QPushButton(tr("OK"),this);
  //okButton->setObjectName(QString::fromUtf8("okButton"));
  okButton->setEnabled(false);
  okButton->setDefault(true);

  hboxLayout1->addWidget(okButton);

  cancelButton = new QPushButton(tr("Cancel"),this);
  //cancelButton->setObjectName(QString::fromUtf8("cancelButton"));

  hboxLayout1->addWidget(cancelButton);


  gridLayout->addLayout(hboxLayout1, 1, 0, 1, 1);

  label->setBuddy(lineEdit);
  QWidget::setTabOrder(lineEdit, okButton);
  QWidget::setTabOrder(okButton, cancelButton);
  //retranslateUi(this);
  connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  connect(lineEdit ,SIGNAL(textChanged(const QString&)),this,SLOT(enableOkButton()));

  setWindowTitle(tr("GO TO CELL"));

}

void GoToCellDialog::enableOkButton()
{
  okButton ->setEnabled(lineEdit->hasAcceptableInput());
}

================================================

gotocelldialog.cpp:3: error: new types may not be defined in a return type
gotocelldialog.cpp:3: error: return type specification for constructor invalid
make[1]: *** [debug\gotocelldialog.o] Error 1
make[1]: Leaving directory `C:/Documents and Settings/chenxiaobo/桌面/gotocelldi
alog'
make: *** [debug] Error 2
离线XChinux

只看该作者 1楼 发表于: 2006-04-21
你的头文件里类定义完是不是没有加分号结束?
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线weilong122

只看该作者 2楼 发表于: 2006-04-21
还真是
郁闷
太不小心了
谢谢XChinux
快速回复
限100 字节
 
上一个 下一个