How to show a frameless dialog - DOESN'T WORK
Hi to all,
I would show a frameless dialog from my gui but I can't.
This is my code:
Code:
#ifndef __INFODLG_H__
#define __INFODLG_H__
#include "GeneratedFiles/ui_infoDlg.h"
#include <QDialog>
class MainWindow;
{
public:
virtual ~InfoDlg();
private slots:
protected:
private:
Ui::infoDlg ui;
MainWindow* win;
};
#endif __INFODLG_H__
and the *.cpp
Code:
#include "InfoDlg.h"
InfoDlg
::InfoDlg( QWidget *parent
){
ui.setupUi(this);
setWindowFlags( Qt::FramelessWindowHint );
win = (MainWindow*)parent;
}
InfoDlg::~InfoDlg()
{
}
here I create the dialog
Code:
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
Re: How to show a frameless dialog - DOESN'T WORK
You've got an example of a frameless QDialog in Qt Demo. Have a look at widgets -> windows flags
Re: How to show a frameless dialog - DOESN'T WORK
Hi
I use this code and all works fine.
Code:
DlgAbout *d = new DlgAbout(0,0,"1.00.00"); // QDialog
d->setWindowTitle(tr("About"));
d->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
d->show();
Note: DlgAbout is a gui create with Qt4 Designer
Re: How to show a frameless dialog - DOESN'T WORK
Quote:
Originally Posted by
vcp
Hi
I use this code and all works fine.
Code:
DlgAbout *d = new DlgAbout(0,0,"1.00.00"); // QDialog
d->setWindowTitle(tr("About"));
d->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
d->show();
Note: DlgAbout is a gui create with Qt4 Designer
It works thank you very much.
The problem was the Qt::Dialog missed.
Now I would do the dialog background transparent :-)
1 Attachment(s)
Re: How to show a frameless dialog - DOESN'T WORK
Hi,
I have a problem on SDK (OS:Windows Vista).
I also use setWindowFlags((this->windowFlags()|Qt::FramelessWindowHint) ,but it still have gray line around window.
Can somebody help ....?
note: you can see the picture in attachment.
linste0815