Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. lineEdit(setText)和textEdit(setPlainText)设置初值失败导致程序崩溃

lineEdit(setText)和textEdit(setPlainText)设置初值失败导致程序崩溃

Scheduled Pinned Locked Moved Unsolved Chinese
4 Posts 2 Posters 745 Views
  • 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.
  • J Offline
    J Offline
    JICJ
    wrote on last edited by
    #1

    我在下面窗口的lineEdit和textEdit进行初始化设置初值时,程序直接崩溃!
    lineEdit的setText、textEdit的setPlainText都不行,目前不知道是什么原因导致的该问题
    ebfb45c7-ebc8-4724-ad1a-7e8c04d5ee04-图片.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      I do not read or speak Chinese. This is what Google translate gives me:

      When I initialize and set the initial value of lineEdit and textEdit in the window below, the program crashes directly!
      LineEdit's setText and textEdit's setPlainText are not working. I don't know what caused the problem.

      You will need to post your code and the stack back trace from your debugger.
      Google translate:

      您将需要从调试器发布您的代码和堆栈回溯。

      J 1 Reply Last reply
      0
      • C ChrisW67

        I do not read or speak Chinese. This is what Google translate gives me:

        When I initialize and set the initial value of lineEdit and textEdit in the window below, the program crashes directly!
        LineEdit's setText and textEdit's setPlainText are not working. I don't know what caused the problem.

        You will need to post your code and the stack back trace from your debugger.
        Google translate:

        您将需要从调试器发布您的代码和堆栈回溯。

        J Offline
        J Offline
        JICJ
        wrote on last edited by
        #3

        Here are some of my code and program crashes:

        AddCreativeDlg::AddCreativeDlg(QWidget *parent) :
            QDialog(parent),
            ui(new Ui::AddCreativeDlg)
        {
            ui->setupUi(this);
        
            Qt::WindowFlags flags= this->windowFlags();
            setWindowFlags(flags&~Qt::WindowContextHelpButtonHint);
        
            m_str_title = "";
            m_str_des1 = "";
            m_str_des2 = "";
            m_str_def_visturl = "";
            m_str_def_showurl = "";
            m_str_mobile_visturl = "";
            m_str_mobile_showurl = "";
        
            m_str_def_visturl = "regDomainName";
            m_str_def_showurl = m_str_def_visturl;
            m_str_mobile_visturl = "mobileDomainName";
            m_str_mobile_showurl = m_str_mobile_visturl;
        
            ui->lineEdit_creativeTitle->setFixedWidth(300);
            ui->showUrl->setFixedWidth(300);
            ui->showUrl->setFixedHeight(30);
            ui->visitUrl->setFixedWidth(300);
            ui->visitUrl->setFixedHeight(30);
            ui->showMobUrl->setFixedWidth(300);
            ui->showMobUrl->setFixedHeight(30);
            ui->visitMobUrl->setFixedWidth(300);
            ui->visitMobUrl->setFixedHeight(30);
        
            ui->textEdit_creativeLine1->setFixedWidth(300);
            ui->textEdit_creativeLine1->setFixedHeight(50);
            ui->textEdit_creativeLine2->setFixedWidth(300);
            ui->textEdit_creativeLine2->setFixedHeight(50);
        
            /*textEdit or lineEdit have the same problem*/
            ui->visitUrl->setPlainText(m_str_def_visturl);                   //here is normal.
            ui->showUrl->setPlainText(m_str_def_visturl);         //here is crash.
            ui->visitMobUrl->setPlainText(m_str_mobile_visturl);
            ui->showMobUrl->setPlainText(m_str_mobile_showurl);
        
        
            InitMyEdit();        //This function is used to set initial values for several other lineedit or TextEdit.
        
        }
        
        1 Reply Last reply
        0
        • J Offline
          J Offline
          JICJ
          wrote on last edited by
          #4

          The following is my specific layout

          QQ图片20220608112459.png

          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