Skip to content

Commit

Permalink
QLabel Project added
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunny-softdev committed Aug 12, 2020
1 parent 9f9b484 commit 58b0784
Show file tree
Hide file tree
Showing 23 changed files with 4,677 additions and 7 deletions.
22 changes: 16 additions & 6 deletions LineEdit/LineEdit.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.12.4, 2020-08-09T14:07:21. -->
<!-- Written by QtCreator 4.12.4, 2020-08-10T12:03:48. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -54,7 +54,17 @@
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">2</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
Expand Down Expand Up @@ -293,19 +303,19 @@
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/Qt/Qt_Projects/LineEdit/LineEdit.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">E:/Qt/Qt_Projects/LineEdit/LineEdit.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">E:/Qt/Qt_Projects/build-LineEdit-Desktop_Qt_5_15_0_MinGW_64_bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
Expand Down
34 changes: 34 additions & 0 deletions QLabelDemo/QLabelDemo.pro
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
340 changes: 340 additions & 0 deletions QLabelDemo/QLabelDemo.pro.user

Large diffs are not rendered by default.

Binary file added QLabelDemo/images/PresidentObama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions QLabelDemo/main.cpp
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();
}
5 changes: 5 additions & 0 deletions QLabelDemo/resource.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>images/PresidentObama.png</file>
</qresource>
</RCC>
24 changes: 24 additions & 0 deletions QLabelDemo/widget.cpp
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;
}

21 changes: 21 additions & 0 deletions QLabelDemo/widget.h
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
56 changes: 56 additions & 0 deletions QLabelDemo/widget.ui
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>
2 changes: 1 addition & 1 deletion TextEditDemo/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Widget::Widget(QWidget *parent)
qDebug() <<"Following is the entered HTML" << textEdit->toHtml();
});


setFixedSize(400,400);

}

Expand Down
21 changes: 21 additions & 0 deletions build-QLabelDemo-Desktop_Qt_5_15_0_MinGW_64_bit-Debug/.qmake.stash
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
Loading

0 comments on commit 58b0784

Please sign in to comment.