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. CustomContextMenu SLOT not working(QTableWidget)
Qt 6.11 is out! See what's new in the release blog

CustomContextMenu SLOT not working(QTableWidget)

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 579 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by
    #1

    Just added that slot by rightclicking at Design mode, add some simple stuff, and it's have no effect:

    void myProject::on_TabWid_customContextMenuRequested(const QPoint &pos)
    {
        ui->textBrowser1->append("atata!");
    }
    

    What's wrong? I rightclicking everything and nothing happens..

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      Do you have
      ui->TabWid->setContextMenuPolicy(Qt::CustomContextMenu);
      ?

      EngelardE 1 Reply Last reply
      5
      • mrjjM mrjj

        hi
        Do you have
        ui->TabWid->setContextMenuPolicy(Qt::CustomContextMenu);
        ?

        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

        @mrjj forgot about that crap... why it does'nt included by default.

        mrjjM 1 Reply Last reply
        0
        • EngelardE Engelard

          @mrjj forgot about that crap... why it does'nt included by default.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Engelard
          Well some widgets, like LineEdit has a context menu so
          setting CustomContextMenu as default would break all default context menus.

          1 Reply Last reply
          2

          • Login

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