Qt Quick 與 QML(三)qml中的基礎控件

基礎控件

控件名稱??功能描述??示例代碼?
?Rectangle?基礎繪圖控件,創建矩形區域Rectangle {width: 100; height: 100<br> color: "red"; radius: 5}
?Text/Label?文本顯示控件Text {text: "Hello World";<br> font.pixelSize: 24}
?Button?交互按鈕控件Button {text: "提交"; onClicked: console.log("點擊")}
?CheckBox?多選框控件CheckBox {text: "同意協議"; checked: true}
?RadioButton?單選按鈕控件RadioButton {text: "男"; ButtonGroup.group: genderGroup}
?TextField?單行文本輸入框TextField {placeholderText: "用戶名";maximumLength: 20}
?TextArea?多行文本輸入框qml<br>TextArea {<br> text: "多行文本...";<br> wrapMode: Text.Wrap<br>}
?ComboBox?下拉選擇框qml<br>ComboBox {<br> model: ["選項1", "選項2"]<br> currentIndex: 0<br>}
?Slider?滑動條控件qml<br>Slider {<br> from: 0; to: 100;<br> value: 50<br>}
?ProgressBar?進度條控件qml<br>ProgressBar {<br> value: 75;<br> to: 100<br>}
?Image?圖片顯示控件qml<br>Image {<br> source: "logo.png";<br> fillMode: Image.PreserveAspectFit<br>}
?Switch?開關切換控件qml<br>Switch {<br> checked: true;<br> onCheckedChanged: console.log(checked)<br>}
?Delegate系列?列表項專用控件qml<br>ListView {<br> delegate: SwitchDelegate {<br> text: "選項"<br> }<br>}

Rectangle

屬性及方法說明:

屬性/方法??類型??功能描述??示例代碼?
?antialiasing?bool控制抗鋸齒效果,默認開啟(若設置radius則強制開啟)Rectangle {antialiasing: false // 關閉抗鋸齒}
?border?group邊框屬性組,包含顏色和寬度Rectangle {border { color: "red"; width: 2 }}
?border.color?color設置邊框顏色(支持十六進制/RGB/顏色名)border.color: "#FF0000"
?border.width?int設置邊框寬度(單位為像素,0表示無邊框)border.width: 5
?color?color設置矩形填充色(與gradient互斥,后者優先級更高)color: "lightblue"
?gradient?Gradient定義漸變填充(需配合GradientStop使用)gradient: Gradient {GradientStop { position:0; color:"white" } GradientStop { position:1; color:"black" }}
?radius?real設置圓角半徑(可統一設置或分角設置)radius: height/4 // 動態圓角// 或分角設置:topLeftRadius: 10; bottomRightRadius: 5
?clip?bool控制是否裁剪超出矩形范圍的子內容(默認falseclip: true // 啟用裁剪
?contains(point)?method判斷點是否在矩形內(參數為point對象)if(rect.contains(Qt.point(10,10))) { ... }

代碼示例:

Rectangle {id: rectwidth: 200; height: 100color: "transparent"antialiasing: trueborder { color: "green"; width: 3 }radius: 10gradient: Gradient { //漸變GradientStop { position:0; color:"yellow" }GradientStop { position:1; color:"orange" }}// 方法調用示例Component.onCompleted: console.log(rect.contains(Qt.point(50,50)))}

Text

屬性及方法說明:

屬性/方法??類型??功能描述??示例代碼?
?advance?size只讀屬性,返回字符基線間距(Qt 5.10+引入)Text { text: "ABC"; onPainted: console.log(advance) }
?antialiasing?bool抗鋸齒開關(僅Text.NativeRendering渲染類型可禁用)Text { text: "Hi"; antialiasing: false }
?baseUrl?url設置相對URL的基礎路徑(用于富文本中的資源引用)Text { text: "<img src='icon.png'>"; baseUrl: "qrc:/assets" }
?clip?bool超出文本區域的內容裁剪(默認falseText { width:50; text:"LongText"; clip:true }
?color?color文本顏色(支持十六進制/RGB/顏色名)Text { text:"Red"; color:"#FF0000" }
?contentHeight?real只讀屬性,返回文本實際高度(含換行)Text { text:"Multi\nLine"; onPainted: console.log(contentHeight) }
?elide?enum文本省略方式(ElideLeft/Right/MiddleText { width:80; text:"LongText"; elide:Text.ElideRight }
font.bold?bool控制字體加粗狀態(true啟用粗體)Text { text:"Bold"; font.bold:true }
?font.capitalization?enum文本大小寫轉換(支持AllUppercase/SmallCaps等模式)Text { text:"hello"; font.capitalization:Font.AllUppercase }
?font.family?string設置字體系列(如"Arial")Text { text:"Custom"; font.family:"Microsoft YaHei" }
?font.hintingPreference?enum字體微調策略(PreferNone/PreferVerticalHinting等)Text { text:"Hint"; font.hintingPreference:Font.PreferFullHinting }
?font.italic?bool控制斜體顯示Text { text:"Italic"; font.italic:true }
?font.kerning?bool啟用/禁用字符間距自動調整(默認trueText { text:"Kerning"; font.kerning:false }
?font.letterSpacing?real字符間距(單位像素,可負值)Text { text:"Spaced"; font.letterSpacing:1.5 }
?font.pixelSize?int字體像素大小(與pointSize互斥,優先級更高)Text { text:"Size24"; font.pixelSize:24 }
?font.pointSize?real字體磅值大小(1磅=1/72英寸)Text { text:"Point12"; font.pointSize:12 }
?font.preferShaping?bool啟用復雜文字排版(如阿拉伯語連字)Text { text:"????"; font.preferShaping:true }
?font.strikeout?bool添加刪除線Text { text:"Delete"; font.strikeout:true }
?font.styleName?string指定字體變體(如"Light Condensed")Text { text:"Style"; font.styleName:"Semibold Italic" }
?font.underline?bool添加下劃線Text { text:"Underline"; font.underline:true }
?font.weight?enum字體粗細(Font.ThinFont.Black共9級)Text { text:"Weight"; font.weight:Font.Bold }
?font.wordSpacing?real單詞間距(單位像素)Text { text:"Word Space"; font.wordSpacing:5 }
?horizontalAlignment?enum水平對齊(Text.AlignLeft/Right/HCenterText { width:200; text:"Center"; horizontalAlignment:Text.AlignHCenter }
?lineHeight?real行高倍數(需配合lineHeightMode使用)Text { text:"Line\nHeight"; lineHeight:1.5; lineHeightMode:Text.ProportionalHeight }
?renderType?enum渲染引擎類型(Text.QtRendering/NativeRenderingText { text:"Native"; renderType:Text.NativeRendering }
?textFormat?enum文本格式(PlainText/RichText/AutoTextText { text:"<b>Bold</b>"; textFormat:Text.RichText }
?wrapMode?enum換行模式(NoWrap/WordWrap/WrapAnywhereText { width:100; text:"LongWord"; wrapMode:Text.WrapAnywhere }

代碼示例:

    Text {text: "測試文本 Text"x: 200; y: 0font {family: "Arial"  //字體italic: true  //斜體letterSpacing: 1.2  //字符間距underline: true  //下劃線pixelSize: 16  //字體像素大小weight: Font.Medium //字體粗細}}

Label

?屬性及方法說明:

屬性??類型??功能描述??示例代碼?
?background?Item背景組件(可自定義矩形/圖像等)Label { background: Rectangle { color:"lightgray" } }
?bottomInset?real底部內容插入距離(與bottomPadding配合使用)Label { text:"Text"; bottomInset:5 }
?implicitBackgroundHeight?real背景隱式高度(只讀,根據內容自動計算)Label.onImplicitBackgroundHeightChanged: console.log(implicitBackgroundHeight)
?implicitBackgroundWidth?real背景隱式寬度(只讀)Label.onImplicitBackgroundWidthChanged: console.log(implicitBackgroundWidth)
?leftInset?real左側內容插入距離Label { text:"Text"; leftInset:10 }
?palette?palette調色板配置(控制顏色主題)Label { palette.windowText:"red" }
?rightInset?real右側內容插入距離Label { text:"Text"; rightInset:10 }
?topInset?real頂部內容插入距離Label { text:"Text"; topInset:5 }

代碼示例:

    Label {x: 400width: 200; height: 100text: "測試文本 Label"leftInset: 15rightInset: 15topInset: 8bottomInset: 8//支持任意Item類型作為背景元素background: Image {source: "file:///home/li/圖片/1.png"  //臨時方案 正是qrc:/images/1.png 要確保.qrc文件中有對應條目images/1.png//opacity: 0.5}}

?Button?

核心屬性

屬性??類型??功能描述??示例代碼?
?text?string按鈕顯示的文本內容Button { text: "提交" }
?enabled?bool控制按鈕是否可交互(默認true)Button { enabled: false }
?autoRepeat?bool長按時是否重復觸發信號(默認false)Button { autoRepeat: true }
?icon.source?url按鈕圖標路徑Button { icon.source: "qrc:/save.png" }
?background?Item自定義背景元素Button { background: Rectangle { color: "blue" } }
?font.pixelSize?int文本字體大小Button { font.pixelSize: 16 }
?hoverEnabled?bool是否啟用懸停效果(默認true)Button { hoverEnabled: false }
?checkable?bool是否支持切換狀態(類似開關)Button { checkable: true }
?checked?bool當前選中狀態(需checkable=true)Button { checked: true }
?flat?bool是否無邊框扁平化樣式Button { flat: true }

信號/方法

信號/方法??觸發條件??示例代碼?
?onClicked?點擊按鈕時觸發Button { onClicked: console.log("點擊") }
?onPressed?按下鼠標時觸發Button { onPressed: status.text="按下" }
?onReleased?釋放鼠標時觸發Button { onReleased: status.text="" }
?onDoubleClicked?雙擊按鈕時觸發Button { onDoubleClicked: zoomImage() }
?onPressAndHold?長按超過800ms時觸發Button { onPressAndHold: showMenu() }
?toggle()?切換checkable按鈕狀態(編程控制)Button { id: btn; onClicked: btn.toggle() }

代碼示例:

    Button {x: 0; y: 110text: "漸變按鈕"background: Rectangle {radius: 8color: parent.down ? "#4CAF50" : (parent.hovered ? "#8BC34A" : "#CDDC39")border.color: parent.pressed ? "#2196F3" : "transparent"Behavior on color { ColorAnimation { duration: 100 } }Behavior on border.color { ColorAnimation { duration: 200 } }}contentItem: Text {text: parent.textcolor: "white"font.bold: true}onClicked: console.log("點擊事件觸發")onPressed: console.log("按下狀態")onReleased: console.log("釋放狀態")}

?CheckBox?

核心屬性

屬性類型說明示例代碼
checkedbool當前選中狀態(二態模式)checked: true // 默認選中
checkStateenumeration三態模式狀態(Qt.Unchecked/Checked/PartiallyChecked)checkState: Qt.PartiallyChecked
tristatebool是否啟用三態模式(默認false)tristate: true // 啟用部分選中狀態
textstring顯示的文本標簽text: "啟用功能"
indicatorItem勾選框的視覺元素indicator.width: 20 // 調整勾選框大小
nextCheckStatefunction自定義狀態切換邏輯見下方代碼示例

關鍵方法/信號

方法/信號說明觸發條件示例代碼
toggled(checked)二態模式狀態變化信號選中狀態改變時觸發onToggled: console.log(checked)
clicked()點擊事件信號用戶點擊時觸發onClicked: console.log("點擊")
checkStateChanged()三態模式狀態變化信號三態值改變時觸發onCheckStateChanged: console.log(checkState)

代碼示例:

    CheckBox {id: chkx: 200; y: 110text: "高級選項"tristate: truecheckState: Qt.PartiallyCheckednextCheckState: function() {if (checkState === Qt.Unchecked)return Qt.PartiallyCheckedelse if (checkState === Qt.PartiallyChecked)return Qt.Checkedelsereturn Qt.Unchecked}onCheckStateChanged: {console.log("當前狀態:",checkState === Qt.Unchecked ? "未選中" :checkState === Qt.Checked ? "全選" : "部分選中")}}

?RadioButton?

核心屬性

屬性類型說明示例代碼
checkedbool當前選中狀態checked: true // 默認選中
textstring顯示文本標簽text: "選項A"
exclusiveGroupExclusiveGroup互斥分組對象exclusiveGroup: tabGroup
indicatorItem單選按鈕的視覺元素indicator.width: 20
autoExclusivebool是否自動互斥(默認true)autoExclusive: false // 禁用自動互斥

方法/信號

方法/信號說明示例代碼
clicked()點擊事件信號onClicked: console.log("選中狀態:", checked)
toggled(checked)狀態變化信號onToggled: label.text = checked ? "已選" : "未選"

代碼示例:

// 互斥分組演示ButtonGroup {id: radioGroupexclusive: true  // 默認true可不寫onCheckedButtonChanged: {console.log("當前選擇:", checkedButton.text)}}RadioButton {id: radio1x: 400; y: 110text: "選項A"ButtonGroup.group: radioGroup  // 分組控制onClicked: if(checked) text = "選項A(已選)"  // 點擊信號}RadioButton {x: 400; y: 150text: "選項B"ButtonGroup.group: radioGrouponCheckedChanged: {  // 狀態變化信號if(checked){ console.log("選項B"); radio1.text = "選項A"}}}

??TextField?

核心屬性,方法,信號

類別??屬性/方法??說明??示例?
?核心屬性?text存儲當前文本內容TextField { text: "默認文本" }
placeholderText空白時的提示文字placeholderText: "請輸入用戶名"
echoMode文本顯示模式(密碼/普通)echoMode: TextInput.Password
?外觀控制?font.pixelSize字體大小font { pixelSize: 16 }
color文本顏色color: "#333333"
background自定義背景樣式background: Rectangle { radius: 5 }
?輸入限制?maximumLength最大輸入長度maximumLength: 10
validator輸入驗證器validator: IntValidator { top: 100 }
inputMask輸入格式掩碼inputMask: "999.999.999"
?交互控制?readOnly只讀模式readOnly: true
selectByMouse允許鼠標選擇文本selectByMouse: true
?信號?onTextChanged文本變化時觸發onTextChanged: console.log(text)
onAccepted按下回車時觸發onAccepted: submit()
?方法?clear()清空文本button.onClicked: textField.clear()
selectAll()全選文本onFocusChanged: if(focus) selectAll()
copy()/paste()剪貼板操作onDoubleClicked: copy()

代碼示例

    TextField {id: demoFieldwidth: 200x: 0; y: 210placeholderText: "輸入數字(1-100)"validator: IntValidator { bottom: 1; top: 100 }onAccepted: console.log("提交:", text)background: Rectangle {border.color: demoField.focus ? "blue" : "gray"radius: 5}}

?TextArea?

核心屬性,方法,信號

類別??屬性/方法??類型/返回值??說明??示例?
?基礎屬性?textstring存儲的文本內容text: "默認內容"
placeholderTextstring空白時的灰色提示文本placeholderText: "輸入描述..."
textFormatenum (AutoText/RichText/PlainText)文本格式(支持富文本)textFormat: TextEdit.RichText
?外觀控制?fontgroup字體屬性(family/pixelSize等)font { family: "Arial"; pixelSize: 14 }
colorcolor文本顏色color: "#333"
backgroundItem自定義背景項background: Rectangle { radius: 5 }
?滾動與布局?wrapModeenum (NoWrap/WordWrap)換行模式wrapMode: TextArea.WordWrap
contentWidth/contentHeightreal文本內容實際尺寸width: Math.max(200, contentWidth)
flickable (附屬屬性)Flickable滾動容器關聯屬性ScrollView { TextArea { ... } }
?交互控制?readOnlybool只讀模式readOnly: true
selectByMousebool允許鼠標選擇文本selectByMouse: true
cursorPositionint光標位置onClicked: cursorPosition =
?信號?onTextChangedsignal文本變化時觸發onTextChanged: console.log(text)
onLinkActivatedsignal(link)點擊富文本鏈接時觸發onLinkActivated: Qt.openUrlExternally(link)
?方法?copy()void復制選中文本button.onClicked: textArea.copy()
paste()void粘貼剪貼板內容onPressed: paste()
selectAll()void全選文本onFocusChanged: selectAll()
deselect()void取消選擇onEditingFinished: deselect()

代碼示例:

    TextArea {id: areax: 200; y: 210placeholderText: "支持富文本+自動滾動"textFormat: TextEdit.RichTextwrapMode: TextArea.WrapselectByMouse: truebackground: Rectangle {border.color: area.activeFocus ? "blue" : "gray"radius: 5}onLinkActivated: Qt.openUrlExternally(link)}

?ComboBox?

核心屬性,方法,信號

類別??屬性/方法??類型/返回值??說明??示例?
?核心屬性?modelvariant數據模型(數組/ListModel/整數)model: ["A", "B", "C"]
currentIndexint當前選中項索引(-1表示未選中)currentIndex: 1
currentTextstring當前選中項文本onActivated: console.log(currentText)
textRolestring指定模型中的文本角色名(需與模型角色嚴格匹配)textRole: "text"
?交互控制?editablebool是否允許編輯輸入editable: true
displayTextstring控件顯示文本(可自定義格式)displayText: "已選: " + currentText
popupPopup彈出窗口控制屬性popup.width: 300
?外觀定制?delegateComponent自定義選項項樣式見下方完整示例
indicatorComponent下拉箭頭圖標indicator: Image { source: "arrow.png" }
backgroundComponent背景樣式background: Rectangle { radius: 5 }
?信號?onActivated(int index)signal選項被選中時觸發onActivated: console.log(index)
onAccepted()signal編輯模式下回車確認時觸發onAccepted: addItem(editText)
?方法?find(string text)int查找文本對應的索引find("Apple")
textAt(int index)string獲取指定索引的文本textAt(0) // 返回"A"
selectAll()void全選編輯框文本onEditingFinished: selectAll()

代碼示例:

    ComboBox {id: combowidth: 200x: 400; y: 210editable: truetextRole: "text"model: ListModel {ListElement { text: "Apple"; color: "red" }ListElement { text: "Banana"; color: "yellow" }}delegate: ItemDelegate {width: parent.widthcontentItem: Text {text: model.textcolor: model.colorfont.bold: combo.currentIndex === index}}onAccepted: if (find(editText) === -1) model.append({text: editText})}

?Slider?

核心屬性,方法,信號

類別??屬性/方法??類型/返回值??說明??示例?
?核心屬性?fromreal滑塊最小值 (默認0.0)from: -100
toreal滑塊最大值 (默認1.0)to: 200
valuereal當前值 (介于from/to之間)value: 50
stepSizereal步長 (0表示連續滑動)stepSize: 5
orientationenum方向 (Qt.Horizontal/Qt.Vertical)orientation: Qt.Vertical
?交互控制?livebool拖動時是否實時更新value (默認true)live: false
snapModeenum吸附模式 (Slider.NoSnap/SnapOnRelease/SnapAlways)snapMode: Slider.SnapAlways
pressedbool只讀,表示滑塊是否被按下onPressedChanged: console.log(pressed)
positionreal只讀,邏輯位置 (0.0-1.0)Text { text: (position*100).toFixed(0) + "%" }
?樣式屬性?backgroundComponent滑槽背景組件見下方自定義示例
handleComponent滑塊手柄組件見下方自定義示例
?方法?increase()void按stepSize增加valueButton { onClicked: slider.increase() }
decrease()void按stepSize減少valueButton { onClicked: slider.decrease() }
valueAt(real pos)real根據位置比例返回對應值slider.valueAt(0.5) 返回中間值
?信號?moved()-滑塊位置改變時觸發onMoved: console.log("滑塊移動中")
valueChanged()-value屬性改變時觸發onValueChanged: model.rotation = value

未完待續。。。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/85188.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/85188.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/85188.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Redis實現消息隊列全解析:從基礎到高級應用實戰

目錄 一、Redis作為消息隊列的優勢與局限 1.1 核心優勢 1.2 適用場景 1.3 局限性及解決方案 二、Redis消息隊列實現方案對比 三、List實現基礎消息隊列 3.1 生產者實現原理 3.2 消費者實現原理 3.3 可靠性增強&#xff1a;ACK機制 四、Pub/Sub實現發布訂閱 4.1 消息發…

Windows應用商店中的國學啟蒙教育應用

國學啟蒙是中國傳統文化教育的重要組成部分&#xff0c;主要以經典誦讀、傳統禮儀、歷史故事等內容為載體&#xff0c;向兒童傳遞中華文化的核心價值觀。幫助孩子建立文化認同感&#xff0c;培養良好的道德觀念和行為習慣。通過學習古代圣賢的言行&#xff0c;兒童可以初步理解…

安科瑞UL認證ADL3000-E/C導軌表:工商業儲能領域的智能之選

一、產品簡介 ADL3000-E/C是安科瑞針對電力系統、工礦企業、公用設施的電力監控及能耗統計、管理需求而精心設計的一款智能儀表。該電能表具有精度高、體積小、安裝方便等顯著優點&#xff0c;為工商業儲能系統的智能化管理提供了強有力的技術支持。 功能特性 測量與計量功能…

條件向量運算與三元表達式

在工程計算和數學建模中&#xff0c;我們經常需要根據條件動態選擇不同的向量運算方式。這種需求在動力學系統、控制理論和計算機圖形學中尤為常見。本文將探討如何通過 Python 的三元表達式結合 SymPy 符號計算庫&#xff0c;實現條件向量運算的高效解決方案。 我們從定義兩…

文檔開發組件Aspose旗下熱門產品優勢及應用場景介紹

?Aspose 是什么&#xff1f; Aspose 是全球領先的文檔處理組件廠商&#xff0c;主打一個字&#xff1a;全。 &#x1f4cc; 支持超 100 種文檔/圖像格式 &#x1f4cc; 覆蓋 Word、Excel、PDF、PPT、OCR、BarCode、Email 等模塊 &#x1f4cc; 支持 .NET、Java、Python、C、N…

龍虎榜——20250618

上證指數縮量長下影小陽線&#xff0c;個股下跌超3300只&#xff0c;總體護盤的板塊表現相對更好。 深證指數縮量收小陽線&#xff0c;橫盤震蕩已有4天&#xff0c;等待方向選擇。 2025年6月18日龍虎榜行業方向分析 1. 半導體 代表標的&#xff1a;滬電股份&#xff08;高階P…

layui和vue父子級頁面及操作

最近在老項目里面添加一些頁面&#xff0c;項目太老只能在原有的項目基礎和插件上添加代碼 html //表格 <table id"dataTable"><thead><tr><th>序號</th><th>名稱</th><th></th></tr></th…

Houdini 節點使用方法

Houdini 的節點系統是其程序化建模和特效制作的核心功能之一&#xff0c;通過節點網絡實現程序化建模、特效制作、動力學模擬等復雜任務。掌握節點使用方法是高效創作的關鍵&#xff0c;以下是圍繞用戶需求的 全面、深入且結構化 的節點使用指南 一、節點基礎操作 1. 創建與連…

license授權文件說明

license管理 1.使用場景 系統將自動檢測license信息是否過期 - license過去前一個月&#xff0c;會顯示warning&#xff1a;license file will expire in 30 days - 當license過去&#xff0c;會顯示license file expired#注意 1. 數據庫重啟時才會啟動 License 授權期限校驗…

C++11中alignof和alignas的入門到精通指南

文章目錄 一、引言二、內存對齊的概念和作用2.1 什么是內存對齊2.2 內存對齊的優勢 三、alignof運算符3.1 定義和作用3.2 語法規則3.3 使用示例3.4 注意事項 四、alignas說明符4.1 定義和作用4.2 語法規則4.3 使用示例4.4 注意事項 五、alignof和alignas的結合使用六、實際應用…

防爆+高性能!ABB 防爆伺服電機HY系列守護安全生產

在石油、化工、火工等高風險行業中&#xff0c;如何在易燃易爆環境中確保設備安全穩定運行&#xff0c;同時兼顧高性能&#xff1f;ABB防爆伺服電機HY系列給出了完美答案&#xff01; 專為爆炸性環境設計&#xff0c;安全與性能兼得 ABB HY系列基于先進的HDS伺服平臺打造&…

洪千武—華為海外HRBP

我的個人介紹 辰熙咨詢創始人&CEO 2005年入職華為人力資源管理部 華為海外首批HRBP推動者、華為TUP股權激勵實戰顧問 華為IBM項目組成員、華為海外代表處AT成員 著有《OKR管理法則》、《力出一孔》 2005年以HR英文專才&#xff0c;從香港著名咨詢公司被獵聘到華為人力…

測試:網絡協議超級詳解

??親愛的技術愛好者們,熱烈歡迎來到 Kant2048 的博客!我是 Thomas Kant,很開心能在CSDN上與你們相遇~?? 本博客的精華專欄: 【自動化測試】 【測試經驗】 【人工智能】 【Python】 </

游戲技能編輯器界面優化設計

界面布局重構 詳細界面布局 ---------------------------------------------------------- | 頂部工具欄 [保存] [加載] [撤銷] [重做] [測試] [設置] | --------------------------------------------------------- | 資源管理 | | 屬性編…

【java中使用stream處理list數據提取其中的某個字段,并由List<String>轉為List<Long>】

你當前的代碼是這樣的&#xff1a; List<String> gongkuangIds gongkuangBoundList.stream().filter(obj -> obj.getBoundValue() ! null).map(PlanSchemeProductionBoundInfo::getBoundValue).distinct().collect(Collectors.toList());這段代碼從 gongkuangBoundL…

《前端面試題:JS數組去重》

JavaScript數組去重終極指南&#xff1a;從基礎到高級的多種方法&#xff08;附面試題解析&#xff09; 在前端開發中&#xff0c;數組去重是JavaScript中最常見的需求之一。本文將全面解析8種數組去重方法&#xff0c;包括基礎實現、ES6新特性、性能優化等&#xff0c;并附上…

基于51單片機的智能小車:按鍵調速、障礙跟蹤、紅外循跡與數碼管顯示(一個合格的單片機課設)

引言 在嵌入式系統領域&#xff0c;51單片機因其簡單易用、成本低廉的特點&#xff0c;一直是入門學習的理想平臺。今天我將分享一個基于51單片機的多功能智能小車項目&#xff0c;它集成了按鍵PWM調速、障礙物跟蹤、紅外循跡和數碼管顯示四大功能。這個項目不僅涵蓋了嵌入式開…

Java異常處理(try-catch-finally):像醫生一樣處理程序的“感冒”

&#x1f525;「炎碼工坊」技術彈藥已裝填&#xff01; 點擊關注 → 解鎖工業級干貨【工具實測|項目避坑|源碼燃燒指南】 一、從一個真實問題開始&#xff1a;為什么需要異常處理&#xff1f; 假設你正在開發一個文件讀取工具&#xff0c;用戶輸入文件名后&#xff0c;程序會讀…

PostgreSQL 數據庫故障與性能高效實時監測技術深度解析

關鍵詞&#xff1a; postgresql 故障與性能監控 &#x1f4d1; 文章目錄 1. 引言與監控重要性 2. PostgreSQL監控體系架構 3. 故障監控核心技術 4. 性能監控關鍵指標 5. 實時監測技術實現 6. 監控工具選型與部署 7. 故障預警與自動化響應 8. 性能調優監控策略 9. 最佳…

logrotate 踩坑

我的logrotate配置&#xff0c;原本運行正常&#xff0c;最近幾天發現輪轉失敗&#xff0c;兩個目錄下的日志全部無法輪轉&#xff0c;于是開始排查問題 /data01/logs/test1/*.log /data01/logs/test2/*.log {missingokrotate 1notifemptycreate 0644 www-data admsharedscrip…