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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:22:48+00:00 2026-06-16T04:22:48+00:00

I implemented a color Picker Menu, based on BlackDal ColorPicker In order to send

  • 0

I implemented a color Picker Menu, based on BlackDal ColorPicker

In order to send a signal, when a color has been selected, i added:

class RColorPicker : public QPushButton
{
    Q_OBJECT
signals:
   void selected( QColor color);
 ...

and

void RColorPicker::on_popup_selected( QColor color )
{
   _selectedColor = color;
   repaint();
   emit selected( color );

Sowewhere else i connect to that signal like

fillColorButton     = new RColorPicker()
connect(fillColorButton    , SIGNAL(selected(QColor)), this,  SLOT(fillColorButtonTriggered(QColor)) );

This works, when a color is selected from the PopUpMenu, but if i choose “More…” in the PopUp and then select a color from the called QColorDialog, the connected slot fillColorButtonTriggered is not called. Instaed, in my MDI-Application a different document becomes the active window. Although it should:

   void RColorPickerPopup::mousePressEvent ( QMouseEvent *event )
   { 
     ...
     QColorDialog *dialog = new QColorDialog( this );
     if( dialog->exec() )
     {
        hoverColor = dialog->selectedColor();
        delete dialog;
        emit selected( hoverColor );
        this->close();

The Problem does not occur, if i replace the QColorDialog by a native windows ChooseColor dialog.

Does anybody have a hint, what the problem is here?

  • 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-16T04:22:49+00:00Added an answer on June 16, 2026 at 4:22 am

    I finally found the answer myself:
    The problem is, that the Qt MDI Sample, that i used, had a function like this:

    MdiChild *MainWin::activeMdiChild()
    {
        if (QMdiSubWindow *activeSubWindow = mdiArea->activeSubWindow())
            return qobject_cast<MdiChild *>(activeSubWindow);
        return 0;
    }
    

    The Problem is that

    if a widget outside the MDI area is the active window, no subwindow
    will be active

    (see Qt Documentation)

    Obviously as soon as i display a modal Qt Dialog, no MDI Child Window does have focus any more – if i use a native Windows Dialog this seems not to be the case. When i try to set the color of selected elements i called MainWin::activeMdiChild which returns NULL if a Qt Dialog is on top (Yes, i should have checked for returning NULL, which was unexpected at this point).

    The solution was, to replace activeSubWindow with currentSubWindow.

    MdiChild *MainWin::activeMdiChild()
    {
        if (QMdiSubWindow *activeSubWindow = mdiArea->currentSubWindow())
            return qobject_cast<MdiChild *>(activeSubWindow);
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement a font and color picker in my project. I implemented
I have implemented my webpage menu by inline li-s of ul. li has a
For a jQuery colorpicker I've been working on (https://github.com/vanderlee/colorpicker), I've been asked to implement
I've downloaded the Really Simple Color Picker in jQuery from this site I've followed
You know those color picker buttons with a little rectangle in it, displaying the
I've implemented a simple mouse listener where the background color changes whenever the mouse
I'm currently working on an color-picker component using HTML, CSS and Javascript, one major
There are so many color picker for jQuery but when I try to implement
I have implemented one algorithm (RLSR) which there are two regularization factor. Based on
I have implemented the CCLabelProtocol and CCRGBAProtocol with a class which I named Label:

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.