Saturday, July 5th 2008, 2:21pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, March 26th 2008, 12:34pm

`uint' does not name a type???????

was ok!!!!
there is
#ifndef TABLEUI_H
... now i post te code:
-------------------
main.cpp:
--------------------
#include <qapplication.h>
#include "table.h"

int main(int argc, char **argv)
{
QApplication app(argc, argv);
table *pr= new table();
pr->show();

return app.exec();
}

-----------------
table.h
------------------
#include "tableUI.h"



class mytable : public QWidget , protected Ui::table
{
Q_OBJECT

protected:

mytable* obj;

public:
mytable(QObject *parent = 0)
{
this->obj = NULL;
setupUi(this);

connect(w_Btn_Add, SIGNAL(clicked()), this, SLOT(on_Btn_Add()));
connect(w_Btn_Canc, SIGNAL(clicked()), this, SLOT(on_Btn_Canc()));
}

~mytable(){}
private slots:
void on_Btn_Add(){}
void on_Btn_Canc(){}

}

-------------------------
table.cpp
-----------------------


#include "table.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'table.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 59
#error "This file was generated using the moc from 4.3.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

static const uint qt_meta_data_mytable[] = {

// content:
1, // revision
0, // classname
0, 0, // classinfo
2, 10, // methods
0, 0, // properties
0, 0, // enums/sets

// slots: signature, parameters, type, tag, flags
9, 8, 8, 8, 0x08,
22, 8, 8, 8, 0x08,

0 // eod
};

static const char qt_meta_stringdata_mytable[] = {
"mytable\0\0on_Btn_Add()\0on_Btn_Canc()\0"
};

const QMetaObject mytable::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_mytable,
qt_meta_data_mytable, 0 }
};

const QMetaObject *mytable::metaObject() const
{
return &staticMetaObject;
}

void *mytable::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_mytable))
return static_cast<void*>(const_cast< mytable*>(this));
if (!strcmp(_clname, "Ui::table"))
return static_cast< Ui::table*>(const_cast< mytable*>(this));
return QWidget::qt_metacast(_clname);
}

int mytable::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: on_Btn_Add(); break;
case 1: on_Btn_Canc(); break;
}
_id -= 2;
}
return _id;
}

----------------
tableUI.h
------------------

#ifndef TABLEUI_H
#define TABLEUI_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QGridLayout>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QTableWidget>
#include <QtGui/QWidget>

class Ui_table
{
public:
QTableWidget *tableWidget;
QWidget *layoutWidget;
QGridLayout *gridLayout;
QPushButton *w_Btn_Add;
QSpacerItem *spacerItem;
QPushButton *w_Btn_Canc;

void setupUi(QWidget *table)
{
if (table->objectName().isEmpty())
table->setObjectName(QString::fromUtf8("table"));
table->resize(531, 278);
tableWidget = new QTableWidget(table);
tableWidget->setObjectName(QString::fromUtf8("tableWidget"));
tableWidget->setGeometry(QRect(0, 0, 521, 231));
layoutWidget = new QWidget(table);
layoutWidget->setObjectName(QString::fromUtf8("layoutWidget"));
layoutWidget->setGeometry(QRect(0, 240, 525, 25));
gridLayout = new QGridLayout(layoutWidget);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setContentsMargins(0, 0, 0, 0);
w_Btn_Add = new QPushButton(layoutWidget);
w_Btn_Add->setObjectName(QString::fromUtf8("w_Btn_Add"));

gridLayout->addWidget(w_Btn_Add, 0, 0, 1, 1);

spacerItem = new QSpacerItem(361, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

gridLayout->addItem(spacerItem, 0, 1, 1, 1);

w_Btn_Canc = new QPushButton(layoutWidget);
w_Btn_Canc->setObjectName(QString::fromUtf8("w_Btn_Canc"));

gridLayout->addWidget(w_Btn_Canc, 0, 2, 1, 1);


retranslateUi(table);

QMetaObject::connectSlotsByName(table);
} // setupUi

void retranslateUi(QWidget *table)
{
table->setWindowTitle(QApplication::translate("table", "Form", 0, QApplication::UnicodeUTF8));
if (tableWidget->columnCount() < 5)
tableWidget->setColumnCount(5);

QTableWidgetItem *__colItem = new QTableWidgetItem();
__colItem->setText(QApplication::translate("table", "ID", 0, QApplication::UnicodeUTF8));
tableWidget->setHorizontalHeaderItem(0, __colItem);

QTableWidgetItem *__colItem1 = new QTableWidgetItem();
__colItem1->setText(QApplication::translate("table", "X", 0, QApplication::UnicodeUTF8));
tableWidget->setHorizontalHeaderItem(1, __colItem1);

QTableWidgetItem *__colItem2 = new QTableWidgetItem();
__colItem2->setText(QApplication::translate("table", "Y", 0, QApplication::UnicodeUTF8));
tableWidget->setHorizontalHeaderItem(2, __colItem2);

QTableWidgetItem *__colItem3 = new QTableWidgetItem();
__colItem3->setText(QApplication::translate("table", "PWR", 0, QApplication::UnicodeUTF8));
tableWidget->setHorizontalHeaderItem(3, __colItem3);

QTableWidgetItem *__colItem4 = new QTableWidgetItem();
__colItem4->setText(QApplication::translate("table", "CH", 0, QApplication::UnicodeUTF8));
tableWidget->setHorizontalHeaderItem(4, __colItem4);
if (tableWidget->rowCount() < 1)
tableWidget->setRowCount(1);

QTableWidgetItem *__rowItem = new QTableWidgetItem();
__rowItem->setText(QApplication::translate("table", "0", 0, QApplication::UnicodeUTF8));
tableWidget->setVerticalHeaderItem(0, __rowItem);

bool __sortingEnabled = tableWidget->isSortingEnabled();
tableWidget->setSortingEnabled(false);

QTableWidgetItem *__item = new QTableWidgetItem();
__item->setText(QApplication::translate("table", "0", 0, QApplication::UnicodeUTF8));
tableWidget->setItem(0, 0, __item);

QTableWidgetItem *__item1 = new QTableWidgetItem();
__item1->setText(QApplication::translate("table", "0.0", 0, QApplication::UnicodeUTF8));
tableWidget->setItem(0, 1, __item1);

QTableWidgetItem *__item2 = new QTableWidgetItem();
__item2->setText(QApplication::translate("table", "0.0", 0, QApplication::UnicodeUTF8));
tableWidget->setItem(0, 2, __item2);

QTableWidgetItem *__item3 = new QTableWidgetItem();
__item3->setText(QApplication::translate("table", "0.0", 0, QApplication::UnicodeUTF8));
tableWidget->setItem(0, 3, __item3);

QTableWidgetItem *__item4 = new QTableWidgetItem();
__item4->setText(QApplication::translate("table", "0", 0, QApplication::UnicodeUTF8));
tableWidget->setItem(0, 4, __item4);

tableWidget->setSortingEnabled(__sortingEnabled);

w_Btn_Add->setText(QApplication::translate("table", "Add", 0, QApplication::UnicodeUTF8));
w_Btn_Canc->setText(QApplication::translate("table", "Cancel", 0, QApplication::UnicodeUTF8));
Q_UNUSED(table);
} // retranslateUi

};

namespace Ui {
class table: public Ui_table {};
} // namespace Ui

#endif // TABLEUI_H




the error is in table.cpp....
at the line:
static const uint qt_meta_data_mytable[]

the error is: `uint' does not name a type

byebye
  • Go to the top of the page

kunalnandi

Beginner

Posts: 18

Location: India

Occupation: Programmer

2

Wednesday, April 30th 2008, 11:27am

RE: `uint' does not name a type???????

Hello,

insted of using "uint" use
->> qint, qint16, qint32 etc..

aslo u can use
->> quint, quint16, quint32 etc..

hope this will help u... :)
Regards
Kunal Nandi
  • Go to the top of the page

3

Wednesday, April 30th 2008, 8:24pm

RE: `uint' does not name a type???????

uint is not a cpp type..
1. use typedef
2. use unsigned int

either way it will work :)
  • Go to the top of the page

Rate this thread