Originally Posted by
Santosh Reddy
so show how u are doing it, just copy & paste don't re-type.
window.h
#ifndef WINDOW_H
#define WINDOW_H
#include <QDialog>
#include <QDir>
{
Q_OBJECT
friend void friendFunction(void);
public:
private slots:
void browse();
void find();
};
#ifndef WINDOW_H
#define WINDOW_H
#include <QDialog>
#include <QDir>
class Window : public QDialog
{
Q_OBJECT
friend void friendFunction(void);
public:
QString string;
QString searchKey;
Window(QWidget *parent = 0);
private slots:
void browse();
void find();
};
To copy to clipboard, switch view to plain text mode
window.cpp
#include <QtGui>
#include "window.h"
#include<iostream>
void Window::browse()
{
tr
("Find Files"),
QDir::currentPath());
friendFunction();
}
}
#include <QtGui>
#include "window.h"
#include<iostream>
void Window::browse()
{
QString directory = QFileDialog::getExistingDirectory(this,
tr("Find Files"), QDir::currentPath());
friendFunction();
}
}
To copy to clipboard, switch view to plain text mode
main.cpp
#include <iostream>
using namespace std;
void friendFunction(void);
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(mdi);
Window window;
window.show();
return app.exec();
}
void friendFunction(void)
{
cout<<"FRIEND CALLED "<<endl;
}
#include <iostream>
using namespace std;
QString global_var("ABCD");
QString filename;
QString searchKey;
QStringList filenameList;
void friendFunction(void);
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(mdi);
QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}
void friendFunction(void)
{
cout<<"FRIEND CALLED "<<endl;
}
To copy to clipboard, switch view to plain text mode
Bookmarks