1

Topic: To install color for title MainWindow - a C ++ Qt

Good afternoon, Misters programmers. Faced the task to change color Title at QMainWindow. The text in title changes elementarily, and here color not so. Found in the Internet a unique method where the window corresponds and itself title thus disappears, and instead of it it is drawn new, but it would be desirable somehow more is easier through styleSheet or something another. I will be glad to any help!

2

Re: To install color for title MainWindow - a C ++ Qt

Hello, TOPAZ23, you wrote: TOP> Good afternoon, Misters programmers. Faced the task to change color Title at QMainWindow. The text in title changes elementarily, and here color not so. Found in the Internet a unique method where the window corresponds and itself title thus disappears, and instead of it it is drawn new, but it would be desirable somehow more is easier through styleSheet or something another. I will be glad to any help! The friend, title is drawn by the system (OS). To you correctly advised.

3

Re: To install color for title MainWindow - a C ++ Qt

Hello, TOPAZ23, you wrote: TOP> Good afternoon, Misters programmers. Faced the task to change color Title at QMainWindow. The text in title changes elementarily, and here color not so. Found in the Internet a unique method where the window corresponds and itself title thus disappears, and instead of it it is drawn new, but it would be desirable somehow more is easier through styleSheet or something another. I will be glad to any help! It is possible to dig here: http://doc.qt.io/qt-5/qtwin.html

4

Re: To install color for title MainWindow - a C ++ Qt

Hello, Qt-Coder, you wrote: QC> the Friend, title is drawn by the system (OS). To you correctly advised. I will add that if to do private decisions for specific OS I do not know as for other systems, but in Windows it is difficult. It is necessary to process WM_NCPAINT, thus most to draw Window Frame, Window Title, and all buttons in title, and in the correct state for what other WM_NCxxx messages should be processed.

5

Re: To install color for title MainWindow - a C ++ Qt

Hello, TOPAZ23, you wrote: TOP> Good afternoon, Misters programmers. Faced the task to change color Title at QMainWindow. The text in title changes elementarily, and here color not so. Found in the Internet a unique method where the window corresponds and itself title thus disappears, and instead of it it is drawn new, but it would be desirable somehow more is easier through styleSheet or something another. I will be glad to any help! Do  a window and itself draw necessary title on the core. I to myself so made, truth with little changes in most Qt Where that in a month I will let out new release, it will be possible to look. A unique counter which I yet did not implement it when in 10-ke to bring a window to the upper edge of the monitor it swings open on all screen. In photoshop for example so it is made, and at them UI too like on Qt. Though it is not eliminated that they title so draw.

6

Re: To install color for title MainWindow - a C ++ Qt

Hello, nen777w, you wrote: N> In photoshop for example so it is made, and at them UI too like on Qt. Not, there not Qt. At Adoby  .

7

Re: To install color for title MainWindow - a C ++ Qt

Hello, nen777w, you wrote: N>... N> the Unique counter which I yet did not implement it when in 10-ke to bring a window to the upper edge of the monitor it swings open on all screen. N> in photoshop for example so it is made, and at them UI too like on Qt. Though it is not eliminated that they title so draw. At  in  the such is made. Truth it is not assured on what (there alternately  and QtQuick). By the way, they even QML , which in resources .

8

Re: To install color for title MainWindow - a C ++ Qt

Hello, nen777w, you wrote: N> it when in 10-ke to bring a window to the upper edge of the monitor it swings open on all screen. Generally, it on-default so conducts itself, if the sizes tightly are not fixed, certainly. In 7th Windows too as works. https://forum.qt.io/topic/55380/solved- … reen-edges

9

Re: To install color for title MainWindow - a C ++ Qt

Hello, XOOIOOX, you wrote: Something here such : https://github.com/deimos1877/BorderlessWindow Yes, here unpleasant WinAPI, but type it is possible to take and .

10

Re: To install color for title MainWindow - a C ++ Qt

Hello, XOOIOOX, you wrote: Can and not absolutely in a subject it turns out, time about KuVidzhety initially was a question, but it was possible to achieve demanded on QML. Almost as at Blizov. Without WinAPI and other heresy. In main.cpp it is standard: int main (int argc, char *argv []) {QGuiApplication app (argc, argv); QQmlApplicationEngine engine; engine.load (QUrl (QLatin1String ("qrc:/test1.qml")));//we load from resources return app.exec ();} Corresponding QML: import QtQuick 2.7 import QtQuick. Controls 2.2 import QtQuick. Window 2.0 ApplicationWindow {flags: Qt. Window | Qt. FramelessWindowHint id: applicationWindow visible: true width: 640 height: 480 MouseArea {id: titleBarMouse property real lastMouseX: 0 property real lastMouseY: 0 height: 38 anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top enabled: true onPressed: {lastMouseX = mouseX lastMouseY = mouseY} onMouseXChanged: applicationWindow.x + = (mouseX - lastMouseX) onMouseYChanged: applicationWindow.y + = (mouseY - lastMouseY)} Rectangle {id: titleBarRectArea height: 38 anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top transformOrigin: Item. TopLeft gradient: Gradient {GradientStop {position: 0 color: "#80f4be66"} GradientStop {position: 1 color: "#99d7f669"}} opacity: 1} Text {id: caption height: 38 color:" #f05454 "text: qsTr (" Type the test ") anchors.right: parent.right anchors.rightMargin: 0 clip: true styleColor:" #00000000 "leftPadding: 20 verticalAlignment: Text. AlignVCenter anchors.left: parent.left anchors.leftMargin: 0 anchors.top: parent.top anchors.topMargin: 0 transformOrigin: Item. TopLeft font.pixelSize: 12} MouseArea {id: rightBottomCornerMouseArea x: 604 y: 444 width: 36 height: 36 property real lastMouseXb: 0 property real lastMouseYb: 0 anchors.right: parent.right anchors.rightMargin: 0 anchors.bottom: parent.bottom anchors.bottomMargin: 0 onPressed: {lastMouseXb = mouseX lastMouseYb = mouseY} onMouseXChanged: applicationWindow.width + = (mouseX - lastMouseXb) onMouseYChanged: applicationWindow.height + = (mouseY - lastMouseYb)} Rectangle {id: rightBottomCornerRect x: 604 y: 447 width: 36 height: 36 gradient: Gradient {GradientStop {position: 0 color:" #00000000 "} GradientStop {position: 1 color:" #000000 "}} anchors.right: parent.right anchors.rightMargin: 0 anchors.bottom: parent.bottom anchors.bottomMargin: 0}} In general, it is preparation, a sketch. Simply enough further to place icons, side zones of the mouse,  for cursor change  . Enjoy.

11

Re: To install color for title MainWindow - a C ++ Qt

N>> it when in 10-ke to bring a window to the upper edge of the monitor it swings open on all screen. XOO> Generally, it on-default so conducts itself, if the sizes tightly are not fixed, certainly. In 7th Windows too as works. XOO> https://forum.qt.io/topic/55380/solved- … reen-edges in  a window does not do.

12

Re: To install color for title MainWindow - a C ++ Qt

Hello, XOOIOOX, you wrote: XOO> Hello, XOOIOOX, you wrote: XOO> Something here such : https://github.com/deimos1877/BorderlessWindow XOO> Yes, here unpleasant WinAPI, but type it is possible to take and . Thanks! I will look.

13

Re: To install color for title MainWindow - a C ++ Qt

Hello, SaZ, you wrote: SaZ> By the way, they even QML , which in resources . Became interested in more details, how at all of them it is arranged. Not all so severely appeared.  there is not present, there is a resource file "Battle.net.mpq" It, actually, a certain archive ".mpq". The viewer and  this good was here: http://www.zezula.net/en/mpq/download.html It uncovers numerous resources, among which, besides buttons, pictures and other, QML-code mass in normal and almost readable type (unless it is necessary to add line feed after everyone; and it is beautiful to format). In general, is what to study. The only thing that confused, it "import Phoenix 1.0". Yet did not find that it.