Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Differences between debug and release

Differences between debug and release

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bu7ch3r
    wrote on last edited by
    #1

    @
    QSqlTableModel *model; //this is initialized I put the declaration just for you
    void cPriceDelegate :: textChanged ( QString text )
    {
    long long str= text.toLongLong();
    str = str/ 4.2;
    record.setValue("eur", str);
    record.setValue("ron", text);
    gmain->model->setRecord(g_row,record);
    }

    QWidget *cPriceDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem &option,
    const QModelIndex &index) const
    {

    QWidget * editor = QItemDelegate::createEditor(parent, option, index);
    
    column = index.column();
    g_row  = index.row();
    record = gmain->model->record(index.row());
    

    connect(editor, SIGNAL(textChanged(QString)),
    this, SLOT(textRonChanged(QString)));

    return editor;
    

    }@

    Hello,

    Image that I have a table that has attached a model and for one column I am adding a delegate.
    My goal is to change another column when I am edditing the column that has the delegate.
    To be more clear: I have a column USD and a column EUR.
    When I edit the EUR column and the value entered is converted to USD while writing.

    On QTCreator-debug(MSVC2008 version) everything works and while I am writing in one column the other column gets the value converted.
    For example if I write 1 in EUR column, USD column gets 0. If I continue to write and add 2(the text becomes 12) USD columns get 8(e.g.).

    The problem is when I compile the same code in release using Visual Studio and the static version of QT. I don't get the column updtated while I am writing, only after I close the delegate. So nothing happens while editing the column, only when I lose the focus to the QLineEdit.

    Do you have any clue what is this about ?

    Thanks!

    for(int i = 200; i > 0;)
    try
    {
    //do something
    }
    catch(...)
    {
    i--;//try again
    }

    1 Reply Last reply
    0
    • H Offline
      H Offline
      henryxuv
      wrote on last edited by
      #2

      Check all the variable that you used. If they have been initialized correctly. I met debug and release problem before. Finally I found it's my variable problem. Hope it's help.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bu7ch3r
        wrote on last edited by
        #3

        Thank you henryxuv, usually this is the problem when the code works on debug but not on release.
        The code works on release, the only thing is different is the GUI behaviour.

        Regarding my problem, if I resize while I am editing, the other cell gets updated.
        I have tried to ->update, and/or ->repaint(the entire main windows or the control itself(tableView) but with no success.

        It looks like on release there is an optimisation that doesn't make the cell update; for performance reasons I guess...

        Thanks!

        for(int i = 200; i > 0;)
        try
        {
        //do something
        }
        catch(...)
        {
        i--;//try again
        }

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved