franco.amato
6th April 2010, 16:26
Hi to all,
I would show a frameless dialog from my gui but I can't.
This is my code:
#ifndef __INFODLG_H__
#define __INFODLG_H__
#include "GeneratedFiles/ui_infoDlg.h"
#include <QDialog>
class MainWindow;
class InfoDlg : public QDialog
{
public:
InfoDlg( QWidget *parent );
virtual ~InfoDlg();
private slots:
protected:
private:
Ui::infoDlg ui;
MainWindow* win;
};
#endif __INFODLG_H__
and the *.cpp
#include "InfoDlg.h"
InfoDlg::InfoDlg( QWidget *parent )
: QDialog(parent)
{
ui.setupUi(this);
setWindowFlags( Qt::FramelessWindowHint );
win = (MainWindow*)parent;
}
InfoDlg::~InfoDlg()
{
}
here I create the dialog
void MainWindow::test()
{
InfoDlg dlg(this);
dlg.exec();
}
Unfortunately it doesn't work. I tried either with exec and show methods without success.
Where is the problem?
Regards
I would show a frameless dialog from my gui but I can't.
This is my code:
#ifndef __INFODLG_H__
#define __INFODLG_H__
#include "GeneratedFiles/ui_infoDlg.h"
#include <QDialog>
class MainWindow;
class InfoDlg : public QDialog
{
public:
InfoDlg( QWidget *parent );
virtual ~InfoDlg();
private slots:
protected:
private:
Ui::infoDlg ui;
MainWindow* win;
};
#endif __INFODLG_H__
and the *.cpp
#include "InfoDlg.h"
InfoDlg::InfoDlg( QWidget *parent )
: QDialog(parent)
{
ui.setupUi(this);
setWindowFlags( Qt::FramelessWindowHint );
win = (MainWindow*)parent;
}
InfoDlg::~InfoDlg()
{
}
here I create the dialog
void MainWindow::test()
{
InfoDlg dlg(this);
dlg.exec();
}
Unfortunately it doesn't work. I tried either with exec and show methods without success.
Where is the problem?
Regards