QT C++ GUI Tutorial 13- Creating connection open and close function with sqlite database

preview_player
Показать описание
c++ - How would I open a new window from a button in the main
How to show another window from mainwindow in QT Login
How to move to another window in Qt by a pushbutton Login
How to open a new window in Qt Login
Open new window when button on main-window is clicked

Thread: Open new window on menu action.
[SOLVED] QMainWindow open a new QMainWindow
Thread: Open a window inside another window Login
Thread: right way to open a new window Login
Open a window inside another window Login
Рекомендации по теме
Комментарии
Автор

There is a lot of good information here, but you should never put code in your header file. A header file is a separation of reference and code. What you could have done is to put bool connOpen() in your header file and then created the function in your login.cpp bool connOpen(){blah blah}. Other than that a good tutorial, and I haven learned from it

Asimov
Автор

after the modification i get THIS MESSAGE duplicate connection name 'qt_sql_default_connection', old connection removed.) the login dialog will not hid for the new dialog to open

atoivan
Автор

I think instead of making a instance of login every time you need a db in your new window you could make a separate class for making and closing a db connection, but i couldn't find a way to do that so i'm stuck with this.

blendjams
Автор

Why do you put the function in the header??

tculig
Автор

He's in-lining the function, to save time I suppose. I wouldn't have--I would have put them in the implementation (.cpp) file.

Also, I don't agree with testing for an open connection in the constructor. You do so by *calling* the connOpen() function...which opens the connection (presumably). But then you try to open it again in the login button-click slot, at about 19-20 minutes into the video. I guess I wouldn't try to open it again in the button slot--but rather just test that it's still open, if you want to do that. I don't see why that's even necessary though--once it's open in the ctor, it's open.

tcbetka
Автор

Hey, please increase your teaching speed in the videos. You take waste a lot of time in unnecessarily. The content is good but it sometimes get boring. Overall decent job

SahilSehgal
Автор

@programmingKnowledge thank you so much for sharing ua knowledge.without using sqlite how can i open new window and i wanto perform some task in new window is it possible with c++ ..
thankx advnce
ramesh

rameshrathod
Автор

Is there any place where we can find this code snippet? Anyways, thank you for so much for these tutorials.

manishdawar
Автор

Moving the code to the header file was unnecessary.

LetTheWritersWrite
Автор

connected....
connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
duplicate connection name 'qt_sql_default_connection', old connection removed.
:( please help...

troywhight
Автор

can you post how to get data from sqlite database in QT?

usamakhalid
Автор

Hi Sir, I always love your tuts.
In the login form, I want that cusor should be in "Login field" as the form loads by default, so user need not have to click on that and then enter the id and password.
Please Reply,

piyushkumardongre
Автор

What is the purpose of using the connOpen and connClose functions?
And may I know your name?

Carl Barnes

carlbarnes
Автор

I want to connect to HeidiSQL and not SQLLite. How can I do that ??

harishramamurthy
Автор

im getting the error driver not loaded

malicapuspaceno