Wednesday, January 7th 2009, 9:53am UTC

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

Tuesday, July 1st 2008, 10:37am

excel

Hello

whats wrong ?

Then i write this line
QAxObject* excel = new QAxObject( "Excel.Application", 0 );



darbas6.obj : error LNK2019: unresolved external symbol "public: __thiscall QAxObject::QAxObject(class QString const &,class QObject *)" (??0QAxObject@@QAE@ABVQString@@PAVQObject@@@Z) referenced in function "private: void __thiscall Darbas6::createLetter(class QString const &,class QString const &,class QString const &,class QString const &,class QString const &,class QString const &,class QString const &)" (?createLetter@Darbas6@@AAEXABVQString@@000000@Z)
  • Go to the top of the page

SD_R3veNG

Beginner

Posts: 32

Location: Belgium

Occupation: student

2

Tuesday, July 1st 2008, 11:30pm

A bit more information and effort is welcome here ;-)

What did you allready try yourself? What Os/compiler? Which files (.h or .cpp) are involved etc.. ? most likely, this error is caused by a missing linker-option, but then again, with your given information, even God can't give you solution...

R3
*/ No comment /*
  • Go to the top of the page

3

Wednesday, July 2nd 2008, 11:41am

I am using qt 4.4.0 comercial and visual studio 2005
darbas6.h

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef DARBAS6_H
#define DARBAS6_H

#include <QMainWindow>
#include <QVector>

class QAction;
class QTabWidget;
class QTableWidget;
class QTableWidgetItem;

class Darbas6 : public QMainWindow
{
	Q_OBJECT

public:
	Darbas6();
	void Save();

public slots:
	void newDialog();
	void openFile();
	void saveFile();

private:
	void createLetter(const QString &number, const QString &name, const QString &weigh
		, const QString &price, const QString &pay, const QString &cent, const QString &give);

	QTableWidget *itemsTable[100];
	QTabWidget *letters;
	int lentele;
	int row;
	int eile;
	QStringList items;
	QTableWidgetItem *item;


};

#endif // DARBAS6_H


And darbas6.cpp

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#include <QtGui>
#include "darbas6.h"
#include "detailsdialog.h"
#include <qt/qaxobject.h>
Darbas6::Darbas6()
{


 	QMenu *fileMenu = new QMenu(tr("&File"), this);
 	QAction *newAction = fileMenu->addAction(tr("&New..."));
 	newAction->setShortcut(tr("Ctrl+N"));

 	QAction *openAction = fileMenu->addAction(tr("Open"));
 	openAction->setShortcut(tr("Ctrl+O"));
	 
	 QAction *saveAction = fileMenu->addAction(tr("Save"));
 	saveAction->setShortcut(tr("Ctrl+S"));

	 QAction *quitAction = fileMenu->addAction(tr("E&xit"));
 	quitAction->setShortcut(tr("Ctrl+Q"));

 	menuBar()->addMenu(fileMenu);
	
	 letters = new QTabWidget;

 	connect(newAction, SIGNAL(triggered()), this, SLOT(newDialog()));
 	connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
	 connect(openAction, SIGNAL(triggered()), this, SLOT(openDialog()));
 	connect(saveAction, SIGNAL(triggered()), this, SLOT(saveDialog()));

 	setCentralWidget(letters);
 	setWindowTitle(tr("Order Form"));
	
	eile = 0;
	lentele = 0;



}
void Darbas6::newDialog()
{
 	DetailsDialog dialog(tr("Enter Customer Details"), this);

 	if (dialog.exec() == QDialog::Accepted)
     	createLetter(dialog.senderNumber(), dialog.senderName(),
                  	dialog.senderWeight(), dialog.senderPrice(),
					  dialog.senderPay(), dialog.senderCent(),
                  	dialog.senderGive());
}
void Darbas6::openFile()
{



}
void Darbas6::saveFile()
{

}

void Darbas6::Save()
{

}

void Darbas6::createLetter(const QString &number, const QString &name, const QString &weigh
		, const QString &price, const QString &pay, const QString &cent, const QString &give)
 {
	QVector<QString> list;
	QVector<QString>::iterator i;
	QString word;
//-------------------------------------
	QFile file("Kainos.txt");
	if (file.open(QIODevice::ReadOnly))
	{
	QTextStream in(&file);
		while (!in.atEnd()) 
		{
			in >> word;
			
			list.push_back(word); 
		}
	file.close();
	}
//-----------------------------------
	 int a = 0;
	 for(i = list.begin(); i!=list.end(); ++i)
	 {
		 if(*i==price)
		 {
			 a = 1; 
			 i++;
			 i++;
			 QString c ;
			 c = *i;
			 lentele = c.toInt();
			 letters->setCurrentIndex(lentele);
			 i--;
			 QString b ;
			 b = *i;
			 row = b.toInt();
				
			 	itemsTable[lentele]->setItem(row, 0, new QTableWidgetItem(number));
				itemsTable[lentele]->setItem(row, 1, new QTableWidgetItem(name));
				itemsTable[lentele]->setItem(row, 2, new QTableWidgetItem(weigh));
				itemsTable[lentele]->setItem(row, 3, new QTableWidgetItem(price));
				itemsTable[lentele]->setItem(row, 4, new QTableWidgetItem(pay));
				itemsTable[lentele]->setItem(row, 5, new QTableWidgetItem(cent));
				itemsTable[lentele]->setItem(row, 6, new QTableWidgetItem(give));

				
				row++;
				QString text_integer;
				text_integer = text_integer.setNum(row);
				i->replace(*i, text_integer);
		 }
	 }
//---------------------------------------------------------------------
	 if (a == 0)
	 {
	itemsTable[lentele] = new QTableWidget(100, 7);
	QStringList sl;
	sl << "Numeris" << "Vardas, Pavarde" << "Svoris" << "pardavimo kaina" << "Kaina" << " 15% " << " Ismoketi";
	itemsTable[lentele]->setHorizontalHeaderLabels(sl);
	int tabIndex = letters->addTab(itemsTable[lentele], price);
	letters->setCurrentIndex(tabIndex);

	list.push_back(price);
	row = 1;
	QString text_integer;
	text_integer = text_integer.setNum(row);
	list.push_back(text_integer);
	
	itemsTable[lentele]->setItem(0, 0, new QTableWidgetItem(number));
	itemsTable[lentele]->setItem(0, 1, new QTableWidgetItem(name));
	itemsTable[lentele]->setItem(0, 2, new QTableWidgetItem(weigh));
	itemsTable[lentele]->setItem(0, 3, new QTableWidgetItem(price));
	itemsTable[lentele]->setItem(0, 4, new QTableWidgetItem(pay));
	itemsTable[lentele]->setItem(0, 5, new QTableWidgetItem(cent));
	itemsTable[lentele]->setItem(0, 6, new QTableWidgetItem(give));
	
	QString fff;
	fff = fff.setNum(lentele);
	list.push_back(fff);
	
	lentele++;
	 }
	 a = 0;
//--------------irasymas i faila----------	
	QFile Save("Kainos.txt");
	if (Save.open(QIODevice::WriteOnly))
	{
	QTextStream out(&Save);
	for(i = list.begin(); i< list.end(); ++i)
	{
		out<<*i<<"\n";
	}
	Save.close();
	}

//----------------------------------------	
QAxObject* excel = new QAxObject( "Excel.Application", 0 );
//then i clear this line, then everything is okey 
}
  • Go to the top of the page

Similar threads

Rate this thread