-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f9b484
commit 58b0784
Showing
23 changed files
with
4,677 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
CONFIG += c++11 | ||
|
||
# The following define makes your compiler emit warnings if you use | ||
# any Qt feature that has been marked deprecated (the exact warnings | ||
# depend on your compiler). Please consult the documentation of the | ||
# deprecated API in order to know how to port your code away from it. | ||
DEFINES += QT_DEPRECATED_WARNINGS | ||
|
||
# You can also make your code fail to compile if it uses deprecated APIs. | ||
# In order to do so, uncomment the following line. | ||
# You can also select to disable deprecated APIs only up to a certain version of Qt. | ||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 | ||
|
||
SOURCES += \ | ||
main.cpp \ | ||
widget.cpp | ||
|
||
HEADERS += \ | ||
widget.h | ||
|
||
FORMS += \ | ||
widget.ui | ||
|
||
# Default rules for deployment. | ||
qnx: target.path = /tmp/$${TARGET}/bin | ||
else: unix:!android: target.path = /opt/$${TARGET}/bin | ||
!isEmpty(target.path): INSTALLS += target | ||
|
||
RESOURCES += \ | ||
resource.qrc |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "widget.h" | ||
|
||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
Widget w; | ||
w.show(); | ||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>images/PresidentObama.png</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "widget.h" | ||
#include "ui_widget.h" | ||
|
||
Widget::Widget(QWidget *parent) | ||
: QWidget(parent) | ||
, ui(new Ui::Widget) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->obamaTextLabel->move(250,30); | ||
|
||
//Add an image to an Image Label | ||
QPixmap obamaPixMap("://images/PresidentObama.png"); | ||
|
||
ui->obamaImageLabel->move(200,70); | ||
ui->obamaImageLabel->setPixmap(obamaPixMap.scaled(400,400)); | ||
|
||
} | ||
|
||
Widget::~Widget() | ||
{ | ||
delete ui; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef WIDGET_H | ||
#define WIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { class Widget; } | ||
QT_END_NAMESPACE | ||
|
||
class Widget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
Widget(QWidget *parent = nullptr); | ||
~Widget(); | ||
|
||
private: | ||
Ui::Widget *ui; | ||
}; | ||
#endif // WIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Widget</class> | ||
<widget class="QWidget" name="Widget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>800</width> | ||
<height>600</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Widget</string> | ||
</property> | ||
<widget class="QLabel" name="obamaTextLabel"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>240</x> | ||
<y>50</y> | ||
<width>171</width> | ||
<height>20</height> | ||
</rect> | ||
</property> | ||
<property name="font"> | ||
<font> | ||
<family>MS Serif</family> | ||
<pointsize>16</pointsize> | ||
<weight>75</weight> | ||
<bold>true</bold> | ||
</font> | ||
</property> | ||
<property name="text"> | ||
<string>President Obama</string> | ||
</property> | ||
</widget> | ||
<widget class="QLabel" name="obamaImageLabel"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>150</x> | ||
<y>100</y> | ||
<width>251</width> | ||
<height>201</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>Image Label</string> | ||
</property> | ||
<property name="scaledContents"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
build-QLabelDemo-Desktop_Qt_5_15_0_MinGW_64_bit-Debug/.qmake.stash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L | ||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 8 | ||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 1 | ||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0 | ||
QMAKE_CXX.COMPILER_MACROS = \ | ||
QT_COMPILER_STDCXX \ | ||
QMAKE_GCC_MAJOR_VERSION \ | ||
QMAKE_GCC_MINOR_VERSION \ | ||
QMAKE_GCC_PATCH_VERSION | ||
QMAKE_CXX.INCDIRS = \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++ \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32 \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed \ | ||
C:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include | ||
QMAKE_CXX.LIBDIRS = \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0 \ | ||
C:/Qt/Tools/mingw810_64/lib/gcc \ | ||
C:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib \ | ||
C:/Qt/Tools/mingw810_64/lib |
Oops, something went wrong.