Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. no reaction at the first touch on the new form from doubleclick on a listview
Forum Updated to NodeBB v4.3 + New Features

no reaction at the first touch on the new form from doubleclick on a listview

Scheduled Pinned Locked Moved Mobile and Embedded
qt5.4androidios
2 Posts 1 Posters 1.2k 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.
  • M Offline
    M Offline
    mkdh
    wrote on last edited by mkdh
    #1

    I have a ListVew and button on my widget.
    there are two different reaction:
    condition 1. (OK)
    When I press the button , the new form(MyDesign) will be generated.
    And I can get reaction from the first pressing button on the generated form(MyDesign) .
    condition 2.(NOT OK)
    When I doubleclick the item on a listview , the new form(MyDesign) will be generated.
    But there are no reaction from the first pressing button on the new form(MyDesign).

    (the slot of btnOK and lvwFile are both on_btnOK_clicked())
    Why?
    How to correct it?

        btnOK=new MainButton(this);
        btnOK->setFocusPolicy(Qt::NoFocus);
        connect(btnOK, SIGNAL(onClicked()), this, SLOT(on_btnOK_clicked()));
        ui->lvwFile->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        ui->lvwFile->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        ui->lvwFile->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
        ui->lvwFile->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
        QScroller::grabGesture(ui->lvwFile,QScroller::LeftMouseButtonGesture);
        connect(ui->lvwFile, SIGNAL(clicked(QModelIndex)), this, SLOT(lvwFile_Clicked()));
        connect(ui->lvwFile, SIGNAL(onPressed()), this, SLOT(Delete_Clicked()));
        connect(ui->lvwFile, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_btnOK_clicked()));
    
    
    void diaOpenFileByListView::on_btnOK_clicked()
    {
        lvwFile_Clicked();
        strPath=ui->lblPath->text();
        if(strPath.isNull()==false && strPath!=""){
            MyDesign *formDesign=new MyDesign(this);
            formDesign->setGeometry(0,0,this->width(),this->height());
            formDesign->filePath=strPath;
            formDesign->exec();
            //this->close();
            //delete ui;
            BindLV();
        }
    }
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mkdh
      wrote on last edited by mkdh
      #2

      what different between clicked and doubleClicked?

      In doubleClicked case,
      I can't press the button before touching the screen on my new widget.
      connect(ui->lvwFile, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(on_btnOK_clicked()));

      In clicked case,
      I can press the button before touching the screen on my new widget.
      connect(ui->lvwFile, SIGNAL(clicked(QModelIndex)), this, SLOT(on_btnOK_clicked()));

      But, I want to use doubleClicked....

      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