ich habe ein QWidget. In diesem will ich die drei Buttons minimize, maximize & close deaktivieren. Wie geht das?
buttons ausblenden
buttons ausblenden
eine kleine sache, welche mir grosse mühe bereitet.
ich habe ein QWidget. In diesem will ich die drei Buttons minimize, maximize & close deaktivieren. Wie geht das?
ich habe ein QWidget. In diesem will ich die drei Buttons minimize, maximize & close deaktivieren. Wie geht das?
it's time to learn.
danke, ...
danke,
aber es läuft bei mir nicht!
der debugger läuft erfolgreich!
aber das resultat ist immer noch dasselbe.
aber es läuft bei mir nicht!
der debugger läuft erfolgreich!
aber das resultat ist immer noch dasselbe.
it's time to learn.
und damit du um Gottes willen nicht suchen musst:
Qt::WidgetFlags
This enum type is used to specify various window-system properties for the widget. They are fairly unusual but necessary in a few cases. Some of these flags depend on whether the underlying window manager supports them. (See the toplevel example for an explanation and example of their use.)
The main types are
Qt::WType_TopLevel - indicates that this widget is a top-level widget, usually with a window-system frame and so on.
Qt::WType_Dialog - indicates that this widget is a top-level window that should be decorated as a dialog (i.e. typically no maximize or minimize buttons in the title bar). If you want to use it as a modal dialog it should be launched from another window, or have a parent and this flag should be combined with WShowModal. If you make it modal, the dialog will prevent other top-level windows in the application from getting any input. WType_Dialog implies WType_TopLevel. We refer to a top-level window that has a parent as a secondary window. (See also WGroupLeader.)
Qt::WType_Popup - indicates that this widget is a popup top-level window, i.e. that it is modal, but has a window system frame appropriate for popup menus. WType_Popup implies WType_TopLevel.
Qt::WType_Desktop - indicates that this widget is the desktop. See also WPaintDesktop below. WType_Desktop implies WType_TopLevel.
There are also a number of flags which you can use to customize the appearance of top-level windows. These have no effect on other windows:
Qt::WStyle_Customize - indicates that the WStyle_* flags should be used to build the window instead of the default flags.
Qt::WStyle_NormalBorder - gives the window a normal border. This cannot be combined with WStyle_DialogBorder or WStyle_NoBorder.
Qt::WStyle_DialogBorder - gives the window a thin dialog border. This cannot be combined with WStyle_NormalBorder or WStyle_NoBorder.
Qt::WStyle_NoBorder - produces a borderless window. Note that the user cannot move or resize a borderless window via the window system. This cannot be combined with WStyle_NormalBorder or WStyle_DialogBorder. On Windows, the flag works fine. On X11, the result of the flag is dependent on the window manager and its ability to understand MOTIF and/or NETWM hints: most existing modern window managers can handle this. With WX11BypassWM, you can bypass the window manager completely. This results in a borderless window that is not managed at all (i.e. no keyboard input unless you call setActiveWindow() manually).
Qt::WStyle_NoBorderEx - this value is obsolete. It has the same effect as using WStyle_NoBorder.
Qt::WStyle_Title - gives the window a title bar.
Qt::WStyle_SysMenu - adds a window system menu.
Qt::WStyle_Minimize - adds a minimize button. Note that on Windows this has to be combined with WStyle_SysMenu for it to work.
Qt::WStyle_Maximize - adds a maximize button. Note that on Windows this has to be combined with WStyle_SysMenu for it to work.
Qt::WStyle_MinMax - is equal to WStyle_Minimize|WStyle_Maximize. Note that on Windows this has to be combined with WStyle_SysMenu to work.
Qt::WStyle_ContextHelp - adds a context help button to dialogs.
Qt::WStyle_Tool - makes the window a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. It there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider passing WStyle_StaysOnTop as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with WStyle_NoBorder.
Qt::WStyle_StaysOnTop - informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass WX11BypassWM for this flag to work correctly.
Qt::WStyle_Dialog - indicates that the window is a logical subwindow of its parent (i.e. a dialog). The window will not get its own taskbar entry and will be kept on top of its parent by the window system. Usually it will also be minimized when the parent is minimized. If not customized, the window is decorated with a slightly simpler title bar. This is the flag QDialog uses.
Qt::WStyle_Splash - indicates that the window is a splash screen. On X11, we try to follow NETWM standard for a splash screen window if the window manager supports is otherwise it is equivalent to WX11BypassWM. On other platforms, it is equivalent to WStyle_NoBorder | WMacNoSheet | WStyle_Tool | WWinOwnDC
Modifier flags:
Qt::WDestructiveClose - makes Qt delete this widget when the widget has accepted closeEvent(), or when the widget tried to ignore closeEvent() but could not.
Qt::WPaintDesktop - gives this widget paint events for the desktop.
Qt::WPaintUnclipped - makes all painters operating on this widget unclipped. Children of this widget or other widgets in front of it do not clip the area the painter can paint on.
Qt::WPaintClever - indicates that Qt should not try to optimize repainting for the widget, but instead pass on window system repaint events directly. (This tends to produce more events and smaller repaint regions.)
Qt::WMouseNoMask - indicates that even if the widget has a mask, it wants mouse events for its entire rectangle.
Qt::WStaticContents - indicates that the widget contents are north-west aligned and static. On resize, such a widget will receive paint events only for the newly visible part of itself.
Qt::WNoAutoErase - indicates that the widget paints all its pixels. Updating, resizing, scrolling and focus changes should therefore not erase the widget. This allows smart-repainting to avoid flicker.
Qt::WResizeNoErase - this value is obsolete; use WNoAutoErase instead.
Qt::WRepaintNoErase - this value is obsolete; use WNoAutoErase instead.
Qt::WGroupLeader - makes this window a group leader. A group leader should not have a parent (i.e. it should be a top-level window). Any decendant windows (direct or indirect) of a group leader are in its group; other windows are not. If you show a secondary window from the group (i.e. show a window whose top-most parent is a group leader), that window will be modal with respect to the other windows in the group, but modeless with respect to windows in other groups.
Miscellaneous flags
Qt::WShowModal - see WType_Dialog
Qt::WidgetFlags
This enum type is used to specify various window-system properties for the widget. They are fairly unusual but necessary in a few cases. Some of these flags depend on whether the underlying window manager supports them. (See the toplevel example for an explanation and example of their use.)
The main types are
Qt::WType_TopLevel - indicates that this widget is a top-level widget, usually with a window-system frame and so on.
Qt::WType_Dialog - indicates that this widget is a top-level window that should be decorated as a dialog (i.e. typically no maximize or minimize buttons in the title bar). If you want to use it as a modal dialog it should be launched from another window, or have a parent and this flag should be combined with WShowModal. If you make it modal, the dialog will prevent other top-level windows in the application from getting any input. WType_Dialog implies WType_TopLevel. We refer to a top-level window that has a parent as a secondary window. (See also WGroupLeader.)
Qt::WType_Popup - indicates that this widget is a popup top-level window, i.e. that it is modal, but has a window system frame appropriate for popup menus. WType_Popup implies WType_TopLevel.
Qt::WType_Desktop - indicates that this widget is the desktop. See also WPaintDesktop below. WType_Desktop implies WType_TopLevel.
There are also a number of flags which you can use to customize the appearance of top-level windows. These have no effect on other windows:
Qt::WStyle_Customize - indicates that the WStyle_* flags should be used to build the window instead of the default flags.
Qt::WStyle_NormalBorder - gives the window a normal border. This cannot be combined with WStyle_DialogBorder or WStyle_NoBorder.
Qt::WStyle_DialogBorder - gives the window a thin dialog border. This cannot be combined with WStyle_NormalBorder or WStyle_NoBorder.
Qt::WStyle_NoBorder - produces a borderless window. Note that the user cannot move or resize a borderless window via the window system. This cannot be combined with WStyle_NormalBorder or WStyle_DialogBorder. On Windows, the flag works fine. On X11, the result of the flag is dependent on the window manager and its ability to understand MOTIF and/or NETWM hints: most existing modern window managers can handle this. With WX11BypassWM, you can bypass the window manager completely. This results in a borderless window that is not managed at all (i.e. no keyboard input unless you call setActiveWindow() manually).
Qt::WStyle_NoBorderEx - this value is obsolete. It has the same effect as using WStyle_NoBorder.
Qt::WStyle_Title - gives the window a title bar.
Qt::WStyle_SysMenu - adds a window system menu.
Qt::WStyle_Minimize - adds a minimize button. Note that on Windows this has to be combined with WStyle_SysMenu for it to work.
Qt::WStyle_Maximize - adds a maximize button. Note that on Windows this has to be combined with WStyle_SysMenu for it to work.
Qt::WStyle_MinMax - is equal to WStyle_Minimize|WStyle_Maximize. Note that on Windows this has to be combined with WStyle_SysMenu to work.
Qt::WStyle_ContextHelp - adds a context help button to dialogs.
Qt::WStyle_Tool - makes the window a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. It there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider passing WStyle_StaysOnTop as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with WStyle_NoBorder.
Qt::WStyle_StaysOnTop - informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass WX11BypassWM for this flag to work correctly.
Qt::WStyle_Dialog - indicates that the window is a logical subwindow of its parent (i.e. a dialog). The window will not get its own taskbar entry and will be kept on top of its parent by the window system. Usually it will also be minimized when the parent is minimized. If not customized, the window is decorated with a slightly simpler title bar. This is the flag QDialog uses.
Qt::WStyle_Splash - indicates that the window is a splash screen. On X11, we try to follow NETWM standard for a splash screen window if the window manager supports is otherwise it is equivalent to WX11BypassWM. On other platforms, it is equivalent to WStyle_NoBorder | WMacNoSheet | WStyle_Tool | WWinOwnDC
Modifier flags:
Qt::WDestructiveClose - makes Qt delete this widget when the widget has accepted closeEvent(), or when the widget tried to ignore closeEvent() but could not.
Qt::WPaintDesktop - gives this widget paint events for the desktop.
Qt::WPaintUnclipped - makes all painters operating on this widget unclipped. Children of this widget or other widgets in front of it do not clip the area the painter can paint on.
Qt::WPaintClever - indicates that Qt should not try to optimize repainting for the widget, but instead pass on window system repaint events directly. (This tends to produce more events and smaller repaint regions.)
Qt::WMouseNoMask - indicates that even if the widget has a mask, it wants mouse events for its entire rectangle.
Qt::WStaticContents - indicates that the widget contents are north-west aligned and static. On resize, such a widget will receive paint events only for the newly visible part of itself.
Qt::WNoAutoErase - indicates that the widget paints all its pixels. Updating, resizing, scrolling and focus changes should therefore not erase the widget. This allows smart-repainting to avoid flicker.
Qt::WResizeNoErase - this value is obsolete; use WNoAutoErase instead.
Qt::WRepaintNoErase - this value is obsolete; use WNoAutoErase instead.
Qt::WGroupLeader - makes this window a group leader. A group leader should not have a parent (i.e. it should be a top-level window). Any decendant windows (direct or indirect) of a group leader are in its group; other windows are not. If you show a secondary window from the group (i.e. show a window whose top-most parent is a group leader), that window will be modal with respect to the other windows in the group, but modeless with respect to windows in other groups.
Miscellaneous flags
Qt::WShowModal - see WType_Dialog
hey......
danke für deine ausführliche antwort.
inklusive der beschreibung zu Qt::WidgetFlags.
so faul wie du denkst bin ich nicht. habe mir die beschreibung schon angeschaut und ausprobiert.
und wenn ich sage es geht nicht, dann meine ich das auch so.
siehst du!

danke für deine ausführliche antwort.
inklusive der beschreibung zu Qt::WidgetFlags.
so faul wie du denkst bin ich nicht. habe mir die beschreibung schon angeschaut und ausprobiert.
und wenn ich sage es geht nicht, dann meine ich das auch so.
siehst du!
Code: Alles auswählen
//----------------------------------------------------------
void departuregui::init()
{
setWFlags(Qt::WStyle_Customize | Qt::WStyle_DialogBorder);
_mySocket = new QSocket(this);
_myTimer = new QTimer(this);
if (_mySocket->state()==QSocket::Idle)
{
statearea->setPaletteBackgroundColor(red);
statearea->setText("Abmeldung noch nicht erfolgt.");
}
connect( _mySocket, SIGNAL(connected()),
SLOT(socketConnected()) );
connect( _myTimer, SIGNAL(timeout()),
SLOT(connectAgain()) );
//connect( _mySocket, SIGNAL(connectionClosed()),
// SLOT(socketConnectionClosed()) );
connect( _mySocket, SIGNAL(error(int)),
SLOT(socketError(int)) );
connect( _mySocket, SIGNAL(readyRead()),
SLOT(socketReadyRead()) );
_mySocket->connectToHost("stefano", 9000);
_myTimer->start(10000, true);
}
//----------------------------------------------------------it's time to learn.
Du hasts nicht recht gelesen....oder nicht verstanden (kann sein, aber dann musst halt nachfragen)....du sollst doch dein departuregui Widget mal mit den entsprechenden Flags erstellen und nicht versuchen, die Flags einem schon bestehenden Widget zuzuweisen. Das wird naemlich nicht funktionieren. Du kannst das hoechstens noch im Konstruktor machen.
Goos
Goos