Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,884 members, 7,802,854 topics. Date: Friday, 19 April 2024 at 11:28 PM

Hope For C++ Newbies: Gui Toolkits - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Hope For C++ Newbies: Gui Toolkits (16725 Views)

How To Create A Simple Calculator Using Java Programing Language GUI / What Development Chain Do You Use For C++? (2) (3) (4)

(1) (2) (3) (4) (Reply) (Go Down)

Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 12:41pm On Mar 04, 2015
jereal:
@BlueMagnificent... Great job you're doing here... I remember a while back when I was trying to setup wxwidget too, anyway, I ended up going with Qt. its been great so far and I've been working on a project for a while now. But I'm having some difficulty achieving what I want with QPrintPreviewDialog... I'd post snippets if you can help me out.

I'll be glad to help out
Re: Hope For C++ Newbies: Gui Toolkits by jereal(m): 1:47pm On Mar 04, 2015

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QLabel>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#include <QPrinter>
#include <QPainter>


MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::on_pushButton_clicked()
{
QPrinter printer;
//printer.setResolution(QPrinter::HighResolution);
printer.setPaperSize(QPrinter::A4);
printer.setOrientation(QPrinter::Portrait);
printer.setFullPage(true);




QPrintPreviewDialog *printPreview = new QPrintPreviewDialog(&printer);
connect(printPreview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(print(QPrinter*)));



printPreview->setWindowTitle("Preview Dialog" );
printPreview->exec();
}





void MainWindow::print(QPrinter *printer)
{
QPainter painter(printer);



painter.begin(printer);
double xscale = printer->pageRect().width()/double(ui->centralWidget->width());
double yscale = printer->pageRect().height()/double(ui->centralWidget->height());



double scale = qMin(xscale, yscale);

painter.translate(printer->paperRect().x()+printer->paperRect().width()/2, printer->paperRect().y()+printer->paperRect().height()/2 );

painter.scale(scale, scale);

painter.translate(-width()/2, -height()/2);



ui->centralWidget->render(&painter);
}

What I intend to do is generate and print a report. I intend to design the report with Qt Creator, and then, sort of grab the form and print in A4 size. But I have a feeling I'm not going about it the right way... I saw QPdfWriter mentioned in a couple of places on the web, but can't quite figure it out.
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 2:46pm On Mar 06, 2015
jereal:


What I intend to do is generate and print a report. I intend to design the report with Qt Creator, and then, sort of grab the form and print in A4 size. But I have a feeling I'm not going about it the right way... I saw QPdfWriter mentioned in a couple of places on the web, but can't quite figure it out.
pls can u tell me the qt version you download is it the one with mingw or the one with msvc . Pls i downloaded the one with msvc but the qt creator dosent compile it keeps telling me error i want to ask if i download the one with mingw will it work
Re: Hope For C++ Newbies: Gui Toolkits by jereal(m): 4:30pm On Mar 06, 2015
peterincredible:
pls can u tell me the qt version you download is it the one with mingw or the one with msvc . Pls i downloaded the one with msvc but the qt creator dosent compile it keeps telling me error i want to ask if i download the one with mingw will it work

mingw... I remember having similar problems too with the msvc compiler, I installed the mingw version & everything worked straight away...
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 6:46pm On Mar 06, 2015
jereal:


mingw... I remember having similar problems too with the msvc compiler, I installed the mingw version & everything worked straight away...
tanks I will download another one with the Mingw and install it but I want to ask have u designed any application and have you finished with all the topics under the c++ language
Re: Hope For C++ Newbies: Gui Toolkits by jereal(m): 2:09pm On Mar 07, 2015
peterincredible:
tanks I will download another one with the Mingw and install it but I want to ask have u designed any application and have you finished with all the topics under the c++ language

I'm currently working on a simple record keeping app... & No, I'm nowhere close to finishing c++ topics, I'm still a beginner... If you can at least understand what classes & pointers are, I think you can start doing some things with Qt... While still studying your pure C++ materials...
Re: Hope For C++ Newbies: Gui Toolkits by KazukiIto(m): 1:05am On Mar 14, 2015
Blue wxwidgets is totally IT. I dazzled during my defense thanks to wx. I will be using it for a very long time.
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 6:57am On Mar 14, 2015
KazukiIto:
Blue wxwidgets is totally IT. I dazzled during my defense thanks to wx. I will be using it for a very long time.

Thats great, wxWidgets is really a resourceful GUI lib when u get to understand it.
Congrats on ur successful defence smiley
Re: Hope For C++ Newbies: Gui Toolkits by rukkykf: 7:57pm On Mar 15, 2015
c++ is not a programming language of choice when it comes to GUI programming because even with the available languages (i have used Qt in the past) it's user interfaces can't be as visually appealing as those created with other .NET languages like c# and Vb.

but here is what c++ is great for
1. Game programming: c++ is the language of choice when it comes to creating game engines and it is the standard language used in the video game production industry. for people interested in becoming game programmers...feel free to check out the amazing training provided by game institute: http://gameinstitute.com/....it's really cheap compare to all the content you'll get but don't take my word for it...check it out yourself.

2. Operating system programming: well in case you didn't know the original version of the linux operating system was created using c++ and most other applications that interact directly with hardware require the use of C, c++, objective C...generally the C languages though.

3. Arduino programming: c++ works well with this.
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 9:17am On Mar 16, 2015
rukkykf:
c++ is not a programming language of choice when it comes to GUI programming because even with the available languages (i have used Qt in the past) it's user interfaces can't be as visually appealing as those created with other .NET languages like c# and Vb.

Well it would had been better if u specified that the above was ur personal opinion smiley
Re: Hope For C++ Newbies: Gui Toolkits by netesy(m): 7:17pm On Mar 17, 2015
C# and vb is good for windows, its not really cross platform but if you want to say mono its not the same as windows you will have to make some small changes to your code while Qt is just one code.
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 12:25am On Mar 23, 2015
Pls I have a problem with qt how can I add a form to my application pls. I did a dialog with my qt designer which gave me a Bleep.ui file pls how can I generate the Bleep.h and Bleep.cpp and how to use It on my app made with qt creator may God bless u all for your contributions thanks
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 7:39pm On Mar 23, 2015
[quote author=peterincredible post=31903147][/quote]

If I got you right, you want to use a form generated in qt designer in your application designed with the qt creator, right?
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 8:08pm On Mar 24, 2015
BlueMagnificent:


If I got you right, you want to use a form generated in qt designer in your application designed with the qt creator, right?
yes pls I need help may God bless u
Re: Hope For C++ Newbies: Gui Toolkits by ijeezlux(m): 7:04am On Apr 17, 2015
jereal:


What I intend to do is generate and print a report. I intend to design the report with Qt Creator, and then, sort of grab the form and print in A4 size. But I have a feeling I'm not going about it the right way... I saw QPdfWriter mentioned in a couple of places on the web, but can't quite figure it out.
helo gud day, am into c++ programing, for sumtym now i have bin trying to do sum stuff dat involve the use of gui toolkit like wxwidget or qt bt i couldnt use dem. Though i concentrated more on the QT, i tried all i could, to make sure dat the qt work but all to no avail. When ever i compile my codes it keep giving me error. Plz i will be vry vry happy and grateful if u can help me out with the qt.
Plz guys help me. My numb nd my whatsapp numb is: 08036407597
my email is: ijeezlux@gmail.com
fcbuk name: cletus ijeoma onyoke.
I wud realy lyk to hook up like-minded c++ guy. Tnks
Re: Hope For C++ Newbies: Gui Toolkits by ijeezlux(m): 7:21am On Apr 17, 2015
peterincredible:
tanks I will download another one with the Mingw and install it but I want to ask have u designed any application and have you finished with all the topics under the c++ language
how far hav u reached in cpp. Anyway amost done with it. Wel may be shud talk on phone and lets see ways we can help each other to grow. U can cal or chat wit me in whatsapp with 08036407597
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 8:59am On Apr 17, 2015
ijeezlux:

helo gud day, am into c++ programing, for sumtym now i have bin trying to do sum stuff dat involve the use of gui toolkit like wxwidget or qt bt i couldnt use dem. Though i concentrated more on the QT, i tried all i could, to make sure dat the qt work but all to no avail. When ever i compile my codes it keep giving me error. Plz i will be vry vry happy and grateful if u can help me out with the qt.
Plz guys help me. My numb nd my whatsapp numb is: 08036407597
my email is: ijeezlux@gmail.com
fcbuk name: cletus ijeoma onyoke.
I wud realy lyk to hook up like-minded c++ guy. Tnks


Good to learn of your interest in C++
Can u please post the error message you encountered while building your application
Re: Hope For C++ Newbies: Gui Toolkits by ijeezlux(m): 11:09am On Apr 17, 2015
BlueMagnificent:



Good to learn of your interest in C++
Can u please post the error message you encountered while building your application
my laptop has been down for sumtym now cos we dnt av power supply. For now we can only talk on phone. Thanks
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 12:59pm On Apr 17, 2015
ijeezlux:

my laptop has been down for sumtym now cos we dnt av power supply. For now we can only talk on phone. Thanks

I guess its best for us to communicate about the issue here so that other with similar problem can easy find it
Re: Hope For C++ Newbies: Gui Toolkits by jereal(m): 1:22pm On Apr 18, 2015
ijeezlux:

helo gud day, am into c++ programing, for sumtym now i have bin trying to do sum stuff dat involve the use of gui toolkit like wxwidget or qt bt i couldnt use dem. Though i concentrated more on the QT, i tried all i could, to make sure dat the qt work but all to no avail. When ever i compile my codes it keep giving me error. Plz i will be vry vry happy and grateful if u can help me out with the qt.
Plz guys help me. My numb nd my whatsapp numb is: 08036407597
my email is: ijeezlux@gmail.com
fcbuk name: cletus ijeoma onyoke.
I wud realy lyk to hook up like-minded c++ guy. Tnks

HI... Just like BlueMagnificent stated, I believe it's best you posted all your questions here... You'd get a lot more answers...
Re: Hope For C++ Newbies: Gui Toolkits by Nobody: 1:58pm On Apr 18, 2015
ijeezlux:

helo gud day, am into c++ programing, for sumtym now i have bin trying to do sum stuff dat involve the use of gui toolkit like wxwidget or qt bt i couldnt use dem. Though i concentrated more on the QT, i tried all i could, to make sure dat the qt work but all to no avail. When ever i compile my codes it keep giving me error. Plz i will be vry vry happy and grateful if u can help me out with the qt.
Plz guys help me. My numb nd my whatsapp numb is: 08036407597
my email is: ijeezlux@gmail.com
fcbuk name: cletus ijeoma onyoke.
I wud realy lyk to hook up like-minded c++ guy. Tnks
Post the code here someone may correct it.
Re: Hope For C++ Newbies: Gui Toolkits by ijeezlux(m): 7:38pm On Jun 12, 2015
Hey guys.. i really commend all ur effort in this forum. Please j need u guys to help me explain how to QDir class member function path(). Thanks
Re: Hope For C++ Newbies: Gui Toolkits by Nobody: 12:05am On Jun 13, 2015
give a nigeria guy stuff for free he calls it local I have ultimate. solution. but guess. what it is not for free
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 3:28am On Jun 13, 2015
ijeezlux:
Hey guys.. i really commend all ur effort in this forum. Please j need u guys to help me explain how to QDir class member function path(). Thanks

I am a bit confused as to what your question is about. Please can you explain better
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 2:10am On Jun 17, 2015
BlueMagnificent:


I am a bit confused as to what your question is about. Please can you explain better
pls i am working on an app pls i want to know by d tym i finish with d app how can i make it a stand allone app in exe format or any other format your reponse will be highlyy appreciated tanks
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 5:00am On Jun 17, 2015
peterincredible:
pls i am working on an app pls i want to know by d tym i finish with d app how can i make it a stand allone app in exe format or any other format your reponse will be highlyy appreciated tanks

Which language are you building the app with and which libraries are you using?

If you are building with C++ and you are using any of the mentioned toolkits (wxWidgets or Qt) then your app is build directly as a stand alone executable. Note that if you want to distribute this executable you would have to distribute it along with the necessary dlls that it links with at run time
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 9:33am On Jun 17, 2015
am writing it with c++ and i am using qt , i heard for u to be able to have a stand alone app u have to do a static building configuration or so can u help me explain dat and also i am also interested in mobile app can i use qt to develop a mobile app and also is there diff btw gui programming app and mobile app your contributions will be highly gratefull tanks
Re: Hope For C++ Newbies: Gui Toolkits by BlueMagnificent(m): 6:06pm On Jun 18, 2015
peterincredible:
am writing it with c++ and i am using qt , i heard for u to be able to have a stand alone app u have to do a static building configuration or so can u help me explain dat and also i am also interested in mobile app can i use qt to develop a mobile app and also is there diff btw gui programming app and mobile app your contributions will be highly gratefull tanks

The information about doing static building configurations is not really right as such. You can have a standalone application whether you are using static or dynamic linking.

By linking statically it means that the qt codes referenced in your application are bound to your application executable during compile time, this means that you would'nt need to distribute any of your applications with additional qt based dependencies. The downside is that your application's executable size increases.

With dynamic linking, a reference to the qt library code (not the whole code) that your application uses is bound to your application during compile time. When you application runs it then loads the needed codes dynamically from the qt library (which on windows is a .dll file). The advantage of this is that your executable's size is far smaller than if it was build using static linking. The downside offcourse is that for you to distribute your application, you have to distribute it with the needed qt dlls else it won't run.


So in both cases your still have your stand alone executables, just that for dynamically links application you'll have to include the qt dlls while distributing it
Re: Hope For C++ Newbies: Gui Toolkits by KazukiIto(m): 1:00pm On Jul 06, 2015
Anybody using emacs here or cygwin?
Re: Hope For C++ Newbies: Gui Toolkits by peterincredible: 12:48am On Jul 28, 2015
for those dat are looking for a good qt text book for beginners download this book "foundation of qt development" and i promise u will be happy u were informed about this book
Re: Hope For C++ Newbies: Gui Toolkits by codemarshal08(m): 7:06am On Jul 28, 2015
peterincredible:
for those dat are looking for a good qt text book for beginners download this book "foundation of qt development" and i promise u will be happy u were informed about this book
+1 for this recommendation !...... peter, hope u have gone far o
Re: Hope For C++ Newbies: Gui Toolkits by GregoryOla: 5:27pm On Jan 09, 2016
Hello,

I'm very much interested in wxWidgets. I've downloaded the source built it at the command prompt and also installed code::blocks to run it on.

But I'm having difficulty. I keep getting an error message: No such file or directory every time I try to build a (sample) program in code::blocks using wxWidgets.

I need help please!!!

(1) (2) (3) (4) (Reply)

Front-End Developer Or Back-End Developer: Which Job Title Has A Higher Salary? / LET'S LEARN HOW TO CONTROL HOME APPLIANCES WITH SOFTWARE AND VOICE CONTROL! / Javascript With NodeJS

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 55
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.