Qt4 | Qmake | Fstream

It appears to be a compatability problem.

  • (2 Pages)
  • +
  • 1
  • 2

26 Replies - 8347 Views - Last Post: 01 January 2009 - 05:16 PM Rate Topic: -----

#1 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Qt4 | Qmake | Fstream

Posted 25 December 2008 - 03:15 AM

Before you ask, yes I have tried to write a program like this before.
But I lost everything on my hard drive, so i started fresh, and I am glad I did.
The applications intent (at this point) is to get two strings, file paths. And to, after the user is done typing;
check to see if it is a valid path. If so, a green text would appear to the right of the test field, saying "Ok".
If not, a red text would appear, saying "Error". Eventually I will add RSA style encryption algorithm's.

My problem is that, qmake doesn't seem to recognize STL/STD functions and objects. For example, when compiling
qmake seems to fail to notice fstream::open(). This is deeply troubling. Furthermore, I am getting a notice that I need a
"}" at the end of my .cpp. However, not only is one there, but it is the final closing brace?


fileManager.h
#ifndef FILEMANAGER_H_INCLUDED
#define FILEMANAGER_H_INCLUDED

#include <Qt/qstring.h>
#include <string.h>
#include <fstream>
#include <iostream>

using namespace std;


class fileMan
{
	bool fileChk(string arg)
	{
		ifstream MyTmp;
		MyTmp.open(arg, ios::in);
		if (! MyTmp.is_open())
			return false;
		else MyTmp.close();
		return true;
		MyTmp.close();
	}
	void fileChk(string arg,QLabel argv)
	{
		ifstream MyTmp;
		MyTmp.open(arg, ios::in);
		if (! MyTmp.is_open())
		{
			argv.setText("<strong><font color='#ffff000'>Ok!</font></strong>");
		}
		else
		{
			argv.setText("<strong><font color='#c30000'>Error</font></strong>");
		}
		MyTmp.close();
	}

#endif // FILEMANAGER_H_INCLUDED



manDialog.cpp
#include <Qt/qapplication.h>
#include <Qt/qwidget.h>
#include <Qt/qboxlayout.h>
#include <Qt/qlabel.h>
#include <Qt/qlineedit.h>
#include <Qt/qpushbutton.h>

#include <fileManager.h>


int main(int argc, char *argv[])
{
	// Primary
	QApplication	appMain(argc, argv);
	QWidget		 winMain;
	winMain.resize(400,100);
	QVBoxLayout	 winLayMain;
	 // Source
	  // Layout
	  QHBoxLayout	srcLay;
	   // Members Declaration
	   QLineEdit	  srcLine;
	   QLabel		 srcTitle("File To Encrypt");
	   QLabel		 srcStat;
	   // Members Organization
	   srcLay.addWidget(&srcTitle);
	   srcLay.addWidget(&srcLine);
	   srcLay.addWidget(&srcStat);
	 // Finale
	  // Layout
	  QHBoxLayout	finLay;
	   // Members Declaration
	   QLineEdit	  finLine;
	   QLabel		 finTitle("Output Location");
	   // Members Organization
	   finLay.addWidget(&finTitle);
	   finLay.addWidget(&finLine);
	 // Instruct
	 QLabel	 instructMain("Select a Text File To Encrypt.");
	 // Buttons
	  // Layout
	  QHBoxLayout	  buttLay;
	   // Members Declaration
	   QPushButton	  accept("Start");
	   QPushButton	  cancel("Cancel");
	   // Members Organization
	   buttLay.addWidget(&accept);
	   buttLay.addWidget(&cancel);
	// Final Layout config
	winLayMain.addWidget(&instructMain);
	winLayMain.addLayout(&srcLay);
	winLayMain.addLayout(&finLay);
	winLayMain.addLayout(&buttLay);

	// Finale Layout Configuration
	winMain.setLayout(&winLayMain);
	winMain.show();

	/** SLOTS **/
	QObject::connect(&srcLine, SIGNAL(editingFinished()), &appMain, SLOT(fileChk(toStdString(srcLine.text()),&srcStat)));
	QObject::connect(&cancel,  SIGNAL(clicked()),		 &appMain, SLOT(quit()));
	return appMain.exec();
}



Compiler (qmake-qt4 -project && qmake-qt4 && make):
manDialog.cpp:63: error: expected `}' at end of input
In file included from manDialog.cpp:8:
./fileManager.h: In member function ‘bool fileMan::fileChk(std::string)’:
./fileManager.h:17: error: no matching function for call to ‘std::basic_ifstream<char, std::char_traits<char> >::open(std::string&, const std::_Ios_Openmode&)’
/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/fstream:495: note: candidates are: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]
./fileManager.h: In member function ‘void fileMan::fileChk(std::string, QLabel)’:
./fileManager.h:27: error: no matching function for call to ‘std::basic_ifstream<char, std::char_traits<char> >::open(std::string&, const std::_Ios_Openmode&)’
/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/fstream:495: note: candidates are: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]
manDialog.cpp: At global scope:
manDialog.cpp:63: error: expected unqualified-id at end of input



Any advice would be appreciated. I tried to find why the errors occurred, but there seems to be no reason?
Please check this thread often, I intend to continue to update it as I continue to develop.

Is This A Good Question/Topic? 0
  • +

Replies To: Qt4 | Qmake | Fstream

#2 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 25 December 2008 - 07:05 AM

You are missing the ending brace and semicolon at the end of your fileMan class.
Was This Post Helpful? 0
  • +
  • -

#3 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 25 December 2008 - 12:58 PM

Well, I fixed it but I still get a error. It still doesn't recognize fstream::open ?
Was This Post Helpful? 0
  • +
  • -

#4 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 25 December 2008 - 04:55 PM

try converting your std::string to a char array (string::c_str() )
the docs don't say if the fstream::open function will accept a standard string.

edit:
in fact, that's exactly what the compiler error is telling you. the only function call to fstream::open uses a char*.

This post has been edited by GWatt: 25 December 2008 - 04:57 PM

Was This Post Helpful? 0
  • +
  • -

#5 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 25 December 2008 - 06:12 PM

Thanks Gwatt :)
Was This Post Helpful? 0
  • +
  • -

#6 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 26 December 2008 - 09:18 PM

Well In my last code post I had a slot problem. Apparently I can't use functions as slots that aren't sub-classed with QObject. So I re-wrote the code. And created a class that contains the LineEdit and the two informational Qlabels, the layout information and the fileChk function. This simplified a few things, greatly(Now I like Object Orientated Code).

However, in my class, getFile; I am having some problems with the layout object in said class. When qmake arrives at inerLay.addwidget() it says: error: ISO C++ forbids declaration of ‘interLay’ with no type. Yet the type whould be defined by the objects declaration, whats going on?

Code:

fileManager.h:
#ifndef FILEMANAGER_H_INCLUDED
#define FILEMANAGER_H_INCLUDED

#include <Qt/qstring.h>
#include <Qt/qwidget.h>
#include <Qt/qlabel.h>
#include <Qt/qlineedit.h>
#include <Qt/qobject.h>
#include <Qt/qimage.h>
#include <Qt/qboxlayout.h>


#include <string.h>
#include <fstream>
#include <iostream>

using namespace std;


class getFile : public QObject
{
public:
	QLineEdit	 flPath;	// File Path Line
	QLabel		flPathTi;  // File Path Title
	QLabel		flPathStat;// File Path Status
	/** Layout Design **/
	QHBoxLayout		 interLay; // Internal Layout
	interLay.addWidget(&flPathTi);
	interLay.addWidget(&flPath);
	interLay.addwidget(&flPathStat);

	/** FILE CHECKING **/
public slots:
	void  chkFile(void)
	{
		fstream MyTmpFile;
		QString MyPath1;
		MyPath1 = flPath.text();
		string MyPath2;
		MyPath2 = MyPath1.toStdString();

		MyTmpFile.open(MyPath2.c_str());
		if (! MyTmpFile.is_open())
		{
			flPathStat.setText("<font size='+1' color='red'><b>Invalid!</font></b>");
			MyTmpFile.close();
			return;
		}
		else
		{
			flPathStat.setText("<font size='+1' color='green'><b>Ok!</font></b>");
			MyTmpFile.close();
			return;
		}
	}
	bool  chkFile(string arg)
	{
		fstream MyTmpFile;
		MyTmpFile.open(arg.c_str());
		if (! MyTmpFile.is_open())
		{
			MyTmpFile.close();
			return false;
		}
		else
		{
			MyTmpFile.close();
			return true;
		}
	}
};
#endif // FILEMANAGER_H_INCLUDED



manDialog.cpp
#include <Qt/qapplication.h>
#include <Qt/qwidget.h>
#include <Qt/qboxlayout.h>
#include <Qt/qlabel.h>
#include <Qt/qlineedit.h>
#include <Qt/qpushbutton.h>

#include <fileManager.h>


int main(int argc, char *argv[])
{
// Primary Declarations
QApplication	   AppMain(argc, argv);
QWidget			WinMain;
WinMain.resize(300,100);
QVBoxLayout		LayMain;

/// Widget Groups
QPushButton		accept("Ok");
QPushButton		cancel("Cancel");
getFile			src; // Source
getFile			des; // Destination
getFile			pub; // Public Key
getFile			pri; // Private Key


/// Widget Groups Configuration
/// Layout
QHBoxLayout			exec;
exec.addWidget(&accept);
exec.addWidget(&cancel);
LayMain.addLayout(&src.interLay);
LayMain.addLayout(&des.interLay);
LayMain.addLayout(&pub.interLay);
LayMain.addLayout(&pri.interLay);
LayMain.addLayout(&exec);
/// Specific Configuration
// src
src.flPathTi.setText("File To Encrypt:");
// des
des.flPathTi.setText("Save Encrypted File To:");
// pub
pub.flPathTi.setText("Save Public Key To:");
// pri
pri.flPathTi.setText("Save Private Key To:");

/// Connections
//  File Path checking
QObject::connect(&src.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(src.chkFile()));
QObject::connect(&des.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(des.chkFile()));
QObject::connect(&pub.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pub.chkFile()));
QObject::connect(&pri.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pri.chkFile()));
QObject::connect(&accept,	 SIGNAL(clicked()),		 &AppMain, SLOT(/**PLACE**/));
QObject::connect(&cancel,	 SIGNAL(clicked()),		 &AppMain, SLOT(quit()));

WinMain.show();
return AppMain.exec();
}



Compiler:
In file included from manDialog.cpp:8:
./fileManager.h:28: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:28: error: expected ‘;’ before ‘.’ token
./fileManager.h:29: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:29: error: expected ‘;’ before ‘.’ token
./fileManager.h:30: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:30: error: expected ‘;’ before ‘.’ token



Any ideas on this?
Btw, check out where I set the text of flPathStat. In the strings, using html notation i cannot use the quotation mark ", it will end the string. So how can I properly use HTML with qlabel.

Thanks :)
Was This Post Helpful? 0
  • +
  • -

#7 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 26 December 2008 - 09:45 PM

the QHBoxLayout class is defined in the QHBoxLayout header file(If you're using QT 4). You have to include that header, but you haven't.
Was This Post Helpful? 0
  • +
  • -

#8 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 26 December 2008 - 09:51 PM

Ah, I though that including qboxlayout would suffice.

This is odd, qmake returns this:
fileManager.h:11:28: error: Qt/qhboxlayout.h: No such file or directory


Was This Post Helpful? 0
  • +
  • -

#9 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 26 December 2008 - 10:10 PM

I haven't said anything before, but the normal practice for including Qt headers is to use this format:
#inlcude <QtCore/QObject>
#include <QtGui/QHBoxLayout>
#include <QtGui/QPushButton>


Notice the lack of file extension, the module specifier, and the case sensitive file name. I'm not sure which file is finally included, but it's not necessarily qhboxlayout.h
Was This Post Helpful? 0
  • +
  • -

#10 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 26 December 2008 - 10:41 PM

Well, I updated all my includes, but I am still getting errors(same ones):

filemanager.h:
#ifndef FILEMANAGER_H_INCLUDED
#define FILEMANAGER_H_INCLUDED

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QImage>
#include <QtGui/QBoxLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QPushButton>

#include <string.h>
#include <fstream>
#include <iostream>

using namespace std;


class getFile : public QObject
{
public:
	QLineEdit	 flPath;	// File Path Line
	QLabel		flPathTi;  // File Path Title
	QLabel		flPathStat;// File Path Status
	/** Layout Design **/
	QHBoxLayout		 interLay; // Internal Layout
	interLay.addWidget(&flPathTi);
	interLay.addWidget(&flPath);
	interLay.addwidget(&flPathStat);

	/** FILE CHECKING **/
public slots:
	void  chkFile(void)
	{
		fstream MyTmpFile;
		QString MyPath1;
		MyPath1 = flPath.text();
		string MyPath2;
		MyPath2 = MyPath1.toStdString();

		MyTmpFile.open(MyPath2.c_str());
		if (! MyTmpFile.is_open())
		{
			flPathStat.setText("<font size='+1' color='red'><b>Invalid!</font></b>");
			MyTmpFile.close();
			return;
		}
		else
		{
			flPathStat.setText("<font size='+1' color='green'><b>Ok!</font></b>");
			MyTmpFile.close();
			return;
		}
	}
	bool  chkFile(string arg)
	{
		fstream MyTmpFile;
		MyTmpFile.open(arg.c_str());
		if (! MyTmpFile.is_open())
		{
			MyTmpFile.close();
			return false;
		}
		else
		{
			MyTmpFile.close();
			return true;
		}
	}
};
#endif // FILEMANAGER_H_INCLUDED



manDialog.cpp:
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QImage>
#include <QtGui/QBoxLayout>
#include <QtGui/QHBoxLayout>
#include <fileManager.h>


int main(int argc, char *argv[])
{
// Primary Declarations
QApplication	   AppMain(argc, argv);
QWidget			WinMain;
WinMain.resize(300,100);
QVBoxLayout		LayMain;

/// Widget Groups
QPushButton		accept("Ok");
QPushButton		cancel("Cancel");
getFile			src; // Source
getFile			des; // Destination
getFile			pub; // Public Key
getFile			pri; // Private Key


/// Widget Groups Configuration
/// Layout
QHBoxLayout			exec;
exec.addWidget(&accept);
exec.addWidget(&cancel);
LayMain.addLayout(&src.interLay);
LayMain.addLayout(&des.interLay);
LayMain.addLayout(&pub.interLay);
LayMain.addLayout(&pri.interLay);
LayMain.addLayout(&exec);
/// Specific Configuration
// src
src.flPathTi.setText("File To Encrypt:");
// des
des.flPathTi.setText("Save Encrypted File To:");
// pub
pub.flPathTi.setText("Save Public Key To:");
// pri
pri.flPathTi.setText("Save Private Key To:");

/// Connections
//  File Path checking
QObject::connect(&src.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(src.chkFile()));
QObject::connect(&des.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(des.chkFile()));
QObject::connect(&pub.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pub.chkFile()));
QObject::connect(&pri.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pri.chkFile()));
QObject::connect(&accept,	 SIGNAL(clicked()),		 &AppMain, SLOT(/**PLACE**/));
QObject::connect(&cancel,	 SIGNAL(clicked()),		 &AppMain, SLOT(quit()));

WinMain.show();
return AppMain.exec();
}



Compiler(qmake):
In file included from manDialog.cpp:10:
./fileManager.h:29: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:29: error: expected ‘;’ before ‘.’ token
./fileManager.h:30: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:30: error: expected ‘;’ before ‘.’ token
./fileManager.h:31: error: ISO C++ forbids declaration of ‘interLay’ with no type
./fileManager.h:31: error: expected ‘;’ before ‘.’ token



Any ideas?
Was This Post Helpful? 0
  • +
  • -

#11 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 27 December 2008 - 07:50 AM

Ok, actually the problem was that you put code that actually did stuff outside of a function. I fixed it by making a constructor and putting the three addWidget() function calls inside of the constructor.

Also, capitalize the 'w' in the final addWidget() call.
Was This Post Helpful? 0
  • +
  • -

#12 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 29 December 2008 - 01:30 AM

Well it compiled fine. But on render, there are no widgets in the window. In the bash prompt that I launched it from, all the QObject::Connects are displayed. Also they are all shown to be invalid. For the slots/signals I am trying ot use have I sub classed correctly?

FileManager.h
#ifndef FILEMANAGER_H_INCLUDED
#define FILEMANAGER_H_INCLUDED

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QImage>
#include <QtGui/QBoxLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QPushButton>

#include <string.h>
#include <fstream>
#include <iostream>

using namespace std;


class getFile : QObject
{
public:
	getFile()
	{
		interLay.addWidget(&flPathTi);
		interLay.addWidget(&flPath);
		interLay.addWidget(&flPathStat);
		return;
	}
	QLineEdit	 flPath;	// File Path Line
	QLabel		flPathTi;  // File Path Title
	QLabel		flPathStat;// File Path Status
	/** Layout Design **/
	QHBoxLayout		 interLay; // Internal Layout

	/** FILE CHECKING **/
public slots:
	void  chkFile(void)
	{
		fstream MyTmpFile;
		QString MyPath1;
		MyPath1 = flPath.text();
		string MyPath2;
		MyPath2 = MyPath1.toStdString();

		MyTmpFile.open(MyPath2.c_str());
		if (! MyTmpFile.is_open())
		{
			flPathStat.setText("<font size='+1' color='red'><b>Invalid!</font></b>");
			MyTmpFile.close();
			return;
		}
		else
		{
			flPathStat.setText("<font size='+1' color='green'><b>Ok!</font></b>");
			MyTmpFile.close();
			return;
		}
	}
	bool  chkFile(string arg)
	{
		fstream MyTmpFile;
		MyTmpFile.open(arg.c_str());
		if (! MyTmpFile.is_open())
		{
			MyTmpFile.close();
			return false;
		}
		else
		{
			MyTmpFile.close();
			return true;
		}
	}
};
#endif // FILEMANAGER_H_INCLUDED




manDialog
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QImage>
#include <QtGui/QBoxLayout>
#include <QtGui/QHBoxLayout>
#include <fileManager.h>


int main(int argc, char *argv[])
{
// Primary Declarations
QApplication	   AppMain(argc, argv);
QWidget			WinMain;
WinMain.resize(500,500);
QVBoxLayout		LayMain;

/// Widget Groups
QPushButton		accept("Ok");
QPushButton		cancel("Cancel");
getFile			src; // Source
getFile			des; // Destination
getFile			pub; // Public Key
getFile			pri; // Private Key


/// Widget Groups Configuration
/// Layout
QHBoxLayout			exec;
exec.addWidget(&accept);
exec.addWidget(&cancel);
LayMain.addLayout(&src.interLay);
LayMain.addLayout(&des.interLay);
LayMain.addLayout(&pub.interLay);
LayMain.addLayout(&pri.interLay);
LayMain.addLayout(&exec);
/// Specific Configuration
// src
src.flPathTi.setText("File To Encrypt:");
// des
des.flPathTi.setText("Save Encrypted File To:");
// pub
pub.flPathTi.setText("Save Public Key To:");
// pri
pri.flPathTi.setText("Save Private Key To:");

/// Connections
//  File Path checking
QObject::connect(&src.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(src.chkFile()));
QObject::connect(&des.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(des.chkFile()));
QObject::connect(&pub.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pub.chkFile()));
QObject::connect(&pri.flPath, SIGNAL(editingFinished()), &AppMain, SLOT(pri.chkFile()));
QObject::connect(&accept,	 SIGNAL(clicked()),		 &AppMain, SLOT(/**PLACE**/));
QObject::connect(&cancel,	 SIGNAL(clicked()),		 &AppMain, SLOT(quit()));

WinMain.show();
return AppMain.exec();
}





OutPut:
Object::connect: No such slot QApplication::src.chkFile()
Object::connect:  (receiver name: 'LambdaCrypt')
Object::connect: No such slot QApplication::des.chkFile()
Object::connect:  (receiver name: 'LambdaCrypt')
Object::connect: No such slot QApplication::pub.chkFile()
Object::connect:  (receiver name: 'LambdaCrypt')
Object::connect: No such slot QApplication::pri.chkFile()
Object::connect:  (receiver name: 'LambdaCrypt')
Object::connect: Parentheses expected, slot QApplication::
Object::connect:  (receiver name: 'LambdaCrypt')


Was This Post Helpful? 0
  • +
  • -

#13 badjava  Icon User is offline

  • Lux Ex Tenebris
  • member icon

Reputation: 14
  • View blog
  • Posts: 540
  • Joined: 30-October 08

Re: Qt4 | Qmake | Fstream

Posted 29 December 2008 - 01:38 AM

View PostDelta_Echo, on 29 Dec, 2008 - 12:30 AM, said:

Well it compiled fine. But on render, there are no widgets in the window. In the bash prompt that I launched it from, all the QObject::Connects are displayed. Also they are all shown to be invalid. For the slots/signals I am trying ot use have I sub classed correctly?


Man, you must be doing this on some 'nix flavor cause this is just about greek.
Was This Post Helpful? 0
  • +
  • -

#14 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Qt4 | Qmake | Fstream

Posted 29 December 2008 - 02:07 AM

Linux Fedora 10
Was This Post Helpful? 0
  • +
  • -

#15 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Qt4 | Qmake | Fstream

Posted 29 December 2008 - 07:16 AM

Qt says that for a class to declare signals or slots it must include this in the beginning:
class Something : QObject
{
	Q_OBJECT  // <-- You NEED this
};


Add that macro in at the beginning of your getFile class and see if that fixes something.

Quote

Man, you must be doing this on some 'nix flavor cause this is just about greek.
Nothing in there is OS specific. You probably have no experience with Qt programming.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2