Qt Calculator GUI Tutorial Part 1

preview_player
Показать описание
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 */
Рекомендации по теме
Комментарии
Автор

Thank you for the tutorial, really easy to understand. I was surprised to see the cssstylesheets, I didn’t realize qt had that.

xthomas
Автор

I think it's a shame I didn't see this earlier! Amazing work!
Especially the split off of PyQt and C++ Qt half way through is very nice!

JorrickSleijster
Автор

Just got Qt 5.9.1 and Tools complete installed I look forwards to following some of these tutorials. Looks like fun, hope you make plenty more of these Qt tutorials. Just getting started learning C++ and I am also using Visual Studio Community 2017 to learn C++ hope to see you use both for these video tutorials.

vnmsenior
Автор

Hi, Can you please tell me how can I set dynamic resizing to the widgets and buttons so when we resize the window the buttons also increase in size.

abhaysinghsengar
Автор

When I try to get a kit it says "No suitable kits found" and it seems like i dont have a C++ compiler. I tried all of the solutions you gave on other comments and most of the compilers I could find online but nothing works.

mastakouris
Автор

The shapes Won't change if the user changed the size of the app, is it possible to make dynamic with the changed size? If not, is it possible to make the user unable to change the app size

ahmad.software
Автор

The filter box through which you are changing sizes I cant see it. Please help!!!

nehaagarwal
Автор

Hi i would like know how to add buttons like we do in html. Or more clearly i don't want add button to window using drag and drop

shahidkhan
Автор

Shouldn't we be using a top level layout for the form so that things like window resizing work?
- Noob

BonBonShrimp
Автор

Qt Creator says 'No valid kits' in the kit section of new project.
Please Help?

littleturtle
Автор

*I don't get it... Do you write the actual code for it in Qt as an independent programming language or do you integrate the actual code from an other language like C++ or Python, or something and then just make the UI in Qt?*

shryoder
Автор

Do you use the default install for QT to write this?

platinums
Автор

Hey bro i need some help can we talk on Facebook/'discord/Teamspeak or anything

smaranil
Автор

Bro can you provide Qt creator Google drive download link for Windows

kevinbrian
Автор

he spelled "pickle" wrong in the annotation 13:33

nasserjaved
Автор

I know it's hard to know how to pronounce names for libraries/frameworks/software if you only ever read it, but it's actually pronounced as just "cute", not "cu-tee". I only just learned this a week or two ago.

katkosmos
Автор

No need to create styles sheets now there is this WebSite for free downloads Qss Stock Templates Qt

marocTV
Автор

I cannot see black words on the black background, man.

cupitman