Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: Problems Qt Widgets applications and MySql

  1. #21
    Join Date
    Oct 2014
    Posts
    21
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems Qt Widgets applications and MySql

    Is that it?
    Qt Code:
    1. delete ui;
    To copy to clipboard, switch view to plain text mode 

  2. #22
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problems Qt Widgets applications and MySql

    No, that just deletes the structure holding the pointers to all UI elements.

    Why do you want to explicitly delete the model at all?
    Just pass your window as a parent and let it delete the model just like it deletes its UI children.

    Cheers,
    _

  3. #23
    Join Date
    Oct 2014
    Posts
    21
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems Qt Widgets applications and MySql

    To avoid garbage in the Heap.


    Added after 1 23 minutes:


    Is it possible to do this with a program and how would I do it?

    You choose a Table(from MySQL database) with for example 4 fields and press a button.
    When you press the button 4 labels (out of 7 labels) are named with the name fields of the chosen table.

    For example table has fields: name, age, salary, email

    When you choose the table with those fields 4 out of 7 labels text become age, name ...
    Last edited by Emit; 7th November 2014 at 14:15.

  4. #24
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problems Qt Widgets applications and MySql

    Quote Originally Posted by Emit View Post
    To avoid garbage in the Heap.
    I was not suggesting to not delete the object, was I?

    Quote Originally Posted by Emit View Post
    You choose a Table(from MySQL database) with for example 4 fields and press a button.
    When you press the button 4 labels (out of 7 labels) are named with the name fields of the chosen table.

    For example table has fields: name, age, salary, email

    When you choose the table with those fields 4 out of 7 labels text become age, name ...
    QDataWidgetMapper

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    Emit (7th November 2014)

Similar Threads

  1. Problems with QODBC and MySQL
    By crazymonkey in forum Qt Programming
    Replies: 0
    Last Post: 25th April 2011, 12:34
  2. Problems running applications .exe
    By croussou in forum Installation and Deployment
    Replies: 8
    Last Post: 25th March 2011, 18:07
  3. Problems with MySQL on Ubuntu
    By neoclaw in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2010, 02:26
  4. Qwt - Qt Widgets for Technical Applications
    By gandalf in forum Newbie
    Replies: 6
    Last Post: 5th May 2010, 15:09
  5. Problems with Qt 4.3.4 and MySql
    By Headhunter_X in forum Installation and Deployment
    Replies: 9
    Last Post: 19th March 2008, 06:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.