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 7740785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:52:06+00:00 2026-06-01T08:52:06+00:00

My implementation of QTabWidget is not detecting its tabCloseRequested() and currentChanged() signals. TileSheetManager::TileSheetManager(QWidget *parent)

  • 0

My implementation of QTabWidget is not detecting its tabCloseRequested() and currentChanged() signals.

TileSheetManager::TileSheetManager(QWidget *parent)
: QTabWidget(parent)
{
    int w = WIDTH;
    int h = HEIGHT;

    this->setMinimumSize(w, h);
    this->setMaximumSize(w, h);

    setTabsClosable(true);
    setTabShape(QTabWidget::Rounded);

    connect(this, SIGNAL(tabCloseRequested(int index)), this, SLOT(closeTileWidget(int index)));
    connect(this, SIGNAL(currentChanged(int index)), this, SLOT(tabChanged(int index)));
}

qDebug() was not working for me, so I’m using a QMessageBox for this.

void TileSheetManager::closeTileWidget(int index)
{
   QMessageBox msgBox;
   msgBox.setText("Tab " + QString::number(index) + " removed!");
   msgBox.exec();

   TileWidget *t = (TileWidget *) widget(index) ;
   t->deleteLater();
   removeTab(index);
}

void TileSheetManager::tabChanged(int index)
{   
    QMessageBox msgBox;
    msgBox.setText("Tab was Changed!");
    msgBox.exec();

    TileWidget *t;

    for(int i = 0; i < count(); i++)
    {
        t = (TileWidget *) widget(i) ;
        t->resetSetBrush();
    }
} 

Tabs aren’t getting closed, selected brushes are not being reset, and I get no messages, so I’m concluding the signals aren’t being picked up. Which is weird, because I have used similar code for a previous project, in which case it worked.

  • 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-01T08:52:08+00:00Added an answer on June 1, 2026 at 8:52 am

    Don’t use variable names in the connect function :

    Note that the signal and slots parameters must not contain
    any variable names, only the type.

    The connection should be

    connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTileWidget(int)));
    connect(this, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The implementation is through a linked list. Would something like this be legal? int
The implementation of Enumerable.AsEnumerable<T>(this IEnumerable<T> source) simply returns source . However Observable.AsObservable<T>(this IObservable<T> source)
The implementation of ScrumJet on GitHub (as of this writing) shares essentially identical functions
Is there some implementation of java.util.Map that does not uses HashCode? I have the
Is the implementation below thread-safe? If not what am I missing? Should I have
In my implementation of Java NIO I have not been able to get SelectionKey.attach()
I'm writing an implementation of std::codecvt facet that uses iconv. This implementation stores a
My implementation of flatten looks like this: (define flatten (lambda (lst) (if (null? lst)
This is an implementation of readers writers, i.e. many readers can read but only
Does anyone have base32 implementation in Delphi? I found: http://cc.embarcadero.com/item/21566 but it is not

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.