QML設計登陸介面

2021-09-20 18:34:59 字數 2963 閱讀 2588

qml設計登陸介面

環境:

主機:win7

開發環境:qt5.2

說明:

用qml設計乙個應用的登陸介面

效果圖:

源**:

main.qml

import qtquick 2.0rectangle    //背景    image            anchors.fill: parent        source: "pics/pic1.png"        fillmode: image.preserveaspectcrop    }    //頂爛    item                text: "登陸"            font.bold: true            font.pointsize: login_gui.height * 0.05 * 0.7            color: "dark red"        }    }    //空白欄    item        //登陸框    rectangle            border.color: "#707070"        color: "transparent"        lineinput                    hint: "請輸入使用者號"        }        lineinput                    hint: "請輸入密碼"        }        button                    text: "登陸"

//onclicked: samegame.startnewgame()        }        button                    text: "退出"

//onclicked: samegame.startnewgame()        }    }}

button.qml

import qtquick 2.0rectangle     antialiasing: true    radius: 8

// color the button with a gradient    gradient: gradient         }        gradientstop     }    mousearea     text }

lineinput.qmlqml設計登陸介面

環境:

主機:win7

開發環境:qt5.2

說明:

用qml設計乙個應用的登陸介面

效果圖:

源**:

main.qml

import qtquick 2.0rectangle    //背景    image            anchors.fill: parent        source: "pics/pic1.png"        fillmode: image.preserveaspectcrop    }    //頂爛    item                text: "登陸"            font.bold: true            font.pointsize: login_gui.height * 0.05 * 0.7            color: "dark red"        }    }    //空白欄    item        //登陸框    rectangle            border.color: "#707070"        color: "transparent"        lineinput                    hint: "請輸入使用者號"        }        lineinput                    hint: "請輸入密碼"        }        button                    text: "登陸"

//onclicked: samegame.startnewgame()        }        button                    text: "退出"

//onclicked: samegame.startnewgame()        }    }}

button.qml

import qtquick 2.0rectangle     antialiasing: true    radius: 8

// color the button with a gradient    gradient: gradient         }        gradientstop     }    mousearea     text }

lineinput.qml

C 登陸介面

在c 中從登陸介面進入主介面,進入主介面以後怎麼關閉登陸介面 有很多方法,我就說兩種 方法一 在登入介面的登入按鈕的單擊事件下,寫 這種情況其實把主介面看作登入介面的子窗體。只是把登入介面隱藏,它還存在於記憶體中,不過一般登入介面很小,不佔多少資源,也無所謂。private void btnlogi...

WPF 登陸介面

效果圖 黑色是我的桌面 圓角登入框 以下基於wpf。一開始最先要的效果就是圓角窗體,單純出於美觀的心態,但是人是不滿足的,改了一點就像再有一點。哈哈哈 更改預設 其實就是將原有的窗體變隱藏,然後搞乙個新的出來。windowstyle none allowstransparency true back...

登陸介面by VUE elementUI

過來一遍vue基礎於是想嘗試先寫乙個登陸介面先做準備,為後面的學習開個頭,ui元件選用的是elementui。login style display flex justify content center login1 style text align center position absolut...