Detailed explanation of the use of QT QFrame control

        This article introduces various operations of the QFrame control in detail, such as: setting frame shape , setting frame shadow , setting line width , middle line width , setting frame style , setting size policy , setting style sheet, other articles, etc.

        In actual development, an interface may contain more than a dozen controls, and manually adjusting their positions is time-consuming and laborious. QFrame is the base class of basic controls, and QWidget is the base class of QFrame. In essence, it does more work on the basis of widget, such as expanding some display beautification functions such as style shadows, and then encapsulates it into the QFrame class. In fact, it is style support based on QWidget. QWidget does not support style sheets , but QFrame does.

        There are currently thirty-four articles in this series of QT comprehensive and detailed explanations. This series of articles describes the basic operation and use of QT controls in more detail. Thank you for your attention, likes, and collections.
 

This article is original by the author. Please attach the source of the article and the link to this article when reprinting.

QT QFrame control usage detailed directory

1 Set the frame shape

2 Set frame shadow

3 Set the line width

4 middle line width

5 Set the frame style

6 Set size policy

7 Set up style sheets

8 other articles


1 Set the frame shape

    //设置框架的形状。形状可以是NoFrame、Box、Panel、WinPanel、HLine、VLine、StyledPanel等
    ui->frame->setFrameShape(QFrame::Box);

2 Set frame shadow

    //设置框架的阴影。阴影可以是Plain、Raised、Sunken
    ui->frame->setFrameShadow(QFrame::Sunken);

3 Set the line width

    //设置线宽
    ui->frame->setLineWidth(2);

4 middle line width

    //设置中间线宽
    ui->frame->setMidLineWidth(3);

5 Set the frame style

    //设置框架的样式。样式是形状和阴影的位或(OR)组合
    ui->frame->setFrameStyle(QFrame::Panel | QFrame::Raised);

6 Set size policy

    //设置大小策略,这决定了控件如何在布局中改变大小
    ui->frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

7 Set up style sheets

    //设置样式表,这可以用来自定义控件的外观
    ui->frame->setStyleSheet("background-color: blue;");

8 other articles

 QT TextEdit control_Gemini Breakpoint's Blog-CSDN Blog_qt textedit

Detailed explanation of the use of QT QComboBox_Gemini Breakpoint's Blog-CSDN Blog

Detailed explanation of QT QtableView operation_Gemini Breakpoint's Blog-CSDN Blog_qtableview addition, deletion, modification and query

Qt QStandardItemModel (1. Super detailed usage)_Gemini Breakpoint's Blog-CSDN Blog_qstandardmodel

Qt QStandardItemModel (2. Super detailed function)_Gemini Breakpoint's Blog-CSDN Blog_qstandarditemmodel click event

Detailed explanation of the use of QT QRadioButton_Gemini Breakpoint's Blog-CSDN Blog_qt radiobutton

Detailed explanation of the use of QT QLineEdit_Gemini Breakpoint's Blog-CSDN Blog_qt qlineedit

Detailed explanation of the use of Qt QMessageBox_Gemini Breakpoint's Blog-CSDN Blog_qt message

QChart line chart, pie chart, bar chart, curve chart_Gemini Breakpoint's Blog-CSDN Blog_qchart Style

Detailed explanation of QChart attributes_Gemini Breakpoint's Blog-CSDN Blog_setanimationoptions

QCharts QValueAxis use_Gemini Breakpoint's Blog-CSDN Blog_qvalueaxis

Qt 5 Waiting Prompt Box (Open Source Dynamic Graphic)_Gemini Breakpoint's Blog-CSDN Blog_qt Waiting Dialog Box

QtDataVisualization Data 3D Visualization_Gemini Breakpoint's Blog-CSDN Blog_qtdatavisualizatio

QT QSpinBox Integer Counter Control Detailed Explanation_Gemini Breakpoint's Blog-CSDN Blog
QT QDoubleSpinBox Floating Point Counter Control (Usage Detailed)_Gemini Breakpoint's Blog-CSDN Blog_qdoublespinbox Signal Slot
QT QSlider, QHorizontalSlider, QVerticalSlider Control Detailed Explanation_Gemini Breakpoint blog-CSDN blog_qslider setting step size

Detailed explanation of the use of QT QTabWidget control_Gemini Breakpoint's Blog-CSDN Blog

Detailed explanation of the use of QT QCalendarWidget control_Gemini Breakpoint's Blog-CSDN Blog

Detailed explanation of the use of QT QStackedWidget control_Gemini Breakpoint's Blog-CSDN Blog

QT QVBoxLayout vertical layout control_Gemini Breakpoint's Blog-CSDN Blog

QT QHBoxLayout Horizontal Layout Control_Gemini Breakpoint Blog-CSDN BlogQT
QGridLayout Grid Layout Control_Gemini Breakpoint Blog-CSDN Blog

QT QVerticalSpacer spring control_Gemini Breakpoint's blog-CSDN blog
QT QHorizontalSpacer spring control_Gemini breakpoint's blog-CSDN blog
QT QLine usage details_Gemini breakpoint's blog-CSDN blog

Guess you like

Origin blog.csdn.net/qq_37529913/article/details/132705090