Pan Wojtas
28th January 2006, 21:03
How can i create a new QTextEdit (as a new window - not child) with some extra wflags?
The constructor doesn't allow for this - it looks like this:
QTextEdit::QTextEdit( QWidget *parent, const char *name ) : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase )
I could use QWidget::setWFlags, but it doesn't work:
class AAA : public QTextEdit
{
Q_OBJECT
public:
AAA::AAA(QWidget * parent) : QTextEdit(parent, "")
{
setWFlags(WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop | WDestructiveClose);
setText("aaa");
show();
}
};
AAA *a;
a = new AAA(0);
Qt creates normal window :confused:
The constructor doesn't allow for this - it looks like this:
QTextEdit::QTextEdit( QWidget *parent, const char *name ) : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase )
I could use QWidget::setWFlags, but it doesn't work:
class AAA : public QTextEdit
{
Q_OBJECT
public:
AAA::AAA(QWidget * parent) : QTextEdit(parent, "")
{
setWFlags(WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop | WDestructiveClose);
setText("aaa");
show();
}
};
AAA *a;
a = new AAA(0);
Qt creates normal window :confused: