Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. click
    Log in to post

    • UNSOLVED QPushButton.click должен изменять мой QLabel
      Russian • qpushbutton qlabel click clicked • • Regex_brave  

      15
      0
      Votes
      15
      Posts
      133
      Views

      @Regex_brave Use lambdas (new style syntax) e.g. if you want to pass different parameters from signal to slot. Example: // member variables QPushButton *pb1, *pb2 pb1 = new QPushButton(this); pb1->setObjectName("PushButton #1"); pb2 = new QPushButton(this); pb2->setObjectName("PushButton #2"); connect(pb1, &QPushButton::clicked, this, &MainWindow::pushButtonClicked); connect(pb2, &QPushButton::clicked, this, &MainWindow::pushButtonClicked); connect(pb1, &QPushButton::clicked, this, []() { qDebug() << "A button was clicked, but *still* do not know which button"; }); // lambda connect(pb2, &QPushButton::clicked, this, []() { qDebug() << "A button was clicked, but *still* do not know which button"; }); // lambda connect(pb1, &QPushButton::clicked, this, [this]() { pushButtonClicked(pb1); }); // lambda connect(pb2, &QPushButton::clicked, this, [this]() { pushButtonClicked(pb2); }); // lambda void MainWindow::pushButtonClicked(bool checked = false) { qDebug() << "A button was clicked, but do not know which button"; } void MainWindow::pushButtonClicked(QPushButton *pb) { qDebug() << "Button was clicked, objectName:" << pb->objectName(); }
    • UNSOLVED Emit signal by clicking on the part of the text
      QML and Qt Quick • text click qml signalsslot qml link • • d.sukhomlinov  

      2
      0
      Votes
      2
      Posts
      36
      Views

      No need to calculate the position, use linkActivated signal handler https://doc.qt.io/qt-5/qml-qtquick-text.html#linkActivated-signal
    • UNSOLVED Qt QuickTest and native dialogs
      QML and Qt Quick • button click native dialog qtquicktest simulate • • Oliver Starke CEOS  

      1
      0
      Votes
      1
      Posts
      37
      Views

      No one has replied

    • SOLVED Handing events from children to parent widget?
      General and Desktop • event parent click child passing • • m1212e  

      8
      0
      Votes
      8
      Posts
      1889
      Views

      @jsulm Okay, that helped me a lot. Thank you very much!
    • SOLVED Mouse pressed with right OR left click check?
      General and Desktop • click qpushbutt right-click • • legitnameyo  

      5
      0
      Votes
      5
      Posts
      1703
      Views

      @legitnameyo This is not how it works. You will need to subclass QPushButton and override http://doc.qt.io/qt-5/qwidget.html#mousePressEvent You can find an example here: http://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html
    • SOLVED Opening dynamically created buttons
      General and Desktop • button qstringlist dynamic click • • Kushan  

      11
      0
      Votes
      11
      Posts
      7478
      Views

      @jsulm thanx bro :)
    • SOLVED Getting only the folder path to a line edit without selecting any file
      General and Desktop • qtcreator button click folder path • • Lasith  

      4
      0
      Votes
      4
      Posts
      9373
      Views

      just use the filePath without further modification, its already the complete path. This code QDir d = QFileInfo(filePath).absoluteDir(); QString absolute=d.absolutePath(); will lead you to the dir above the selected path...
    • SOLVED Adding own UI to dialog
      General and Desktop • gui button dialog click • • aney  

      12
      0
      Votes
      12
      Posts
      8408
      Views

      @aney Yeah when meta compiler doesn't run, it all get a bit strange. :) In first post , under it. to the right. is Topic Tools button. It can mark as solved.
    • SOLVED sub window shrinks on Linux when opened through main window.
      General and Desktop • linux click • • Ratzz  

      9
      0
      Votes
      9
      Posts
      1932
      Views

      In the constructor or in the showEvent ?
    • Translucent window with click-through behaviour
      General and Desktop • window transparency click translucent through • • Rphysx  

      3
      0
      Votes
      3
      Posts
      1309
      Views

      Win7 & Qt 5.4.2 with QtCreator 3.4.1
    • Menu not working
      General and Desktop • menu click • • A Former User  

      2
      0
      Votes
      2
      Posts
      889
      Views

      Maybe there's a widget that you didn't put into a layout? The default position of such widget is in the upper left corner and the 100px sound like some default size. Try adding this in your main: qApp->setStyleSheet("QWidget { border: 2px solid red;}"); This should put a red frame around every widget so you'll see if anything's there.