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. Qt 4.7 on wince, Remove form title bar, Modal window is invalid

Qt 4.7 on wince, Remove form title bar, Modal window is invalid

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 541 Views
  • 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.
  • CraigTaoC Offline
    CraigTaoC Offline
    CraigTao
    wrote on last edited by
    #1
    
    
    class CDlgCalibrationMain : public QDialog
    {
    	Q_OBJECT
    
    public:
    	CDlgCalibrationMain(QWidget *parent = 0);
    	~CDlgCalibrationMain();
    
    }
    
    CDlgCalibrationMain::CDlgCalibrationMain(QWidget *parent)
    	: QDialog(parent)
    {
    	ui.setupUi(this);
    	
    	//remove windows title
    	this->setWindowFlags(Qt::FramelessWindowHint);
    	//this->showMaximized();
    	//this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
    	this->setModal(true);
    }
    
    CDlgCalibrationMain::~CDlgCalibrationMain()
    {
    
    }
    
    
    
    //
    VirtualRunQt::VirtualRunQt(QWidget *parent, Qt::WFlags flags)
    	: QMainWindow(parent, flags), m_bBootCompleted(false)
    {
    	ui.setupUi(this);
    
    	m_dlg_calibration_main = new CDlgCalibrationMain(this);
    	m_dlg_calibration_main->showNormal();
    	m_dlg_calibration_main->hide();
    
    	connect(ui.btn_calibration, SIGNAL(clicked(bool)), this, SLOT(on_clicked_btn_calibration()));
    }
    
    
    void VirtualRunQt::on_clicked_btn_calibration()
    {
    	m_dlg_calibration_main->exec();
    }
    

    when i click button call function on_clicked_btn_calibration()
    then the dialog show
    m_dlg_calibration_main->exec();

    but, i can still click other dialog's button,

    i don't know why? some could help, please!

    God bless you!

    CraigTaoC MijazM 4 Replies Last reply
    0
    • CraigTaoC CraigTao
      
      
      class CDlgCalibrationMain : public QDialog
      {
      	Q_OBJECT
      
      public:
      	CDlgCalibrationMain(QWidget *parent = 0);
      	~CDlgCalibrationMain();
      
      }
      
      CDlgCalibrationMain::CDlgCalibrationMain(QWidget *parent)
      	: QDialog(parent)
      {
      	ui.setupUi(this);
      	
      	//remove windows title
      	this->setWindowFlags(Qt::FramelessWindowHint);
      	//this->showMaximized();
      	//this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
      	this->setModal(true);
      }
      
      CDlgCalibrationMain::~CDlgCalibrationMain()
      {
      
      }
      
      
      
      //
      VirtualRunQt::VirtualRunQt(QWidget *parent, Qt::WFlags flags)
      	: QMainWindow(parent, flags), m_bBootCompleted(false)
      {
      	ui.setupUi(this);
      
      	m_dlg_calibration_main = new CDlgCalibrationMain(this);
      	m_dlg_calibration_main->showNormal();
      	m_dlg_calibration_main->hide();
      
      	connect(ui.btn_calibration, SIGNAL(clicked(bool)), this, SLOT(on_clicked_btn_calibration()));
      }
      
      
      void VirtualRunQt::on_clicked_btn_calibration()
      {
      	m_dlg_calibration_main->exec();
      }
      

      when i click button call function on_clicked_btn_calibration()
      then the dialog show
      m_dlg_calibration_main->exec();

      but, i can still click other dialog's button,

      i don't know why? some could help, please!

      God bless you!

      CraigTaoC Offline
      CraigTaoC Offline
      CraigTao
      wrote on last edited by
      #2

      i use IDE is visual studio 2008,

      on windows still the problem,

      1 Reply Last reply
      0
      • CraigTaoC CraigTao
        
        
        class CDlgCalibrationMain : public QDialog
        {
        	Q_OBJECT
        
        public:
        	CDlgCalibrationMain(QWidget *parent = 0);
        	~CDlgCalibrationMain();
        
        }
        
        CDlgCalibrationMain::CDlgCalibrationMain(QWidget *parent)
        	: QDialog(parent)
        {
        	ui.setupUi(this);
        	
        	//remove windows title
        	this->setWindowFlags(Qt::FramelessWindowHint);
        	//this->showMaximized();
        	//this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
        	this->setModal(true);
        }
        
        CDlgCalibrationMain::~CDlgCalibrationMain()
        {
        
        }
        
        
        
        //
        VirtualRunQt::VirtualRunQt(QWidget *parent, Qt::WFlags flags)
        	: QMainWindow(parent, flags), m_bBootCompleted(false)
        {
        	ui.setupUi(this);
        
        	m_dlg_calibration_main = new CDlgCalibrationMain(this);
        	m_dlg_calibration_main->showNormal();
        	m_dlg_calibration_main->hide();
        
        	connect(ui.btn_calibration, SIGNAL(clicked(bool)), this, SLOT(on_clicked_btn_calibration()));
        }
        
        
        void VirtualRunQt::on_clicked_btn_calibration()
        {
        	m_dlg_calibration_main->exec();
        }
        

        when i click button call function on_clicked_btn_calibration()
        then the dialog show
        m_dlg_calibration_main->exec();

        but, i can still click other dialog's button,

        i don't know why? some could help, please!

        God bless you!

        CraigTaoC Offline
        CraigTaoC Offline
        CraigTao
        wrote on last edited by
        #3

        this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::SubWindow);

        can solve this problem, but Draw presence flicker

        1 Reply Last reply
        0
        • CraigTaoC CraigTao
          
          
          class CDlgCalibrationMain : public QDialog
          {
          	Q_OBJECT
          
          public:
          	CDlgCalibrationMain(QWidget *parent = 0);
          	~CDlgCalibrationMain();
          
          }
          
          CDlgCalibrationMain::CDlgCalibrationMain(QWidget *parent)
          	: QDialog(parent)
          {
          	ui.setupUi(this);
          	
          	//remove windows title
          	this->setWindowFlags(Qt::FramelessWindowHint);
          	//this->showMaximized();
          	//this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
          	this->setModal(true);
          }
          
          CDlgCalibrationMain::~CDlgCalibrationMain()
          {
          
          }
          
          
          
          //
          VirtualRunQt::VirtualRunQt(QWidget *parent, Qt::WFlags flags)
          	: QMainWindow(parent, flags), m_bBootCompleted(false)
          {
          	ui.setupUi(this);
          
          	m_dlg_calibration_main = new CDlgCalibrationMain(this);
          	m_dlg_calibration_main->showNormal();
          	m_dlg_calibration_main->hide();
          
          	connect(ui.btn_calibration, SIGNAL(clicked(bool)), this, SLOT(on_clicked_btn_calibration()));
          }
          
          
          void VirtualRunQt::on_clicked_btn_calibration()
          {
          	m_dlg_calibration_main->exec();
          }
          

          when i click button call function on_clicked_btn_calibration()
          then the dialog show
          m_dlg_calibration_main->exec();

          but, i can still click other dialog's button,

          i don't know why? some could help, please!

          God bless you!

          MijazM Offline
          MijazM Offline
          Mijaz
          wrote on last edited by
          #4

          @CraigTao
          Please elaborate your question.
          Do you want to remove title bar from your application?

          1 Reply Last reply
          0
          • CraigTaoC CraigTao
            
            
            class CDlgCalibrationMain : public QDialog
            {
            	Q_OBJECT
            
            public:
            	CDlgCalibrationMain(QWidget *parent = 0);
            	~CDlgCalibrationMain();
            
            }
            
            CDlgCalibrationMain::CDlgCalibrationMain(QWidget *parent)
            	: QDialog(parent)
            {
            	ui.setupUi(this);
            	
            	//remove windows title
            	this->setWindowFlags(Qt::FramelessWindowHint);
            	//this->showMaximized();
            	//this->setWindowFlags(this->windowFlags() & ~Qt::WindowMaximizeButtonHint);
            	this->setModal(true);
            }
            
            CDlgCalibrationMain::~CDlgCalibrationMain()
            {
            
            }
            
            
            
            //
            VirtualRunQt::VirtualRunQt(QWidget *parent, Qt::WFlags flags)
            	: QMainWindow(parent, flags), m_bBootCompleted(false)
            {
            	ui.setupUi(this);
            
            	m_dlg_calibration_main = new CDlgCalibrationMain(this);
            	m_dlg_calibration_main->showNormal();
            	m_dlg_calibration_main->hide();
            
            	connect(ui.btn_calibration, SIGNAL(clicked(bool)), this, SLOT(on_clicked_btn_calibration()));
            }
            
            
            void VirtualRunQt::on_clicked_btn_calibration()
            {
            	m_dlg_calibration_main->exec();
            }
            

            when i click button call function on_clicked_btn_calibration()
            then the dialog show
            m_dlg_calibration_main->exec();

            but, i can still click other dialog's button,

            i don't know why? some could help, please!

            God bless you!

            MijazM Offline
            MijazM Offline
            Mijaz
            wrote on last edited by
            #5

            @CraigTao

            just add this line in projectt.cpp

                setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint);
            

            for example in my case:

            #include "exit_lock.h"
            #include "ui_exit_lock.h"
            #include <QMessageBox>
            #include <QDebug>
            exit_lock::exit_lock(QWidget *parent) :
                QDialog(parent),
                ui(new Ui::exit_lock)
            {
                ui->setupUi(this);
                setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint);
            
                connect(ui->zero,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->one,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->two,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->three,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->four,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->five,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->six,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->seven,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->eight,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->nine,SIGNAL(clicked()),this,SLOT(number_check()));
                connect(ui->clear,SIGNAL(clicked()),this,SLOT(number_check()));
            }
            
            exit_lock::~exit_lock()
            {
                delete ui;
            }
            void exit_lock::number_check()
            {
                QPushButton *any_button = (QPushButton *) sender();
            
                double storing_numbers;
            
                QString st_convert;
            
                storing_numbers = (ui->Password->text() + any_button->text()).toDouble();
            
                st_convert = QString::number(storing_numbers, 'g', 12);
            
                ui->Password->setText(st_convert);
            }
            void exit_lock::on_pushButton_clicked()
            {
              //  qDebug() << "Inside Login";
                QString password =ui->Password->text();
                if(password == "12345")
                {
                    // qDebug() << " Login password is corrent";
                    QMessageBox::information(this, "Login", "password is correct");
                    hide(); //if not hide then when exit current window it will come back to previous window
            
                  close();
                }
                else{
                    // qDebug() << " Login password is not corrent";
                    QMessageBox::warning(this, "Login" ,"Plese try again your password is not correct");
                }
            }
            
            
            
            1 Reply Last reply
            0
            • CraigTaoC Offline
              CraigTaoC Offline
              CraigTao
              wrote on last edited by
              #6

              remove title bar from dialog, and can modal dialog,
              i use Qt::Dialog | Qt::FramelessWindowHint Implement function,
              but . When the form is displayed, the border appears first, and then the interior of the form is displayed.

              1 Reply Last reply
              0
              • CraigTaoC Offline
                CraigTaoC Offline
                CraigTao
                wrote on last edited by
                #7

                if use setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint);

                2.png

                1.png

                i use setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::SubWindow);

                3.png

                4.png

                5.png

                6.png

                if use setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint)
                perfect! but GUI not modal (i can clicked other child button),
                just code modal

                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