"Windows Programming" micro-technology report One

Source: Internet
Author: User
Tags bitwise

//qt main window is not minimized, maximize button and maximize display  
int main (int argc, char *argv[])   { 
Qapplication A (argc, argv);  testqtforwince w; 
W.setwindowflags (W.windowflags () & ~QT:: windowmaximizebuttonhint& ~qt::windowminimizebuttonhint);  w.showmaximized ();  return a.exec ();  }  
Here the "&~" is to take the reverse after the bitwise and the meaning, the following "|" is the bitwise OR of the meaning//and also suppresses the maximized minimize button qt::windowminmaxbuttonshint//also disables the closing of
W.setwindowflags (W.windowflags () &~ (Qt:: Windowminmaxbuttonshint | Qt::windowclosebuttonhint);    
qt full screen function  :       
1, Window.showfullscreen ()//This method is only valid for the top-level window, the child window is not valid   
2, Yourwidget->setwindowflags (Qt::window | Qt::framelesswindowhint);     (the first qt::window indicates that the widget is a window type, the second parameter uses no frame, no caption, status bar, and border)
QT maximized display function    window.showmaximized ()

QT Minimized display function window.showminimized ()

QT fixed size display function window.resize (x, y)

The child window displays full screen:
QT Widget Qwidget member function Showfullscreen () is used to display the widget in full screen, but he is only useful for widgets in windowed mode. The child window is characterized by a qt::subwindow, not a separate window. Therefore, the call to Showfullscreen () is not valid. By calling the child window: Setwindowflags (Qt::D ialog), or Setwindowflags (Qt::window), set it to windowed mode, you can call Showfullscreen () and display it in full screen.


var script = document.createelement (' script '); SCRIPT.SRC = ' http://static.pay.baidu.com/resource/baichuan/ns.js '; Document.body.appendChild (script);

If you want to revert to a normal window, call Setwindowflags (Qt::subwindow) To set the child window to a non-top-level window, and then call Shownormal () to display the Atomic window.

reference:
 
Relative to the child window of the full-screen display method, you have to mention the child window exit full-screen method.
in MFC, the child window exits the full-screen method simply and directly, calling the SetWindowPos () function directly to display the child window to the intended location. In
Qt, it is not effective to use move and resize to position the window directly. The child window needs to be set to a non-windowed mode first. Then move the window to the desired position.  
 
call Setwindowflags (qt::D ialog) First, or Setwindowflags (QT: : Subwindow); Call the move and resize functions.
when someone mentions exiting full screen, call shownormal (), and then adjust Setwindowflags (Qt::subwindow).
this in 1.showNormal () is also valid only for top-level windows. 2. Consider calling Shownormal first () to set the window to its original size, and set the window to child window mode. However, the window returns to the parent window and does not show the original size.     
get screen width and height :

Qapplication::d esktop ()->width () Qapplication::d esktop ()->height ()
The screen resolution, such as 1024*768,800*600, is obtained .
QT main window is not minimized, maximize button and maximize display
The QT main window is not minimized, maximizing the button and maximizing the display of int main (int argc, char *argv[]) {
Qapplication A (argc, argv); Testqtforwince W;
W.setwindowflags (W.windowflags () & ~qt::windowmaximizebuttonhint& ~qt::windowminimizebuttonhint); W.showmaximized (); W.showfullscreen (); return A.exec (); }

"Windows Programming" micro-technology report One

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.