12 QT Basic dialogs, as well as fade-in principle (the window becomes transparent with a timer)

Source: Internet
Author: User

First, Basic dialog box

1, Core library:
Interface Program Qapplication
Non-Program Interface qcoreappliction

2, the message loop must execute Qapplication.exec ();

3, message binding mechanism: signal-Slot
The signal can correspond to a signal, or it can correspond to slots.
A signal can correspond to multiple signals and multiple slots.

4,QT Basic dialog box:
Qerrormessage,
Qinputdialog,
Qmessagebox,
Qprintdialog,
Qprogressdialog,
Qfiledialog,
Qabstractprintdialog,
Qcolordialog
Qfontdialog,
Qpagesetupdialog,
Qprintpreviewdialog,
Qwizard

5, form location information:
The Qwidget class is the base class of all user interface objects.
Obtained through a series of functions of Qwidget:
X (), Y () window upper-left corner coordinates
Framegeometry (), window rectangle
POS (), upper-left corner of window coordinates
Geometry (), window rectangle (excluding borders and title bars)
Width (), Height (), window height (without border and title bar)
Rect (), window rectangle, (0,0,xxx,xxx) (without Borders and title bars)
Size () window sizes (excluding borders and title bars)

6,qtoolbutton usage:
Qtoolbutton *btn;
BTN = new Qtoolbutton;
Btn->settext (tr ("text"));
Btn->seticon (Qpixmap (":/images/bb.png"));
Btn->seticonsize (Qpixmap (":/images/bb.png"). Size ());
Btn->setautoraise (TRUE);
Btn->settoolbuttonstyle (Qt::toolbuttontextundericon);

7, drawer form: Qtoolbox
8, Table Form: Qtablewidget
9. Dynamic Load UI
Quiloader loader;
QFile file (":/forms/dialog.ui");
File.Open (qfile::readonly);
Qwidget *dialog = Loader.load (&file);
File.close ();
Third->show ();


Chapter II Layout Management

1, Basic layout class
|---qboxlayout----------|---qhboxlayout
|---|---qvboxlayout
|---qgridlayout

AddWidget (); inserting controls
Addlayout (); Insert Layout
Setframestyle ();
Addstretch (); Insert Placeholder

2, multi-document Qworksspace
3, Split form Qsplitter
4, docked form Qdockwidget
5, Stack form Qstackedwidget

Chapter Three conversation window advanced

1, Extensible dialog box, very simple.
2, Palette Qpalette
SetColor ()
Setbrush ()
3, Window fades
Fade in principle: While the window appears, create a new blank form with the size of the window, with the timer from full opacity to become completely transparent.

Http://blog.chinaunix.net/uid-25749806-id-2911321.html

12 QT Basic dialogs, and the fade-in principle (the window becomes transparent using a timer)

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.