filmov
tv
Qt Calculator GUI Tutorial Part 1
Показать описание
We have a new name now, Programming Liftoff!
Learn how to design a user interface for a calculator using Qt's drag-and-drop GUI designer. This is part one in a series on creating a calculator using Qt. From here you can either use Qt/C++ or PyQt to code the logic and interaction with the calculator.
Thanks for watching and comment with any questions! :)
-- Stylesheet code for buttons
/* Digits 0-9 Stylesheet */
QPushButton {
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
/* End Digits 0-9 Stylesheet */
/* (Clear,+/-,%,. buttons) Unary Operations Buttons Stylesheet */
QPushButton {
background-color: rgb(215, 215, 215);
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #BEBEBE, stop: 1 #D7D7D7);
}
/* End Unary Operations Buttons Stylesheet */
/* (Orange buttons) Operations Buttons Stylesheet */
QPushButton {
background-color: rgb(255, 151, 57);
color: white;
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #FF7832, stop: 1 #FF9739);
}
/* (Label at top) Label Stylesheet */
QLabel {
qproperty-alignment: 'AlignVCenter | AlignRight';
border: 1px solid gray;
}
background-color : white;
/* End Label Stylesheet */
Learn how to design a user interface for a calculator using Qt's drag-and-drop GUI designer. This is part one in a series on creating a calculator using Qt. From here you can either use Qt/C++ or PyQt to code the logic and interaction with the calculator.
Thanks for watching and comment with any questions! :)
-- Stylesheet code for buttons
/* Digits 0-9 Stylesheet */
QPushButton {
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
/* End Digits 0-9 Stylesheet */
/* (Clear,+/-,%,. buttons) Unary Operations Buttons Stylesheet */
QPushButton {
background-color: rgb(215, 215, 215);
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #BEBEBE, stop: 1 #D7D7D7);
}
/* End Unary Operations Buttons Stylesheet */
/* (Orange buttons) Operations Buttons Stylesheet */
QPushButton {
background-color: rgb(255, 151, 57);
color: white;
border: 1px solid gray;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #FF7832, stop: 1 #FF9739);
}
/* (Label at top) Label Stylesheet */
QLabel {
qproperty-alignment: 'AlignVCenter | AlignRight';
border: 1px solid gray;
}
background-color : white;
/* End Label Stylesheet */
Комментарии