├── cap.png ├── style.qss ├── mainwindow.h ├── icons ├── App_2.png ├── app.png ├── close.png ├── maxsize.png ├── minium.png └── normal.png ├── mainwindow.cpp ├── README.md ├── main.cpp ├── style.qrc ├── QtFrameLess.pro ├── LICENSE └── mainwindow.ui /cap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/cap.png -------------------------------------------------------------------------------- /style.qss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/style.qss -------------------------------------------------------------------------------- /mainwindow.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/mainwindow.h -------------------------------------------------------------------------------- /icons/App_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/App_2.png -------------------------------------------------------------------------------- /icons/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/app.png -------------------------------------------------------------------------------- /icons/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/close.png -------------------------------------------------------------------------------- /mainwindow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/mainwindow.cpp -------------------------------------------------------------------------------- /icons/maxsize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/maxsize.png -------------------------------------------------------------------------------- /icons/minium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/minium.png -------------------------------------------------------------------------------- /icons/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FLCYR/QtFrameless/HEAD/icons/normal.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QtFrameless 2 | Qt 无边框窗口(QtFrameless)的实现,简单明了,不复杂,适合大部分情况使用. 3 | #效果如下 4 | ![frameless](https://github.com/FLCYR/QtFrameless/blob/master/cap.png) 5 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.setWindowIcon(QIcon(":/icons/App_2.png")); 10 | w.show(); 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /style.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/maxsize.png 4 | icons/minium.png 5 | style.qss 6 | icons/close.png 7 | icons/app.png 8 | icons/normal.png 9 | icons/App_2.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /QtFrameLess.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | QT +=network 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | 8 | # You can make your code fail to compile if it uses deprecated APIs. 9 | # In order to do so, uncomment the following line. 10 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 11 | 12 | SOURCES += \ 13 | main.cpp \ 14 | mainwindow.cpp 15 | 16 | HEADERS += \ 17 | mainwindow.h 18 | 19 | FORMS += \ 20 | mainwindow.ui 21 | 22 | # Default rules for deployment. 23 | qnx: target.path = /tmp/$${TARGET}/bin 24 | else: unix:!android: target.path = /opt/$${TARGET}/bin 25 | !isEmpty(target.path): INSTALLS += target 26 | 27 | RESOURCES += \ 28 | style.qrc 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 FL 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 960 10 | 661 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 0 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 0 39 | 40 | 41 | 42 | 43 | 0 44 | 40 45 | 46 | 47 | 48 | 49 | 0 50 | 51 | 52 | 5 53 | 54 | 55 | 0 56 | 57 | 58 | 0 59 | 60 | 61 | 0 62 | 63 | 64 | 65 | 66 | 0 67 | 68 | 69 | 70 | 71 | 6 72 | 73 | 74 | 0 75 | 76 | 77 | 0 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | :/icons/app.png 86 | 87 | 88 | false 89 | 90 | 91 | 92 | 93 | 94 | 95 | FrameWin 96 | 97 | 98 | Qt::AutoText 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Qt::Horizontal 108 | 109 | 110 | 111 | 40 112 | 20 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 0 121 | 122 | 123 | 15 124 | 125 | 126 | 127 | 128 | 129 | 32 130 | 32 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | Qt::Horizontal 142 | 143 | 144 | QSizePolicy::Fixed 145 | 146 | 147 | 148 | 18 149 | 20 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 32 159 | 32 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | Qt::Horizontal 171 | 172 | 173 | QSizePolicy::Fixed 174 | 175 | 176 | 177 | 18 178 | 20 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 32 188 | 32 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | Qt::Vertical 207 | 208 | 209 | 210 | 20 211 | 561 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 0 222 | 0 223 | 960 224 | 26 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | --------------------------------------------------------------------------------