Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8245127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:04:50+00:00 2026-06-07T22:04:50+00:00

i have a QLineEdit on my main screen define by QDialog.along with it i

  • 0

i have a QLineEdit on my main screen define by QDialog.along with it i have a table which contains dynamic data displayed by QThread with 50 data in every 2 seconds.when i input any value in QLinrEdit and then press enter then the screen terminates.

 value = new QLineEdit(this);
        m_label = new QLabel(tr("&Enter Preference Value:"));
        m_label->setBuddy(value);
        m_preLayout->addWidget(m_label);
        m_preLayout->addWidget(value);
        m_preferenceGroup->setLayout(m_preLayout);
        connect(value, SIGNAL(returnPressed()), this, SLOT(preferentialData()));

void appWindow::preferentialData()
{
        valuee = (value->text()).toInt();
}

here i am taking the input from user and then converting that input into an integer which will be further used for some other purpose.Now after taking that input as per signal i press enter and as soon as after that the screen closes.

the value is converted to int and no errors are coming on compiling but why is the window closing? because if it closes then the thing that i will further do with that converted int will be like of no use as with the help of that int i will change some display on my table as i mentioned that i have a table too in that window.

thanks for any help in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:04:52+00:00Added an answer on June 7, 2026 at 10:04 pm

    I’m almost certain (can’t be sure without seeing more code) that the dialog is taking the “Enter” keypress and calling its accept() method, which closes the dialog. If you made the dialog in Qt Creator and chose one of the dialog types that places a button box on the form for you, then this connection is wired up by default.

    Check your dialog’s signal/slot connections and make sure that the accept() slot isn’t connected to a QPushButton or QDialogButtonBox signal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
I have a QLineEdit, on which I have set a QRegExpValidator, that allows the
I have a QLineEdit which I use to get a double. But is there
I have two widgets, one arbitrary (usually a QLineEdit), and one QLabel which displays
I have a main PyQt window, from which I need to get a string
I have a QTableWidget that has a combination of QLineEdit and normal table cell
I have a QLineEdit widget in my menubar which shows the text search by
I have a QStackedWidget which holds several pages full of various QLineEdit and QComboBox
I have two classes both define under QDialog class. Both classes individually are working
I'm a new bie to Qt C++.. I have a QLineEdit . In which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.